You made a classic shell quoting error - use double quotes for the internal quotes:
perl -le 'package foo ;print eval("__PACKAGE__");'
or, when your shell only gives you one flavour of quote, use Perls superior quoting facilities:
perl -le 'package foo ;print eval(q(__PACKAGE__));'
In reply to Re^2: eval('__PACKAGE__') is always main?!!!
by Corion
in thread eval('__PACKAGE__') is always main?!!!
by gmpassos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |