in reply to Eval and $@% ...
For starters, you probably would like to read perlref, perlreftut link here, perldsc and perltoot.
The eval solution is nice. But I don't see where you get the $type from.
Well, if you have a CODE (it's actually a sort of ref) and the functions are garanteed to neglect the input, you could use CODE => '&'.
To handle REFs, add: $type = ref( $_[0] ) if $type eq 'REF';, the eval part doesn't change!
A GLOB is more problematic. You have to put it into brackets so add an extra if statement:
if( $type eq 'GLOB' ){ return <$_[0]>; elsif( isa.....
Hope this helps,
Jeroen
"We are not alone"(FZ)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Eval and $@% ...
by bbfu (Curate) on Jun 19, 2001 at 01:57 UTC | |
by jeroenes (Priest) on Jun 19, 2001 at 02:09 UTC | |
by srawls (Friar) on Jun 19, 2001 at 05:11 UTC | |
by Abigail (Deacon) on Jun 19, 2001 at 09:56 UTC |
In Section
Seekers of Perl Wisdom