Re: why Perl complaints my script
- From: a.r.ferreira@xxxxxxxxx (Adriano Ferreira)
- Date: Thu, 28 Sep 2006 10:47:42 -0300
On 9/28/06, chen li <chen_li3@xxxxxxxxx> wrote:
Hi all,
I write a small script for permutation. When I use
version 1) Perl always complaint it although I get the
result. If I use version 2) it never says a word about
it. Any comments?
Perl always complain (provided you called for that with -w or "use
warnings") when you do something like that:
$ perl -w -e 'my $a; $a'
Useless use of a variable in void context at -e line 1
This is meant to warn you about a probable mistake:
you may have meant
$a++
a # to invoke a sub
or something like that. As Igor has said the first statement in the
for is often used for declaring loop variables or, more generally, for
loop initialization statements. If you don't have these initialization
statements, you may omit it.
Regards,
Adriano Ferreira
.
- Follow-Ups:
- Re: why Perl complaints my script
- From: Chen Li
- Re: why Perl complaints my script
- References:
- why Perl complaints my script
- From: Chen Li
- why Perl complaints my script
- Prev by Date: Re: interpoliation within regexp
- Next by Date: Re: call HTML page from PERL
- Previous by thread: Re: why Perl complaints my script
- Next by thread: Re: why Perl complaints my script
- Index(es):