On Feb 12, Steven M. Klass said: >&Somefunction($var1, \@arry) > >sub SomeFunction { > my $var = $_[0]; # XXX you were missing a ; here > my $array = shift; Uh, $array and $var have the same value now. shift() removes the first element from an array (defaulting to @_) and returns it. The first element of @_ is $_[0], which is $var1. Saying my $var = $_[0]; is not the same as my $var = shift; The first one does NOT remove the element from @_; the second one DOES. -- Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ]Thread Previous | Thread Next