At 07:33 PM 8/3/00 +0200, Bart Lateur wrote:
>On 03 Aug 2000 06:39:02 -0700, Randal L. Schwartz wrote:
>
> >>> We have one.  It's called "comma in a scalar context". :)
> >
> >Bart> Now do the same with a print command.
> >
> >        print("This stuff gets"," printed", "\n"), return 3
> >           if $some_condition;
>
>Somebody please please tell me why this doesn't generate a warning à la
>"print used as a function". I was expecting that.

Your instincts are correct; just need to put that -w in :-)

$ perl -Mstrict -we 'sub foo {print ("This stuff gets"," printed", "\n"), 
return 3 if 1}'
print (...) interpreted as function at -e line 1.
$ perl -Mstrict -e 'sub foo {print ("This stuff gets"," printed", "\n"), 
return 3 if 1}'
$

--
Peter Scott
Pacific Systems Design Technologies

Reply via email to