in reply to Generating sequence nos. for data

use strict; use warnings; my %c; while (<DATA>) { chomp; @_ = split / /, $_, 2; print "$_ -> seqno = " . ++$c{$_[0]} . "\n"; } __DATA__ A 100 B 200 B 300 C 400 D 500 C 600 D 700

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.