Don't ask to ask, just ask | |
PerlMonks |
Re: Not quite understanding a couple of thingsby liverpole (Monsignor) |
on May 25, 2007 at 00:16 UTC ( [id://617365]=note: print w/replies, xml ) | Need Help?? |
Hi pikablu,
$_ is the default variable, when you don't supply one. It can be used as the default to many functions, as well as the default value in numerous contexts, and is kind of similar to the English pronoun "it". For example, you could either do:
Or you could do, instead:
In contrast, @_ is the default array. One place where it's used quite extensively is in a subroutine, to refer to passed arguments. For example:
To begin to get acquainted with hashes (and a lot more), please read perlintro for starters. s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Seekers of Perl Wisdom
|
|