What I'm trying to do is get the key of the key value pair in the hash, because all I have from the file I'm reading is the value.
The code creates something like this:
12345 welcome.html
Code for this part:
my %bugs; my $bug; open(FH, '-|', "lynx -dump '$queryurl'") or die "Could not lynx $queryurl: $!"; while (<FH>) { if (/<bz:id[^>]*>([^<]*)</) { $bug = $1; } if (/<bz:url[^>]*>([^<]*)</) { my $url = $1; $bugs{$url} = $bug; $bug = undef; } } close(FH);
Then, somewhere else in a file called bad.txt I get output, for example:
Documents that failed: daerror 6 0 6 welcome.html
Code for reading this file:
my $badfile = "$dir/bad.txt"; open(FH, "<$badfile") || die "Can not open $badfile: $!";
But I already have a file name extracted from this using a regular expression.
source share