in reply to shift method

welcome to the monastery Chaoui05 and welcome to the wonderful world of Perl

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*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: shift method
by Chaoui05 (Scribe) on Apr 18, 2016 at 10:28 UTC

    Thanks !