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

[ID 20010704.007] bareword not detected as part of first argumentto print

Thread Next
From:
Philip Newton
Date:
July 4, 2001 22:23
Subject:
[ID 20010704.007] bareword not detected as part of first argumentto print
Message ID:
54561_467478847.595215@bugs.perl.org
This does not give an error when I think it should:

    #!/usr/bin/perl -w
    use strict;
    print(BAREWORD . "\n");

Instead, it prints out "BAREWORD". And B::Deparse deparses it like 
this:

    use strict 'refs';
    print 'BAREWORD' . "\n";

Checked with 5.005_03, 5.6.0, and bleadperl@11146.

My guess is that it has something to do with the fact that the first 
argument to print can be an indirect object, including a bareword 
filehandle. (If I replace the concatenation operator with a comma, I 
get an error "No comma allowed after filehandle".)

Cheers,
Philip


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