It requires perl version 5.6.0 or higher.
It sounds like you are using a version that predates
that. It should work if you just remove the "our"
on the first line.
(update:) then again, tests don't reveal that:
fred$ perl
#!/usr/bin/perl -w
package DB;$sub='main::er';sub BEGIN {$^P=1 unless$sub;
$^P or $_="Not just another perl hack"}sub sub(hack){print
$sub =~ /([^:]+)$/, $", or &$sub} *hacker = \⊂ package
main;sub er {print ",\n"}sub just {for(split' '=>`perldoc`
){print $1 if /(\w{4})\d\w/;}}sub hack {print "hacker"}sub
another { seek DATA, 0, 0;print +(/(\w{6})\d/)?'':$1 while
<DATA>;DB::hacker();}sub perl { print }$_ and print "$_\n"
;foreach (qw{just another perl hack}) {$_->();}print "\n";
(control-D)
Segmentation fault
fred$ perl -v
This is perl, version 5.005_02 built for sun4-solaris-thread
Weird.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.