
" VIM: set fdm=marker:
" Generated by VIM SnippetsEMU Converter
"
if !exists('loaded_snippet') || &cp
    finish
endif

let st = g:snip_start_tag
let et = g:snip_end_tag
let cd = g:snip_elem_delim

" Functions {{{
function! Count(haystack, needle)
    let counter = 0
    let index = match(a:haystack, a:needle)
    while index > -1
        let counter = counter + 1
        let index = match(a:haystack, a:needle, index+1)
    endwhile
    return counter
endfunction

"function! ArgList(count)
"    " This returns a list of empty tags to be used as 
"    " argument list placeholders for the call to printf
"    let st = g:snip_start_tag
"    let et = g:snip_end_tag
"    if a:count == 0
"        return ""
"    else
"        return repeat(', '.st.et, a:count)
"    endif
"endfunction
"
" }}}
exec "Snippet sub sub ".st.et." {<CR><TAB>my ( ".st.et." ) = @_;<CR><TAB>".st.et."<CR>}<CR>"
exec "Snippet for for my ".st."var".et." ( ".st."list".et." ) {<CR><TAB>".st.et."<CR>}<CR>"
exec "Snippet while while ( ".st.et." ) {<CR>    ".st.et."<CR>}<CR>"
exec "Snippet if if ( ".st.et." ) {<CR><TAB>".st.et."<CR>}<CR>"
exec "Snippet else else {<CR><TAB>".st.et."<CR>}<CR>"
exec "Snippet elsif elsif( ".st.et." ) {<CR><TAB>".st.et."<CR>}<CR>"
exec "Snippet sh my ".st.et." = shift;".st.et."<CR>"
exec "Snippet shs my ( ".st.et." ) = @_;".st.et."<CR>"
exec "Snippet udp use Data::Dumper::Simple;".st.et."<CR>"
exec "Snippet dp warn Dumper( ".st.et." );".st.et."<CR>"
exec "Snippet udt use DateTime;".st.et."<CR>"
exec "Snippet dt my ".st."var".et." = DateTime->".st."method".et."( ".st."parameters".et." );".st.et."<CR>"
exec "Snippet dtnew my ".st."var".et." = DateTime->new( ".st."parameters".et." );".st.et."<CR>"
exec "Snippet dtnow DateTime->now;".st.et."<CR>"
exec "Snippet new sub new {<CR><TAB>my $class = shift;<CR><TAB>my $self = {<CR><TAB><TAB>".st.et."<CR><TAB><TAB>};<CR><TAB>".st.et."<CR><TAB>bless $self,$class;<CR><TAB>".st.et."<CR><TAB>return $self;<CR>}<CR>"
exec "Snippet o open( ".st."file_handler".et." , \"".st."operator".et."\", ".st."filename".et." ) <CR><TAB>or die \"Cannot open ".st."filename".et." - $!\";<CR>"
exec "Snippet pkg package ".st."modname".et.";<CR>use strict;<CR>use warnings;<CR>use utf8;<CR><CR>sub new {<CR><TAB>".st."new".et."<CR>}<CR><CR>1;<CR>"
exec "Snippet tpl template '".st."path".et."' => sub {<CR>    ".st.et."<CR>};<CR>"
exec "Snippet thread use threads;<CR>use threads::shared;<CR>my ".st."threadname".et." = threads->new( \\&".st."functionname".et.");<CR>".st."threadname".et."->".st."detachjoinyield".et.";<CR>".st.et."<CR>"
exec "Snippet lwp use LWP::Simple;<CR>my ".st."var".et." = get( ".st."url".et." );<CR>".st.et."<CR>"
exec "Snippet b BEGIN {<CR><TAB>".st.et."<CR>}<CR>"
exec "Snippet uit use Iterator;<CR>my ".st."iterator".et." = Iterator->new ( ".st."subref".et." );<CR>".st.et."<CR>"
exec "Snippet itv my ".st."value".et." = ".st."iterator".et."->value();<CR>".st.et."<CR>"
exec "Snippet ite ".st."iterator".et."->is_exhausted()".st.et."<CR>"
exec "Snippet itd Iterator::is_done()".st.et."<CR>"
exec "Snippet s s{".st."pattern".et."}{".st."needle".et."}".st."ig".et.";".st.et."<CR>"
exec "Snippet returnif return ".st.et." if ( ".st.et." );<CR>"
exec "Snippet nextif next if ( ".st.et." );<CR>"
