Zeus Odin wrote:
Apologies, I was asleep at the wheel during my last response.
:-)
The only answer I have is that this is how the designers of Perl decided
that the printing of undefined $, @, and % would work. This is probably due
to the fact that the undefined value of a scalar *is* different fro
Zeus Odin wrote:
Apologies, I was asleep at the wheel during my last response.
:-)
The only answer I have is that this is how the designers of Perl decided
that the printing of undefined $, @, and % would work. This is probably
due
to the fact that the undefined value of a scalar *is* different fr
Two small mistakes:
"Zeus Odin" <[EMAIL PROTECTED]> wrote in message ...
> $ perl -mstrict -MData::Dumper -we "my $; print Dumper $s;"
^^^
$s
> $VAR1 = undef;
> $ perl -mstrict -MData::Dumper -we "my %h; print Dumpe
Apologies, I was asleep at the wheel during my last response.
:-)
The only answer I have is that this is how the designers of Perl decided
that the printing of undefined $, @, and % would work. This is probably due
to the fact that the undefined value of a scalar *is* different from the
undefined
Zeus Odin wrote:
To see the code that is actually getting compiled, try:
$ perl -MO=Deparse -mstrict -we 'my @foo;print @foo;'
Ok, not sure what that has to do with @ and % not getting uninitialized
warnings and $ getting them...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comman
To see the code that is actually getting compiled, try:
$ perl -MO=Deparse -mstrict -we 'my @foo;print @foo;'
"JupiterHost.Net" <[EMAIL PROTECTED]> wrote in message ...
> Correct, except I still think @ ans % don't get uninitialized value
> warnings while $ does:
>
> $perl -mstrict -we 'my $foo
Zeus Odin wrote:
The reason why you don't get the uninitialized warning in the 2nd and 3rd
examples below is that your print is within the for loop. Since both @files
and keys %files contain nothing, the innards of the for loop NEVER get
executed. Therefore, the print is not attempted at all for e
The reason why you don't get the uninitialized warning in the 2nd and 3rd
examples below is that your print is within the for loop. Since both @files
and keys %files contain nothing, the innards of the for loop NEVER get
executed. Therefore, the print is not attempted at all for examples 2 and 3.
Murphy, Ged (Bolton) wrote:
In order to use the array @files in the below code outside of the
subroutine, so I need to declare @files globally?
You could but it is not really necessary.
I'm getting errors at the moment: Global symbol "@files" requires explicit
package name
That is because you have
Gunnar Hjalmarsson wrote:
I've noticed that some prefer @files = () for clarity, ...
Sorry, should have been
I've noticed that some prefer my @files = () for clarity, ...
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
JupiterHost.Net wrote:
So scratch what I said, what Gunnar said is better.
my @files;
is what you want, as my @files = (); is basically pointless ;p
Now I think you are too hard to yourself. :) I've noticed that some
prefer @files = () for clarity, so it may not be totally pointless.
At the same
JupiterHost.Net wrote:
Gunnar Hjalmarsson wrote:
JupiterHost.Net wrote:
I'd say reight before opendir()
my @files = ();
Which is equivalent to
my @files;
since my() has the side-effect of clearing the declared variable.
Except = (); will help avoid "uninitialized value" warnings no?
That w
JupiterHost.Net wrote:
Gunnar Hjalmarsson wrote:
JupiterHost.Net wrote:
my @files = ();
Which is equivalent to
my @files;
since my() has the side-effect of clearing the declared variable.
Except = (); will help avoid "uninitialized value" warnings no?
How?
use warnings;
my @files = ();
Gunnar Hjalmarsson wrote:
JupiterHost.Net wrote:
I'd say reight before opendir()
my @files = ();
Which is equivalent to
my @files;
since my() has the side-effect of clearing the declared variable.
Except = (); will help avoid "uninitialized value" warnings no?
--
To unsubscribe, e-mail: [EMA
JupiterHost.Net wrote:
I'd say reight before opendir()
my @files = ();
Which is equivalent to
my @files;
since my() has the side-effect of clearing the declared variable.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit
Murphy, Ged (Bolton) wrote:
In order to use the array @files in the below code outside of the
subroutine, so I need to declare @files globally?
I'm getting errors at the moment: Global symbol "@files" requires explicit
package name
If so, where is the correct place to declare them in terms of ne
Murphy, Ged (Bolton) asked:
> In order to use the array @files in the below code outside of
> the subroutine, so I need to declare @files globally?
> I'm getting errors at the moment: Global symbol "@files"
> requires explicit package name
>
> If so, where is the correct place to declare them in
17 matches
Mail list logo