in reply to How do I assign a variable to the file content?
#!/usr/local/bin/perl -w use strict print "Content-type: text/html\n\n"; my $counttext = 'd:/xxx.xxx.xxx.xxx/perl/thecounter/counttext.txt'; my $thenumber; open(COUNTTHIS, "< $counttext") or die "I can't open counttext: $!\n"; $thenumber = <COUNTTHIS>; close(COUNTTHIS); print "$thenumber<br>"; ++$thenumber; print "$thenumber"; open(OUT, "> $counttext") or die "I can't open counttext: $!\n"; print OUT $thenumber; close(OUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Answer: How do I assign a variable to the file content?
by NotProud (Novice) on Sep 25, 2000 at 21:15 UTC |