On Thu, 25 Mar 2010 17:13:53 +0200
Shlomi Fish <[email protected]> wrote:
> sub display_page
> {
> my $a_server = shift;
> my $a_pass = shift;
> .
> .
> .
> }
> }}}
>
> (shift is short for << shift(@_) >> )
If you're going to use shift, name the array.
my $var;
sub foo {
$var = shift; # shifts @_
}
{
$var = shift; # shifts @ARGV
}
Without the array, it's easy to forget what is being shifted.
Remember, things that behave differently should look different.
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.
Eliminate software piracy: use only FLOSS.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/