Johnno wrote: > many thanks that works... > > What i am getting is a Permission denied > > I can't see why here.. do i have to do a chmod 666 on the file or > something?? > > sub key_counter { > > my @countermyfile; > my $keycounter; > > open(IN,"$working_folder/counter.txt"); > (@countermyfile=<IN>); > > $keycounter=$countermyfile[0]; > $keycounter++; > close(IN); > if ($keycounter > 99999999) {$keycounter=10000000;} > > open(OUT,">$working_folder/counter.txt") or die > "$working_folder/counter.txt - $!"; > print OUT $keycounter; > close(OUT); > > return ($keycounter); > > }
Check the perms on the directory that it is in to make sure you have the perms to read and write to a file in it. Make sure you know what user you are running as if it's under a webserver (eg: nobody). You may have to 0775 the dir you are in. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/ _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs