I see one problem, and have two comments...
Why do this...
$_=<EMAIL>;
my $line=$_;
When you can just do this...
my $line = <EMAIL>;
This can be simplifed...
for(my $i=0; $i<22; $i++){<EMAIL>}
Try this...
for(1..22){<EMAIL>}
The problem I see is that you are reading from EMAIL, but you opened a
filehandle named EMAILAGENT.
Rob
-----Original Message-----
From: Lance Prais [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 2:15 PM
To: [EMAIL PROTECTED]
Subject: RE: searching a sub string
Here is my code
#open a file with the filehandle
open EMAILAGENT, "+<..\\..\\emailagent.txt" or die "Cannot open email agent
$!\n";
for(my $i=0; $i<22; $i++){<EMAIL>}; #This will put you at row 23.----
$_=<EMAIL>;
my $line=$_;
print STDERR "\nline: ", substr($line, 44, 7); #should print a vlue to
the screen?
This is line 23 in my test document.
CHK_SBL_DEV MailAgent 7203 87 Running
The area where "Running" is positions 44-51 My print stanment is not
outputing anything. Can anyone see the problem?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]