in reply to File I/O
Have to ask, WHY do you need to do this? (there may be a far better/more robust way to accomplish your specifc task)open RECORD_NUMBER, '<', "counter_data.dat" or die; $count = <RECORD_NUMBER>; close RECORD_NUMBER; $count++ open FILE, '>', "counter_data.dat" or die; print FILE $count; close FILE;
perl -i -pe '++$_' counter.dat
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File I/O
by Melly (Chaplain) on Jan 17, 2007 at 22:46 UTC | |
|
Re^2: File I/O
by Anonymous Monk on Jan 18, 2007 at 03:59 UTC | |
|
Re^2: File I/O
by blazar (Canon) on Jan 18, 2007 at 10:24 UTC |