In order to have it properly interpreted as a number, you need to remove the leading "count=" part after having read the line from the file... — something like this
my $flashcount_file = "/var/www/html/log/flashcount.txt"; open my $flashcount, "<", $flashcount_file; my $count = <$flashcount>; $count =~ s/^count=//; # <-- remove "count=" $count++; close $flashcount; open my $flashcount, ">", $flashcount_file; print $flashcount "count=$count"; close $flashcount;
In reply to Re: Writing to a New File
by almut
in thread Writing to a New File
by SillyMonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |