develooper Front page | perl.perl5.porters | Postings from September 2012

[perl #37624] print FILEHANDLE DWIMery doesn't always work

Thread Next
From:
James E Keenan via RT
Date:
September 21, 2012 19:50
Subject:
[perl #37624] print FILEHANDLE DWIMery doesn't always work
Message ID:
rt-3.6.HEAD-11172-1348282246-183.37624-15-0@perl.org
On Tue Jul 03 13:00:19 2012, sprout wrote:
> On Tue Jul 03 02:16:31 2012, nicholas wrote:
> > I don't think that you hit the right documentation. I think that the bug
> > really is this:
> > 
> > $ perl -le '$_ = "Pie"; print STDERR'
> > Pie
> > $ perl -le '$_ = "Pie"; print {STDERR}'
> > syntax error at -e line 1, at EOF
> > Execution of -e aborted due to compilation errors.
> > $ perl -le 'print STDERR "Pie"'
> > Pie
> > $ perl -le 'print {STDERR} "Pie"'
> > Pie
> > 
> > Why is the second a syntax error when the other three work?
> 
> Work, or ‘work’?  print STDERR is a hack.  print STDERR $foo is
> determined to have a filehandle during lexing, but print STDERR during
> compilation.
> 
> So these all print $_ to STDERR:
> 
>     print + STDERR;
>     print +(STDERR);
>     print + + + + + + (((((+(((+((STDERR))))))))));
> 

doy, nicholas, Father C:

Can we come to some kind of resolution on this issue so that we can
close the ticket?

Thank you very much.
Jim Keenan


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=37624

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About