home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / gedit-2 / plugins / snippets / perl.xml < prev    next >
Encoding:
Extensible Markup Language  |  2006-08-27  |  2.7 KB  |  121 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <snippets language="Perl">
  3.   <snippet id="ife">
  4.     <text><![CDATA[if ($1) {
  5.     ${2:# body...}
  6. } else {
  7.     ${3:# else...}
  8. }
  9. ]]></text>
  10.     <description>Conditional if..else</description>
  11.     <tag>ife</tag>
  12.   </snippet>
  13.   <snippet id="ifee">
  14.     <text><![CDATA[if ($1) {
  15.     ${2:# body...}
  16. } elsif ($3) {
  17.     ${4:# elsif...}
  18. } else {
  19.     ${5:# else...}
  20. }
  21. ]]></text>
  22.     <description>Conditional if..elsif..else</description>
  23.     <tag>ifee</tag>
  24.   </snippet>
  25.   <snippet id="xunless">
  26.     <text><![CDATA[${1:expression} unless ${2:condition};
  27. ]]></text>
  28.     <description>Conditional one-line</description>
  29.     <tag>xunless</tag>
  30.   </snippet>
  31.   <snippet id="xif">
  32.     <text><![CDATA[${1:expression} if ${2:condition};
  33. ]]></text>
  34.     <description>Conditional one-line</description>
  35.     <tag>xif</tag>
  36.   </snippet>
  37.   <snippet id="eval">
  38.     <text><![CDATA[eval {
  39.     ${1:# do something risky...}
  40. };
  41. if ($@) {
  42.     ${2:# handle failure...}
  43. }
  44. ]]></text>
  45.     <description>Try/Except</description>
  46.     <tag>eval</tag>
  47.   </snippet>
  48.   <snippet id="fore">
  49.     <text><![CDATA[foreach ${1:my \$${2:x} }(@${3:array}) {
  50.     ${4:# body...}
  51. }
  52. ]]></text>
  53.     <description>Loop</description>
  54.     <tag>fore</tag>
  55.   </snippet>
  56.   <snippet id="for">
  57.     <text><![CDATA[for (my \$${1:var} = 0; \$$1 < ${2:expression}; \$$1++) {
  58.     ${3:# body...}
  59. }
  60. ]]></text>
  61.     <description>Loop</description>
  62.     <tag>for</tag>
  63.   </snippet>
  64.   <snippet id="sub">
  65.     <text><![CDATA[sub ${1:function_name} {
  66.     ${2:# body...}
  67. }
  68. ]]></text>
  69.     <description>Function</description>
  70.     <tag>sub</tag>
  71.   </snippet>
  72.   <snippet id="hashpointer">
  73.     <text><![CDATA[ => ]]></text>
  74.     <accelerator><![CDATA[<Shift><Alt>l]]></accelerator>
  75.     <description>hash pointer</description>
  76.   </snippet>
  77.   <snippet id="if">
  78.     <text><![CDATA[if ($1) {
  79.     ${2:# body...}
  80. }
  81. ]]></text>
  82.     <description>Conditional</description>
  83.     <tag>if</tag>
  84.   </snippet>
  85.   <snippet id="xfore">
  86.     <text><![CDATA[${1:expression} foreach @${2:array};
  87. ]]></text>
  88.     <description>Loop one-line</description>
  89.     <tag>xfore</tag>
  90.   </snippet>
  91.   <snippet id="xwhile">
  92.     <text><![CDATA[${1:expression} while ${2:condition};
  93. ]]></text>
  94.     <description>Loop one-line</description>
  95.     <tag>xwhile</tag>
  96.   </snippet>
  97.   <snippet id="slurp">
  98.     <text><![CDATA[my \$${1:var};
  99. { local \$/ = undef; local *FILE; open FILE, "<${2:file}"; \$$1 = <FILE>; close FILE }
  100. ]]></text>
  101.     <description>Read File</description>
  102.     <tag>slurp</tag>
  103.   </snippet>
  104.   <snippet id="unless">
  105.     <text><![CDATA[unless ($1) {
  106.     ${2:# body...}
  107. }
  108. ]]></text>
  109.     <description>Conditional</description>
  110.     <tag>unless</tag>
  111.   </snippet>
  112.   <snippet id="while">
  113.     <text><![CDATA[while ($1) {
  114.     ${2:# body...}
  115. }
  116. ]]></text>
  117.     <description>Loop</description>
  118.     <tag>while</tag>
  119.   </snippet>
  120. </snippets>
  121.