kwaping has asked for the wisdom of the Perl Monks concerning the following question:
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;
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 "
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Single quotes inside variable names
by jimbojones (Friar) on Aug 12, 2005 at 18:14 UTC | |
Re: Single quotes inside variable names
by borisz (Canon) on Aug 12, 2005 at 18:11 UTC | |
Re: Single quotes inside variable names
by trammell (Priest) on Aug 12, 2005 at 18:57 UTC | |
by ChemBoy (Priest) on Aug 12, 2005 at 19:48 UTC | |
Re: Single quotes inside variable names
by ysth (Canon) on Aug 12, 2005 at 18:19 UTC | |
by japhy (Canon) on Aug 12, 2005 at 18:20 UTC | |
Re: Single quotes inside variable names
by scooper (Novice) on Aug 15, 2005 at 02:21 UTC | |
by merlyn (Sage) on Aug 15, 2005 at 02:36 UTC |