in reply to use, require, do or what?

Disclaimer: please heed those who suggest wrapping the Library code into one or more subroutines that return the desired values. Or failing that, use our() variables. Do not do the following.

The "what" you are looking for is the mystical map{eval(readline!open(!((*{!$_},$/)=\$_)))} operator. Example (given $variable1 = "SOME CALCULATION"; in Library.pl):

$ perl -w my $variable1; map{eval(readline!open(!((*{!$_},$/)=\$_)))} "Library.pl"; print "$variable1\n"; __END__ SOME CALCULATION
(based on theDamian evilness, improved by ysth)

Replies are listed 'Best First'.
Re^2: use, require, do or what?
by TGI (Parson) on Jul 30, 2008 at 22:34 UTC

    Truly evil. It makes my head hurt. Did I say that that is truly evil?

    Unfortunately, I don't have 6 or 7 free hours to figure it out for myself. Would you be willing to explain how it works to the slow among us? Or do you have a link that does?

    Update: I just occurred to me that the perfect name for this 'operator' is the "Scanners operator", in reference to the movie Scanners, especially for the infamous head exploding scene--WARNING!!! that link leads to a clip of the gruesome and truly infamous scene.


    TGI says moo