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 would be a "no"

That is only for scalars which makes so much sense now :)

$ perl -mstrict -we 'my $files;print $files;'
Use of uninitialized value in print at -e line 1.
$ perl -mstrict -we 'my @files;print $_ for @files;'
$ perl -mstrict -we 'my %files;print $_ for keys %files'
$

No more
 my @this = ();
or
 my %that = ();
for me!

So scratch what I said, what Gunnar said is better.

my @files;

is what you want, as my @files = (); is basically pointless ;p

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to