vis1982 has asked for the wisdom of the Perl Monks concerning the following question:
file
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();
Back to
Seekers of Perl Wisdom