qsl has asked for the wisdom of the Perl Monks concerning the following question:
I have to check "First Name" is present first in the file and "Last Name" is present second in the file.i.e if LastName comes,first and First Name comes second,I have to give error message.My code is,....... First Name ....... ....... Last Name ......
But it is not giving the exact output.Monks any solution for this.open fhand,file.txt; while(<fhand>}{ if($_ =~/First Name/){ $First =1; } if($_ =~/Last Name/){ print"proceed" if($First = 1); }else{ print"Order is not correct\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File reading
by GrandFather (Saint) on Jun 27, 2006 at 11:21 UTC | |
| |
| |
|
Re: File reading
by davorg (Chancellor) on Jun 27, 2006 at 11:13 UTC | |
|
Re: File reading
by Moron (Curate) on Jun 27, 2006 at 12:10 UTC | |
|
Re: File reading
by johngg (Canon) on Jun 27, 2006 at 13:09 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |