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!
Once (shame on you!)
Twice (shame on me!)
More often than I'd like to be
All the time
Just when answering stupid polls
Who you callin' a fool?
I refuse to vote in this ridiculous poll
Results (462 votes). Check out past polls.