Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Assign multiple scalars the same value

by Limbic~Region (Chancellor)
on Jan 25, 2005 at 14:31 UTC ( #424875=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Assign multiple scalars the same value
in thread Assign multiple scalars the same value

scooterm,
Not only that, but if the what the list contains is a reference, the reference is replicated as well. The first useful application I remember seeing of this is in tye's Algorithm::Loops. I found a useful variation that looked a little something like:

my @signal = qw(ABRT STOP TERM INT); @SIG{ @signal } = (sub { kill 9, $pid; exit }) x @signal;
Incidently, diotalevi makes a good point concerning ensuring that you have the same number of things on both sides of the assignment which is not an issue in my example.

Cheers - L~R


Comment on Re^3: Assign multiple scalars the same value
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (15)
As of 2015-07-01 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (13 votes), past polls