On 12-05-23 08:13 PM, sono...@fannullone.us wrote:
A script that I'm refactoring has global variables in two different
styles, e.g.:
$main::global->{form}->{'mailprog'}
$main::global->{form}->{mailprog}
The quote marks don't seem to make a difference, so what would be the
advantage of using them? What are they and what do they do? I don't recall
seeing anything like this before.
Yes, you can leave the quotes off if the key contains only
alphanumerics. Otherwise you need to quote it:
$programming{"don'ts"} = "Don't forget to quote hash keys if they have
non-alphanumerics.";
Also, the above can be written as:
$main::global->{'form'}->{'mailprog'}
$main::global->{form}->{'mailprog'}
$main::global->{form}{mailprog}
$::global->{form}{mailprog}
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
_Perl links_
official site : http://www.perl.org/
beginners' help : http://learn.perl.org/faq/beginners.html
advance help : http://perlmonks.org/
documentation : http://perldoc.perl.org/
news : http://perlsphere.net/
repository : http://www.cpan.org/
blog : http://blogs.perl.org/
regional groups : http://www.pm.org/
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/