in reply to next if loop

@SKIP = ('adrian','adm','sys','alcatel'); foreach $login ($SKIP) { next if $login eq $SKIP; }

What do you think this does? You're setting up an array @SKIP and then you use the scalar $SKIP to loop on? And then in the loop, you're checking $SKIP again.

use strict; is your friend. Use it.

Liz

Update:
Removed reference to $_, thanks to hardburn for pointing this out!

Replies are listed 'Best First'.
Re: Re: next if loop
by hardburn (Abbot) on Nov 19, 2003 at 21:16 UTC

    whereas you should be checking $_

    What good would that do? The foreach loop is saving the data to $login, not $_.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    : () { :|:& };:

    Note: All code is untested, unless otherwise stated