On Dec 4, Hans Ginzel said:
> func1 $a, ++$a;
> func2 $opt, @arg eq "" && (shift, 1) ? @defaults : (), @arg;
> Would the second argument of func1 always be greather than the first?
>Would the @arg array be shifted in second case if the first element is
>undef or zero string?
As it stands now, func1() would be getting the same value twice. Why?
Because values are sent by alias whenever possible (which is similar to
passing by reference and then magically dereferencing). What this means
is that the VALUE of $a is not the first argument, but something that is
an alias for it. So, the second argument, ++$a, increments $a's value.
This means that the first argument, which is an alias to $a, reflects that
change in $a's value.
Jeff "japhy" Pinyan japhy@... http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
<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. ]