On Tue, Jul 31, 2001 at 04:00:44PM +0200, Marc A. Lehmann wrote:
>
> The problem comes from the fact that scalars are passed by value (good
> idea usually), and perl implements this by copying (usually a good idea as
> well).
Oh, really?
#!/opt/perl/bin/perl -w
sub foo {$_ [0] ++}
$_ = 1;
foo $_;
print;
__END__
2
Perl passes by reference, not value, as is documented in "man perlsub".
Abigail
- Re: Sorting in-place (SOLVED?... Bernie Cosell
- Re: Sorting in-place (SOLVED?... Abigail
- Re: Sorting in-place Michael G Schwern
- Re: Sorting in-place pcg
- Re: Sorting in-place Ronald J Kimball
- Re: Sorting in-place pcg
- Re: Sorting in-place Ronald J Kimball
- Re: Sorting in-place Clinton A . Pierce
- Re: Sorting in-place Bart Lateur
- Re: Sorting in-place pcg
- Re: Sorting in-place Abigail
- Re: Sorting in-place Michael G Schwern
- Re: Sorting in-place Ilmari Karonen
- Re: Sorting in-place pcg
- Re: Sorting in-place Ilmari Karonen
- Re: Sorting in-place Andrew Pimlott
- Re: Sorting in-place Ilmari Karonen
- Re: Sorting in-place Bart Lateur
- Re: Sorting in-place Ronald J Kimball
- Re: Sorting in-place pcg
