Ea has asked for the wisdom of the Perl Monks concerning the following question:
In my brand spanking new module, I'm trying to read in three
arguments with what I thought was a standard trick of using
shift
sub encode_string ($$$) { my ($reg, $ass, $check) = @_; return join $Delimiter, $reg, $ass, $check; }populates all three scalars, but
my ($reg, $ass, $check) = shift;only populates the first one and the other two are undef. Why? Is this something to do with having the sub in a module and me shifting on the wrong list?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: shifting arguments
by ozone (Friar) on Aug 22, 2001 at 20:02 UTC | |
Re: shifting arguments
by MZSanford (Curate) on Aug 22, 2001 at 20:04 UTC | |
by Ea (Chaplain) on Aug 23, 2001 at 13:15 UTC | |
Re: shifting arguments
by dga (Hermit) on Aug 22, 2001 at 20:41 UTC | |
Re: shifting arguments
by damian1301 (Curate) on Aug 22, 2001 at 21:34 UTC | |
by dragonchild (Archbishop) on Aug 22, 2001 at 21:40 UTC | |
by Ea (Chaplain) on Aug 23, 2001 at 12:45 UTC |
Back to
Seekers of Perl Wisdom