Re: REGEXP removing - il- - -b-f and - il- - - - f



Ing. Branislav Gerzo wrote:
JupiterHost.Net [JN], on Thursday, April 28, 2005 at 09:11 (-0500)
contributed this to our collective wisdom:

(really beginners) could think "@a" will empty array, which is not
true.

JN> yes it is true, they are both empty lists:

@a will not empty array, here it is:

my @a = q{foo bar};
@a;
print @a;

against

my @a = q{foo bar};
@a = ( );
print @a;

I hope you see the difference :)

And you would as well if you had warnings enabled as the first example would warn you about using an array in void context.

$ perl -le'
use warnings;
my @a = qw{foo bar};
@a;
print @a;
'
Useless use of private array in void context at -e line 3.
foobar



John
--
use Perl;
program
fulfillment
.



Relevant Pages

  • Re: K&R2 section 2.7 type conversions (exercise)
    ... warnings), ... we are asked to write a function "htoi(an array)" that accomplishes ... value of type char. ... int main{ ...
    (comp.lang.c)
  • Re: matching password problem
    ... and turn on warnings. ... You don't need to store the usernames and passwords in arrays in your code, because you only need to look at ONE username and ONE password at a time. ... And if you DID want to store them, you should use a hash, not an array. ... use strict; use warnings; ...
    (perl.beginners)
  • Re: Question on loops and return values
    ... You should always enable warnings when developing Perl code! ... > associated with an array, but I could be wrong on that too. ... It cannot be clobbered since your program never writes to that filehandle. ...
    (comp.lang.perl.misc)
  • Re: Module questions (perhaps a module creation mini-tutorial)
    ... > use warnings; ... > use strict; ... You shouldn't be using this array. ... > package I am calling. ...
    (perl.beginners)
  • Re: random numbers
    ... > These numbers must match to the number of an array. ... is better because it allows you to turn warnings for selected lexical ... Please do read the posting guidelines for this group tolearn how you can ... Sinan Unur ...
    (comp.lang.perl.misc)