I have no idea why this doesn't work,and it's driving me crazy!
All it is supposed to do is go through a bunch of files and print a log record
for each 'U' type.
It seems like it wont open the files for input (or output?). Yet there's no die
output...
What I do see on the screen (note the silly print statements to help me step
through) is a '*', then ':'[name of file] repeating for each file. No '.' means
it never made it into the while loop. BUT WHY?!?!?!?
if (!$ARGV[0]) {
print "Enter the file\(s\) to search: ";
chomp(@files = <STDIN>);
}
print "*";
@files = glob($ARGV[0]);
open ">UB.log", LOG || die "cant open UB.log for output\n";
foreach $val (@files){
print ":"; print "$val\n";
open "<$val", IN || die "cant open $val for input\n";
while (<IN>){
print "."; print substr($_,224,1); print substr($_,224,14);
chomp();
if (substr($_,224,1) eq "U"){
$id = substr($_,224,14);
$ctob = substr($_,334,5);
print LOG "$id\t$ctob\n";
}
}
close IN;
}
****** CONFIDENTIALITY NOTICE ******
THIS E-MAIL, INCLUDING ANY ATTACHED FILES, MAY CONTAIN CONFIDENTIAL AND
PRIVILEGED INFORMATION FOR THE SOLE USE OF THE INTENDED RECIPIENT(S). ANY
REVIEW, USE, DISTRIBUTION, OR DISCLOSURE BY OTHERS IS STRICTLY PROHIBITED. IF
YOU ARE NOT THE INTENDED RECIPIENT (OR AUTHORIZED TO RECEIVE INFORMATION FOR
THE RECIPIENT), PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE ALL COPIES
OF THIS MESSAGE. THANK YOU.