in reply to Problem Declaring Variable
There are two solutions, one better than the other.
This is considered better because you could then re-use the print_report() function with some other script and it wouldn't depend on $yesterday being declared for it.my $yesterday = &read_benchmark(); ... &print_report($yesterday); ... sub print_report { my ($yesterday) = @_; # Rest of function the same. }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Problem Declaring Variable
by derby (Abbot) on Mar 13, 2002 at 16:19 UTC | |
by Juerd (Abbot) on Mar 13, 2002 at 16:46 UTC | |
|
Re: Re: Problem Declaring Variable
by Juerd (Abbot) on Mar 13, 2002 at 16:49 UTC |