DCPM: puzzling perl thing

Steve Marvell steve at devon-it.co.uk
Thu Jan 9 04:37:38 CST 2003


On Wed, Jan 08, 2003 at 07:52:25PM +0000, Matthew Browning wrote:
> > print ('-' x 10),"\n";
> > print ('-' x 10)."\n";
> > 
> > Why the hell not?
> 
> Because the parentheses you use are interpreted as the optional ones for
> the print function which, although it accepts list context by default,
> reckons you are done when they close.

Wow, a reply. That's unusual for this list :)

> The effect I reckon you are probably after is managable like this:
> 
> print ( ('-' x 10), "\n" );

I plumped for:

print '-' x 10, "\n";

Shows me for trying to make perl's job easier.

Steve



More information about the Devoncornwall-pm mailing list