in reply to Re: pop sort strangeness
in thread pop sort strangeness
It's kind of cheating in the "one-line" department, and I don't recommend it as clear programming, but it illustrates that "a BLOCK returning a reference" really means a BLOCK, not just an expression in curlies. Obviously the clear way to write it would bemy $max = pop @{@vals=sort @vals; \@vals};
@vals = sort @vals; my $max = pop @vals;
|
|---|