in reply to
Print a string X times?
This is my personal favorite:
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!
Use subroutines for code reuse
Master regular expressions
Write my GUIs with Perl
Abandon CGI in favor of some modern web framework
Put my code in modules
Create CPAN distributions
test and document my code as I write it
Write OOP with or without animal help
Finally switch to a modern Perl style
Create a killer application with Perl
Detoxify from Perl and PerlMonks
Choose another language because Perl is dead
Learn to program for mobile devices
Complete my secret world domination project
None, because the road to hell is paved with good intentions
Results (214 votes),