R
Ronny
By chance I found out that no error is issued on the following
program:
perl -w -e 'use strict; print(Does::Not::Exist,"\n")'
Instead, "Does::Not::Exist" is printed. Shouldn't there be a warning
about
the improper use of a bareword? Similarily, the program
perl -w -e 'use strict; system(Does::Not::Exist,"\n")'
results in the message
Can't exec "Does::Not::Exist": No such file or directory at -e line 1.
which too seems to suggest that Does::Not::Exist is simply interpreted
as string.
But when I use it like this:
perl -w -e 'use strict; print(ref(Does::Not::Exist),"\n")'
I get the more reasonable:
Bareword "Does::Not::Exist" not allowed while "strict subs" in use at -
e line 1.
Why is this bareword treated differently in these contexts?
Ronald
program:
perl -w -e 'use strict; print(Does::Not::Exist,"\n")'
Instead, "Does::Not::Exist" is printed. Shouldn't there be a warning
about
the improper use of a bareword? Similarily, the program
perl -w -e 'use strict; system(Does::Not::Exist,"\n")'
results in the message
Can't exec "Does::Not::Exist": No such file or directory at -e line 1.
which too seems to suggest that Does::Not::Exist is simply interpreted
as string.
But when I use it like this:
perl -w -e 'use strict; print(ref(Does::Not::Exist),"\n")'
I get the more reasonable:
Bareword "Does::Not::Exist" not allowed while "strict subs" in use at -
e line 1.
Why is this bareword treated differently in these contexts?
Ronald