open FILE, "<test.txt"; while(<FILE>) { push @lines,$_; } foreach(reverse @lines){ print $_; } close FILE; ************************************ open(PASSWD,"test.txt") || die "Cant open: $!\n"; while(<PASSWD>) { print "hello $_"; print PASSWD; } close PASSWD; ************************************ #while ($p = <PASSWD>) # # chomp $p; # @fields= split(/:/,$p); # print "$fields[0]'s home directory is $fields[5]\n"; #} #print "$fields = $#a - $[ + 1"; close PASSWD; ************************************
In reply to file access by kingboa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |