kingboa has asked for the wisdom of the Perl Monks concerning the following question:
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; ************************************
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: file access
by Benne (Initiate) on Feb 08, 2000 at 10:06 UTC | |
|
Re: file access
by dlc (Acolyte) on Feb 08, 2000 at 18:36 UTC | |
|
RE: file access
by Fistagon (Initiate) on Feb 08, 2000 at 23:20 UTC | |
|
Re: file access
by Anonymous Monk on Feb 09, 2000 at 20:40 UTC | |
|
Re: file access
by stephen (Priest) on Feb 09, 2000 at 05:05 UTC |