develooper Front page | perl.beginners | Postings from December 2002

If Statement Nested Regular Exp.

Thread Next
From:
Paul Kraus
Date:
December 19, 2002 09:12
Subject:
If Statement Nested Regular Exp.
Message ID:
016001c2a781$cc9d8410$64fea8c0@pkrausxp
Any ideas why this fails. If I remove if /aged/ and just have the if
/Reports ... then everything works ok.

Code....
#!/usr/bin/perl
my @files;
my %age;
push (@files, glob "Aged*");
push (@files, glob "Receipts*");

foreach (@files){
    open FILE,"<$_";
    print "$_\n";
    while(<FILE>){
	if ($_=~/Aged/){
	    print "Test\n";
	if (/Report
Total:\s+([\d,.]+)\s+([\d,.]+)\s+([\d,.]+)\s+([\d,.]+)\s+([\d,.]+)\s+([\
d,.]+)\s+/){
	    $age{"Orignal"}  = $1;
	    $age{"Current"}  = $2;
	    $age{"30 Days"}  = $3;
	    $age{"60 Days"}  = $4;
	    $age{"90 Days"}  = $5;
	    $age{"120 Days"} = $6;
	}
    }
    }
}
print "$k => $v\n" while (($k,$v) = each %age);

Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About