>> print "$tline[$i];

You are missing a quote on all 3 of these lines, it should be:

print "$tline[$i]";

....But there is probably no reason to have a single variable in quotes
alone, so I recommend this:

print $tline[$i];

Rob

-----Original Message-----
From: Michael Simmons [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 12:08 PM
To: [EMAIL PROTECTED]
Subject: Nested IF


Does anyone see what the problem with this is?

if ( $tline[$i] =~ /^$name\s/ ) {
         if ( $tline[$i] =~ /\scname\s/ ) {
                 print "Found the following alias: \n";
                 print "$tline[$i];
                 }
         elsif ( $tline[$i] =~ /\sa\s/ ) {
                 print "Found the following address: \n";
                 print "$tline[$i];
                 }
         elsif ( $tline[$i] =~ /\smx\s/ ) {
                 print "Found the following mail: \n";
                 print $tline[$i];
                 }
         }


Getting this error...

Unrecognized escape \s passed through at ./test line 39.
Unrecognized escape \s passed through at ./test line 39.
Bareword found where operator expected at ./test line 42, near "print
"Found"
   (Might be a runaway multi-line "" string starting on line 39)
         (Do you need to predeclare print?)
Unquoted string "n" may clash with future reserved word at ./test line 42.
String found where operator expected at ./test line 43, near "print ""
   (Might be a runaway multi-line "" string starting on line 42)
         (Missing semicolon on previous line?)
Scalar found where operator expected at ./test line 43, near "print "$tline"
         (Do you need to predeclare print?)
syntax error at ./test line 42, near "print "Found the "


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

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

Reply via email to