Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
In the user file there might be empty lines which I wish to ignore, I would like to know how many lines actually have text on.......one of several versions of code attemptsjan 2.76 feb 3.20 mar 1.6 apr 4.00
How to compare if the line is empty so that $l does not increase in case of empty table member.... BR Hewarn$empty[0] =""; open (VER,$f_name); while (defined ($rows = <VER>)) { chomp($rows); ($rows1,$rows2)=split(/\ /,$rows); $names[$l]=$rows1; $versions[$l]=$rows2; if ($names[$l] != $empty[0] ) #HOW should this be done??? { $l++; } } close VER;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to find empty in empty
by grep (Monsignor) on Nov 19, 2002 at 07:20 UTC | |
Re: How to find empty in empty
by Monky Python (Scribe) on Nov 19, 2002 at 07:58 UTC | |
by petral (Curate) on Nov 19, 2002 at 15:44 UTC |