in reply to make a counter

All you need to use is the auto-increment operator.
$a = 'A000001'; while (1) { print "$a\n"; $a++; }


look up the ++ operator in perlop under Auto-increment.

Also you should avoid the <> operator for <STDIN> unless you want the side-effects. merlyn explains it better than I.

UPDATE: If you want, take a look at a fun use of auto-increment.

OR
$a = 'A000000'; while (1) { print $a++,"\n"; }


grep
grep> cd pub
grep> more beer

Replies are listed 'Best First'.
Re: Re: make a counter
by agustina_s (Sexton) on Jan 23, 2002 at 06:41 UTC
    Thanks Grep...:p :p