I quoted you fully only because I cannot for the life of me figure out
what, in fact, you are trying to do. A while loop doesn't look like
that, it looks like this:
while (some_test()) {
do_something();
}
Can you please try this question again, with actual Perl?
-=Eric
#!/usr/bin/perl -w
#
open (SNMPLOG, ">snmp.log") or die "could not open 'snmp.log' $!";
$ARGV[0] = 'url.log';
my %status;
while (<>) {
/ (FAILURE|SUCCESS).+?from (.+)/ and $status{$2} = $1;
}
$status{$_} eq 'FAILURE' and print SNMPLOG " 0 " for sort keys
%status;
#else {
# print SNMPLOG " 1 " for sort keys %status;
#}