J
Jonathan Weekes
Being utterly a non Perl IT guy, I have to write a Perl script for a
web site to edit a line in a file. I have looked on Google and found
Tie to be what I needed, but I am really lost in how to change the
line. Can someone please edit the script below for me to show me how
to do this? I have already looked in the documentation and still got
lost...
use CGI qw/:standard/;
use CGI::Cookie;
use Tie::File;
print header;
%cookies = fetch CGI::Cookie;
tie @array, 'Tie::File',
"e:/inetpub/scripts/inventory.txt" or die "Could not Tie in.txt: $!";
for (@array) {
print $_;
last;
}
untie @array; # all finished
Thanks in advance,
Jonathan Weekes
web site to edit a line in a file. I have looked on Google and found
Tie to be what I needed, but I am really lost in how to change the
line. Can someone please edit the script below for me to show me how
to do this? I have already looked in the documentation and still got
lost...
use CGI qw/:standard/;
use CGI::Cookie;
use Tie::File;
print header;
%cookies = fetch CGI::Cookie;
tie @array, 'Tie::File',
"e:/inetpub/scripts/inventory.txt" or die "Could not Tie in.txt: $!";
for (@array) {
print $_;
last;
}
untie @array; # all finished
Thanks in advance,
Jonathan Weekes