http://qs1969.pair.com?node_id=745775


in reply to my $a outside sort block incompatibility

I thought I'd previously found a way of using "local" to get around this but I can't reconstruct it now.

#!/usr/bin/perl use strict; use warnings; my @arr1 = ( 1, 3, 5, 2, 4, 6 ); my @arr2; local $a = 'whatever'; { @arr2 = sort { $a <=> $b } @arr1; } print join( ' ', @arr2 ), "\n";


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb