in reply to I need to sort out some values and get only the highest generated by my perl script

`perldoc perldata'

Why it's stupid to `use a variable as a variable name' part 1 2 3

`perldoc -q count'

my %count; for my $letter ( 'A' .. 'Z', '_', '.' ){ $count{$letter} = () = $site =~ m/\Q$letter/g; }
One you clean up your program to eliminate all that repetitive scripting, it'll be easier to answer your own question.

update: noticed '_' and '.' were in the mix and updated example accordingly (added \Q).

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

  • Comment on Re: I need to sort out some values and get only the highest generated by my perl script
  • Download Code

Replies are listed 'Best First'.
Re^2: I need to sort out some values and get only the highest generated by my perl script
by Prior Nacre V (Hermit) on Oct 29, 2004 at 09:47 UTC

    Or perhaps just:

    my %count; map { ++$count{$_} } ( $site =~ /([A-WY._])/g );

    Minor note: there is no X or Z.

    Regards,

    PN5