I'm having a problem with a Perl script that reads a file. Here's an outline of it:<br>
<br>
open FILENAME, "<problemfile"); #Open password file.<br>
until (eofFILENAME)<br>
{<br>
$FileString = <FILENAME>; #Read line of data from file.<br>
&SplitString($FileString); #Split file string into two vars.<br>
<br>
#Compare user data with file data. If exists in file,<br>
#then pass on to wholesale screen.<br>
<br>
if (($LogOn{logname} eq $LogOnName) && <br>
($LogOn{logpassword} eq $LogOnPassword))<br>
{<br>
&SendToWholesale;<br>
}<br>
}<br>
&SendError;<br>
}<br>
<br>
The idea is that it checks to see if the ID and password entered by the user exist in a particular file. If so, it passes the user on to something else. If not, it should issue an error. It works perfectly, until it reaches the end of file, at which time it blows up. (I've tested, and it clearly is blowing up on the until line.<br>
<br>
Anyone have any help?<br>
<br>
-- Heidi<br>
<br>
open FILENAME, "<problemfile"); #Open password file.<br>
until (eofFILENAME)<br>
{<br>
$FileString = <FILENAME>; #Read line of data from file.<br>
&SplitString($FileString); #Split file string into two vars.<br>
<br>
#Compare user data with file data. If exists in file,<br>
#then pass on to wholesale screen.<br>
<br>
if (($LogOn{logname} eq $LogOnName) && <br>
($LogOn{logpassword} eq $LogOnPassword))<br>
{<br>
&SendToWholesale;<br>
}<br>
}<br>
&SendError;<br>
}<br>
<br>
The idea is that it checks to see if the ID and password entered by the user exist in a particular file. If so, it passes the user on to something else. If not, it should issue an error. It works perfectly, until it reaches the end of file, at which time it blows up. (I've tested, and it clearly is blowing up on the until line.<br>
<br>
Anyone have any help?<br>
<br>
-- Heidi<br>