in reply to Re^2: Alternative to smart match
in thread Alternative to smart match

Great, your welcome.

But please keep in mind that hashes are randomized in Perl, hence you can't rely on the order.

If it's meant for display in HTML you might want to sort them first.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^4: Alternative to smart match
by Bod (Parson) on Jan 22, 2022 at 17:57 UTC
    ...please keep in mind that hashes are randomized in Perl...

    Yes, I do realise this but thanks for the reminder.

    In this application, the order doesn't matter. The data is for highways. The array is to store the highway authority(ies) for each route. Given that the length of the highway is very small compared to the geographic jurisdiction of the authority, very very few cross a border. So the vast majority of routes only have one authority. Ordering them doesn't matter for the odd one that does cross a border.

      my $auth_list = join '<br>', sort keys %seen;

      Is just one word longer.