Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

What about...

by gaspodethewonderdog (Monk)
on Aug 30, 2000 at 19:23 UTC ( [id://30309]=note: print w/replies, xml ) Need Help??


in reply to interchanging variables the tough way

Alright, this is definitely silly, and nobody would do this but... you just wanted some ideas
$s = "a=1, b=2, c=3"; $s =~ s/a=(\d+), b=(\d+), c=(\d+)/a=$2, b=$3, c=$1/;
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 :)
@n{a, b, c} = (1, 2, 3); @n{a, b, c} = @n{b, c, a};
hrmm... I had another example... but I'll quit while I'm ahead and don't have people questioning my sanity.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://30309]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found