in reply to Print a string X times?
local $, = ' ';
print +('-') x $length,"\n";
the +('-') does some magic which I don't understand, could you please explain that statement..
From perlop: Symbolic Unary Operators:
"Unary "+" has no effect whatsoever, even on strings. It is useful syntactically for separating a function name from a parenthesized expression that would otherwise be interpreted as the complete list of function arguments."
Try removing the + and ensure you use strictures (well, warnings anyway) and see what happens.
That's really usefull!
++ for that!
An organised event
A traditional gathering
With family and friends
I don't celebrate the New Year
Adjusting my clocks for the Leap Second
I can't remember
Results (206 votes). Check out past polls.