in reply to interchanging variables the tough way
and then there is this, which uses the hash the same way as the array example you gave... but it's with a hash so it's different hehe :)$s = "a=1, b=2, c=3"; $s =~ s/a=(\d+), b=(\d+), c=(\d+)/a=$2, b=$3, c=$1/;
hrmm... I had another example... but I'll quit while I'm ahead and don't have people questioning my sanity.@n{a, b, c} = (1, 2, 3); @n{a, b, c} = @n{b, c, a};
|
---|