1.

$filename = 'foo.txt';
open(FH,"<$filename") or die "couldn't open $filename - $!";
while ($line = <FH>){
    print "$line matches\n" if ($line =~ /^USD /);
}

2.

while ($line=<FH>){
    chomp $line;
    next unless $line;
    next if ($line =~ /^-+?$/);
    next if ($line =~ /^=+?$/);
    # only good lines get this far
}

>>> Jack Lauman <[EMAIL PROTECTED]> 06/19/01 05:05am >>>
1. I want to read in a text file and match any line that begins with
three capital letters followed by a space.  i.e. "USD "

How do you do that?

2. I need to ignore any blank lines, lines containing all "---", lines
containing all "===".

Again, how?

Thanks in advance,

Jack



This e-mail and any files transmitted with it are confidential 
and solely for the use of the intended recipient. 
ONdigital plc, 346 Queenstown Road, London SW8 4DG. Reg No: 3302715. 

Reply via email to