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!
Bought a souvenir
Emailed all my friends about it
Got blowed up
Hit him right dead in the jaw
Made it awkward
Took a selfie
Want to go home
Results (347 votes). Check out past polls.