DCPM: puzzling perl thing

Matthew Browning mb at simplepages.uklinux.net
Wed Jan 8 13:52:25 CST 2003


* Steve Marvell <steve at devon-it.co.uk> [2003-01-07 12:17:05 +0000]:

> Neither of these work.
> 
> 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.

The effect I reckon you are probably after is managable like this:

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

[MB]










More information about the Devoncornwall-pm mailing list