esskar has asked for the wisdom of the Perl Monks concerning the following question:
works, reads the __DATA__ section in Foo and writes it to $foomy $foo = do { package Foo; local $/; <DATA>; };
does not work - probably because eval "package $bar" has its own scope.my $class = 'Bar'; my $bar = do { eval "package $bar"; local $/; <DATA>; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: package and do
by ikegami (Patriarch) on Feb 03, 2006 at 04:52 UTC | |
|
Re: package and do
by reneeb (Chaplain) on Feb 03, 2006 at 00:59 UTC |