in reply to Getting the DATA section of one module in the import() of another
I don't know how late you can get the information that you need, however if you don't need it before actual execution of code, this may do what you want.
package SomethingOrAnother; BEGIN { my @incoming; my $otherdata; my $table; } INIT { local $/; $table = <$otherdata>; } sub import { my $self = shift; @incoming = @_; my ($caller) = caller; $otherdata = *{"$caller\::DATA"}; *{"$caller\::table"} = \${"$self\::table"}; } 1;
Update: Noticed you used $table so made it into an export.
Hope this helps.
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
|
|---|