pojforeach my $user (keys %users) { my $fh; my $file = "$users{$user}/$fname"; if (-d $file){ print "$file is directory for user $user\n"; } elsif (-e $file ) { open ($fh, '<', $file) or warn "Could not open $file for user $use +r :$!" ; while (my $line = <$fh>) { if ($line =~ /S_REG_PORT_NO=(\d+)/) { print " $user --> $1\n"; } } } else { print "$file does not exist for user $user\n"; } }
In reply to Re^5: File reading with hashes
by poj
in thread File reading with hashes
by Bindo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |