in reply to Re: Avoiding Globals with OO Perl
in thread Avoiding Globals with OO Perl
I am learning alot thank you all.
Want I want to avoid is this. Passing variables to subroutines that don't use them because subs inside need them
#pass in vars some of which won't be used till deep #nested sub work($a,$b,$c,$d,$e,$f); sub work{ my ($a,$b,$c,$d,$e,$f) = @_; more_work($b,$c); print "$a\n"; } more_work{ my ($b,$c) = @_; even_more_work($c); print "$b\n"; } even_more_work{ $c = shift; print "$c\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Avoiding Globals with OO Perl
by BrowserUk (Patriarch) on Oct 20, 2011 at 20:15 UTC | |
|
Re^3: Avoiding Globals with OO Perl
by GrandFather (Saint) on Oct 21, 2011 at 11:14 UTC | |
|
Re^3: Avoiding Globals with OO Perl
by fisher (Priest) on Oct 24, 2011 at 06:02 UTC |