Oct 3, 2010, 10:27 AM
Post #3 of 4
Re: [FishMonger] stopped at the start
[In reply to]
Open a cmd window first then run your script ...
Aaaah yes.... How stupid I was.
... and you will have the answer.
That answer should generate another question.
The error message was:
Global symbol “$c“ requires explicit package name
I searched for “package name“ and read :
In Perl, a namespace is held in a package.
So it’s a matter of namespace. At this point I reminded me that the use strict; instruction isn’t there to make pretty.
Then the following code runs nice:
use warnings; $a = 'earth';
$b = 'wind';
my $c = 'and fire';
But the question is: why $a and $b, without my before them, don’t provoque the same error ?
Additionnaly, I noticed something:
the 5 seconds sleep takes place BEFORE the display of the value of $c although the sleep(5) instruction is placed AFTER the print “$c“; instruction.
But with instruction print “$c\n“; , the sleep is made after the display of $c’s value.
Thank you very much for your answer which unstopped me, FishMonger.
Please, excuse my incorrect english.
I would be glad if any Anglophone would correct it.
(This post was edited by iperli on Oct 3, 2010, 10:30 AM)