develooper Front page | perl.perl5.porters | Postings from June 2002

[ID 20020626.001] strict vars do not catch %<char(160)>

Thread Next
From:
Hallvard B Furuseth
Date:
June 26, 2002 05:36
Subject:
[ID 20020626.001] strict vars do not catch %<char(160)>
Message ID:
HBF.20020626x5k2@bombur.uio.no
#!/local/bin/perl -wl
use strict 'vars';
$ {"Q::foo"} = 3;   # This is $<space>{"Q::foo"}.
print $d{"Q::foo"}; # This is $<char(160)>{"Q::foo"}.

This program warns:
    Use of uninitialized value in print at /tmp/bug.pl line 3.
I think it should die with:
    Global symbol "% " requires explicit package name at /tmp/bug.pl line 3.
Because it didn't, it took me hours to narrow the problem down
until I found the char(160).  After all, it _looks_ just fine.

--
Hallvard


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