in reply to Re: Re: number of lists in array
in thread number of lists in array
$/ = "\n"; my $count; open (FH, "myfile.text") || die "Cannot open file: $!"; $count++ foreach (<FH>); close FH;
Update #1 - Also see the post from djw in this thread here.
Update #2 - A piece of code designed to illustrate foreach really should use foreach and not while - Thanks Hofmator++
Update #3 - And the snippets from Masem and davorg in this thread here and here are illustrative - Thanks especially to davorg for the $. suggestion.
perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: number of lists in array
by davorg (Chancellor) on Nov 30, 2001 at 19:11 UTC | |
|
Re: Re: Re: Re: number of lists in array
by Masem (Monsignor) on Nov 30, 2001 at 19:04 UTC | |
by CharlesClarkson (Curate) on Dec 01, 2001 at 08:03 UTC | |
|
Re: Re: Re: Re: number of lists in array
by Anonymous Monk on Nov 30, 2001 at 21:52 UTC | |
by davorg (Chancellor) on Nov 30, 2001 at 22:15 UTC | |
by Hofmator (Curate) on Nov 30, 2001 at 22:14 UTC |