I've got the following code:
$newkey = <ID> + 1;
close ID;
open (ID2, ">/home/fba/walesyearbook.co.uk/cgi-bin/data/orders.2002.db");
print ID2 ("$newkey");
close ID2;How can I reduce this to one file handle? I've got the developer's block ;-)
Note: What I'm trying to do is to get a number from a file, incrament the number by one, and rewrite the file data with the new number.
Cheers
Wil
- wil
Code:
open (ID, "</home/fba/walesyearbook.co.uk/cgi-bin/data/orders.2002.db"); $newkey = <ID> + 1;
close ID;
open (ID2, ">/home/fba/walesyearbook.co.uk/cgi-bin/data/orders.2002.db");
print ID2 ("$newkey");
close ID2;
Note: What I'm trying to do is to get a number from a file, incrament the number by one, and rewrite the file data with the new number.
Cheers
Wil
- wil