kwaping has asked for the wisdom of the Perl Monks concerning the following question:
Debugging some ancient code at my company, I came across the following lines inside cgi-lib.cgi (remember that old staple, by Steven E. Brenner?):
When I ran it, I got the following error (regardless of my strict or warnings settings):
I've never seen variable names with a single quote in them before, so I wrote a very simple test.$cgi_lib'bufsize = 8192; # default buffer size when reading multi +part $cgi_lib'maxbound = 100; # maximum boundary length to be encounte +rd $cgi_lib'headerout = 0; # indicates whether the header has been +printed
#!/usr/bin/perl use strict; use warnings; my $asdf'a = 'hi'; print $asdf'a;
When I ran it, I got the following error (regardless of my strict or warnings settings):
Can anyone explain what's going on here? It appears that a single-quote can be used in place of :: to declare namespace for variables, but I've never seen or heard of such thing before now. I assume it's a relic from an older Perl version that's now deprecated."my" variable $asdf::a can't be in a package near "my $asdf'a "
Back to
Seekers of Perl Wisdom