Re: why Perl complaints my script



Hi Andriano,

Thank you very much,

Li

--- Adriano Ferreira <a.r.ferreira@xxxxxxxxx> wrote:

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

--
To unsubscribe, e-mail:
beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail:
beginners-help@xxxxxxxx
<http://learn.perl.org/>
<http://learn.perl.org/first-response>





__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
.



Relevant Pages

  • RE: help regarding sharing code
    ... I am very new to perl and need help regarding how to create modules. ... in our own modules and reuse every where as you require. ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • RE: how to tell perl to look for where a new module is installed
    ... Wags;) ... How should tell the perl to look at it in addition to ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • Re: how to print " time " ???
    ... I wonder why perldoc works on my installation of Activestate perl when it ... > Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • Re: Newbie
    ... way in perl. ... Do You Yahoo!? ... Mail has the best spam ... Mail has the best spam protection around ...
    (perl.beginners)
  • Re: how to tell perl to look for where a new module is installed
    ... How should tell the perl to look at it in addition ... Set the environment variable PERL5LIB to the ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)