in reply to Context of "if" statements?
A few refinements can be made if you don't care about what you're printing:while (<INFILE>) { next if /^#/; my ($infile, $dir, $type) = split; print "$infile $dir $type\n"; }
Use next to idiomatically skip to the next valid line.while (<INFILE>) { next if /^#/; my @split = (split)[0..2]; print "@split\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Context of "if" statements?
by ibanix (Hermit) on Nov 24, 2002 at 03:29 UTC | |
by tadman (Prior) on Nov 24, 2002 at 04:25 UTC |