develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH 20010704.007] Re: bareword not detected as part of firstargument to print

Thread Previous | Thread Next
From:
Jeff 'japhy/Marillion' Pinyan
Date:
July 18, 2001 17:44
Subject:
Re: [PATCH 20010704.007] Re: bareword not detected as part of firstargument to print
Message ID:
Pine.GSO.4.21.0107182035180.7854-100000@crusoe.crusoe.net
On Jul 19, Abhijit Menon-Sen said:

>At 2001-07-05 07:28:21, Philip.Newton@gmx.net wrote:
>>
>> This does not give an error when I think it should:
>> 
>>     #!/usr/bin/perl -w
>>     use strict;
>>     print(BAREWORD . "\n");
>
>This is band-aid at best, but it fixes the problem.

The problem is that Perl parses

  m{
    print
    \s* \(? \s*
    [A-Za-z_]\w*
  }

as being a filehandle.  Ungood.  It has to look ahead to see whether or
not this "filehandle" is being treated like a filehandle.  Basically, that
means it has to:

  1. see if there is an operator following it,
  2. and ensure that operator is not the '&' of a function call

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **



Thread Previous | 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