in reply to shift method
Yes shift is intended to be used in this way.
Anyway if you have doubts, as i frequently have, add a firendly print statement as basic debug tool:
sub run_tests{ my $browser = shift; print "The sub 'run_test' received [$browser] as parameter\n";
if your program handles also other parameter maybe you can have a debug one so you can fill your programs of stuff like:
print "The sub 'run_test' received [$browser] as parameter\n" if + $debug;
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: shift method
by Chaoui05 (Scribe) on Apr 18, 2016 at 10:28 UTC |