Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Assign multiple scalars the same value

by Aristotle (Chancellor)
on Jan 24, 2005 at 22:52 UTC ( #424728=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

Yep, it does. Note the difference between these, though:

$,= " "; $\ = "\n"; print( map { int rand 10 } 0 .. 6 ); print( ( int rand 10 ) x 7 );

The x operator only evaluates the list expression once. So you can't always substitute one for the other.

Makeshifts last the longest.


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://424728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2014-10-26 03:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (150 votes), past polls