vis1982 has asked for the wisdom of the Perl Monks concerning the following question:
ass ass
array
rat rasa
arrow ant
sad
question is if a file has both partners then we can print and leave out those lines which has one partner
So code isBut it is not giving output# !usr|bin|perl -w open(FILE1,"$ARGV[0]"); @array1=<FILE1>; close(FILE1); foreach (@array1) { # next if ($_=~/(\s+$)/); my @t =split ("\s",$_); if ($t[0]=~/(\w*\d*)/) #(\s*)(\w*\d*)/){ { if ($t[1]=~/(\w*\d*)/) { #{ next if ($t[1]=~/(^\s+$)/); } print "$1 \n"; } } exit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ignoring blank lines
by toolic (Bishop) on May 25, 2010 at 18:32 UTC | |
by Anonymous Monk on May 25, 2010 at 18:57 UTC | |
|
Re: ignoring blank lines
by linuxer (Curate) on May 25, 2010 at 18:36 UTC | |
|
Re: ignoring blank lines
by BioLion (Curate) on May 25, 2010 at 18:46 UTC | |
|
Re: ignoring blank lines
by johngg (Canon) on May 25, 2010 at 18:49 UTC |