in reply to "use" file...
Which brings me to the second point. You can't provide a variable string to use, but you can decompose it to its definition: a BEGIN block around a require and a method call:
## replace "use $string @imports" with: BEGIN { (my $filename = $string) =~ s,::,/,g; # unix/windows only require $filename; $string->import(@imports); }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:(merlyn) Re: "use" file...
by demerphq (Chancellor) on Feb 08, 2003 at 23:25 UTC | |
by merlyn (Sage) on Feb 09, 2003 at 17:45 UTC |