in reply to Defining variable for module, but IŽll only have it later
It looks to me like you need your FatalsToEmail module to take a reference to a scalar and you need to pass it a reference to $fte_username.
Your package might look something like this...
And you'd use that something like this...package FatalsToClient; use vars qw($client); sub import { my $pkg = shift; my %args = @_; $client = $args{Client}; } 1;
Please recognize that this code is just for illustration. You'll want yours to be somewhat cleaner I expect.my $fte_username = ""; use FatalsToClient (Client => \$fte_username); $fte_username = "client"; print $$FatalsToClient::client, $/; $fte_username = "something else"; print $$FatalsToClient::client, $/;
-sauoq "My two cents aren't worth a dime.";
|
|---|