in reply to Coderef from scalar.
I wouldn't use an eval, if it's not necessary.
perl -e '$code = sub{ print "Ovid is a blowhard\n" };&$code'
This is better because your code is checked at compile time and you don't reinvoke the Perl interpreter.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Ovid) Re: Coderef from scalar.
by vaevictus (Pilgrim) on Dec 29, 2001 at 05:10 UTC | |
by Ovid (Cardinal) on Dec 29, 2001 at 05:16 UTC | |
by vaevictus (Pilgrim) on Dec 29, 2001 at 05:32 UTC | |
by Fastolfe (Vicar) on Dec 29, 2001 at 09:49 UTC |