develooper Front page | perl.perl5.porters | Postings from March 2003

5.8.0, possible parsing bug?

Thread Next
From:
Joshua Hoblitt
Date:
March 11, 2003 17:12
Subject:
5.8.0, possible parsing bug?
Message ID:
Pine.GSO.4.44.0303111502430.7738-100000@tiu
This seems to only pop up when doing a one liner.  Is this a bug in the parser or a feature?

I really think you should be able write '1 ? : 1' instead of being forced into '1 ? ( ) : 1' anyways....

--
#!/usr/bin/perl

1?:1;
--
syntax error at ./test.pl line 3, near "?:"
Execution of ./test.pl aborted due to compilation errors.
--
#!/usr/bin/perl

use warnings;

1?:1;
--
syntax error at ./test.pl line 5, near "?:"
Execution of ./test.pl aborted due to compilation errors.
--
#!/usr/bin/perl -w

1?:1;
--
syntax error at ./test.pl line 3, near "?:"
Execution of ./test.pl aborted due to compilation errors.
--
perl -e '1?:1'
syntax error at -e line 1, near "?:"
Execution of -e aborted due to compilation errors.

BUT...

perl -ew '1?:1'

No error???

-J

--


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