nbtrap has asked for the wisdom of the Perl Monks concerning the following question:
perlop(1) says that "The "=>" operator is a synonym for the comma except that it causes a word on its left to be interpreted as a string if it begins with a letter or underscore and is composed only of letters, digits and underscores." Why is "-foo" quoted?use strict; my %hash = (-foo => 'bar');
Now, the second example:
Why does this work? If I use just "init" without the dash, perl complains of a bareword.use strict; use Gtk2 -init;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why is this auto-quoted?
by tobyink (Canon) on Jul 30, 2013 at 22:19 UTC | |
by Anonymous Monk on Jul 31, 2013 at 03:27 UTC | |
by Anonymous Monk on Jul 31, 2013 at 03:39 UTC | |
by QM (Parson) on Jul 31, 2013 at 08:45 UTC | |
by Anonymous Monk on Jul 31, 2013 at 09:13 UTC | |
| |
by nbtrap (Sexton) on Jul 30, 2013 at 22:32 UTC | |
by Anonymous Monk on Jul 30, 2013 at 23:00 UTC | |
|
Re: Why is this auto-quoted? (because)
by Anonymous Monk on Jul 30, 2013 at 22:13 UTC |