
japhy
Enthusiast
Aug 11, 2000, 3:07 AM
Post #3 of 4
(358 views)
|
|
Re: declaring the same value for several variables.
[In reply to]
|
Can't Post
|
|
You have it slightly backwards. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> ($you,$me,$him) = ('foo') x 3; </pre><HR></BLOCKQUOTE> The left operand to the 'x' operator is the string or list to be repeated, and the right operand is the number of times. And Zeke, if you're using variables like $a1, $a2, $a3, ..., you might want to use an array instead. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> @array = (0) x 10; </pre><HR></BLOCKQUOTE> ------------------ Jeff "japhy" Pinyan -- accomplished author, consultant, hacker, and teacher
|