I have yet another general question. I'm working on debugging a perl program, and have been having to do a lot of reverse-engineering. With my primitive understanding of Perl this has been difficult, but I think I'm almost there. I just need (maybe) one piece of crucial information. Here is the subroutine I'm looking at:
sub SearchPubMed { my $InputRow = shift; # temporary! InputRow = SearchTermID my $QueryID = shift; my $CannedQueriesPurpose = shift; my $CannedQueriesQuery = shift; my $query;
What exactly does it mean to define variables as shift? I understand that the shift operator grabs the first element of an array, and that when "shift" appears next to white space, it is assumed that it is grabbing from the @_ special array variable. I don't totally understand where @_ has come from here and what is stored in it. Can someone shed some light onto the @_ special variable for me? Thanks oodles.
In reply to shift operator by molly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |