[Athens-pm] <USERCOUNT>

Michael K. Nacos nacos at eureka.edu.gr
Mon Mar 3 12:17:21 CST 2003


most of the time I spend trying to debug my own scripts,
so I haven't really looked at your code, Antoni.
the following loop, however, is a little strange.

> open (USERCOUNT, $times_been_here_file) or die ("Cannot open 
> $times_been_here_file. perl reports: $!");
> while (<USERCOUNT>) {
>   $times_been_here = $_ + 1;
>   close USERCOUNT;
> }#while

i'm guessing $times_been_here_file is a user-specific file,
to which a new line is appended each time this user logs on.
so you're trying to count newlines in the file to determine
$times_been_here. am i right?
why would you want to close your filehandle USERCOUNT every
time the loop is repeated? IMHO, close USERCOUNT goes after
the end of the loop.
in addition, doesn't the spaceship operator <USERCOUNT> read
a line into $_ ? what's the point of adding 1 to a string?
why don't you just write $times_been_here += 1;
then again, maybe I have totally misunderstood what you are
trying to do.

anyways, you sound a little stressed. ×áëÜñùóå! I suggest you
get some quality time away from the screen ;-) 






More information about the Athens-pm mailing list