little has asked for the wisdom of the Perl Monks concerning the following question:
I've tried to get into the mysteries of the strict pragma, but it seems that there are some miracelous things happening - at least I do have this impression.
#!usr/bin/perl use strict; # prints 'nono1', so '=>' seems to be interpreted as '.' print nono => "1"; # just ok though print nono . "1"; # Error as expected : No comma allowed after filehandle ... print nono, 1;
The docs for strict state that barewords don't raise errors if left of the '=>' operator, but ...
My question is, why is the assignment operator '=>' in the first 'print' statement here interpreted as a dot and not as a comma as I would expect it as this is how it gets interpreted in a hash key=>value assignment?
Sorry if I seem a bit stupid, but I better ask before I tend to remember wrong relations.
Have a nice day
All decision is left to your taste
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strict subs and bareword exceptions
by dws (Chancellor) on Feb 22, 2002 at 08:23 UTC | |
|
Re: strict subs and bareword exceptions
by dvergin (Monsignor) on Feb 22, 2002 at 08:25 UTC | |
|
Re: strict subs and bareword exceptions
by demerphq (Chancellor) on Feb 22, 2002 at 10:24 UTC | |
|
Re: strict subs and bareword exceptions
by cLive ;-) (Prior) on Feb 22, 2002 at 08:22 UTC | |
|
Re: strict subs and bareword exceptions
by rjray (Chaplain) on Feb 22, 2002 at 08:36 UTC | |
|
Re: strict subs and bareword exceptions
by jmcnamara (Monsignor) on Feb 22, 2002 at 08:37 UTC | |
|
Re: strict subs and bareword exceptions
by jmcnamara (Monsignor) on Feb 22, 2002 at 09:39 UTC | |
by blakem (Monsignor) on Feb 22, 2002 at 10:10 UTC | |
by jmcnamara (Monsignor) on Feb 22, 2002 at 10:27 UTC |