Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: eval('__PACKAGE__') is always main?!!!

by ikegami (Pope)
on Dec 23, 2004 at 21:09 UTC ( #417210=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    sub moo { print("moooooain\n"); }
    package cow;
    sub moo { print("moooOoooOOoooo\n"); }  # <--- prints this
    eval 'moo();';
  2. or download this
    > echo "print(__PACKAGE__, $/);" >
    > perl -e "package foo; do '';"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://417210]
[choroba]: just one of its angles, in fact
[LanX]: <|--
[choroba]: Reminds me of an old joke about an orchestra...
erix imagines that in a true Lancs accent
[choroba]: so a Czech orchestra rehearses a new piece by a German composer
LanX LOL of the day ... the Turkish Anonymous Alcoholics stopped their "No to alcohol" campaign for political reasons ...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-03-27 11:46 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (319 votes). Check out past polls.