It's not clear from your post if you should expect $line to have a value
when it encounters the if statement.  You might find a 'print "<$line>\n";'
right before the if statement really informative.  The angle brackets are
just in case $line is undef and you don't have warnings turned on.

Peter C.

-----Original Message-----
From: Lance Prais [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 14, 2001 12:55 PM
To: [EMAIL PROTECTED]
Subject: Question about using an IF statement in searching a sub string

I am using the following section of code to search a sub string to see a
word is present:

for(my $i=0; $i<22; $i++){<WORKFLOW>};   #This will put you at row 23.----
  $_=<WORKFLOW>;
  my $line=$_;
  print substr($line, 42, 7);


It returns:   Running----- which it should


but if I use the following statment it always fails.  Can you see the
problem with this if statement?

if (substr($line, 42, 7) eq'"Running"')  #if statment to see if "Running" is
present
{
 while (<WORKFLOW>)
 {                     #Just to output some data to test
  chomp;   #a)
  my $line=$_;
  print STDERR "\nline: $line";
 }
}
else
{
  #send email
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to