Hi :)

I am still very new to perl (and programming) and am getting stuck with 
regular expressions. I have a text file in which I want to find, then 
print to screen all lines beginning with "?" and then print the text 
between the "<" and ">" characters. The code I have tried (amongst many 
variations) is below

(open(INPUT, "record.txt")) || die("Error, can't find file\n");
$line = readline(INPUT);
while($line =~ /^\?/)
{
chomp($line);
print($line =~ /(.+)<\/a>\]/);
$line = readline(INPUT);
}
close(INPUT);


record.txt contains

___

#Retail price items

?<1002.00>
?<125.00>
?<61864.35>
?<890876.99>
?<9.99>

#Transaction code

S,M,L

#Sales commission

5:7:10

___

This code returns nothing. I am at a loss as to what im doing wrong & 
have been playing with this since yesterday. Big thanks to anyone who 
can help :)

brettaw

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to