#!/usr/bin/env perl use warnings; use strict; my $file = './flashcount.txt'; open my $fh, '<', $file or die "Can not open file $file: !$\n"; my $count = <$fh>; close $fh or die "Can not close file $file: !$\n"; chomp $count; my $outcome = $count + 1; print "outcome = $outcome\n";
prints (Update):
outcome = 6
Another update: added chomp.
In reply to Re: Writing to a New File
by toolic
in thread Writing to a New File
by SillyMonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |