Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Alternative to smart match

by LanX (Saint)
on Jan 22, 2022 at 11:47 UTC ( [id://11140706]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140706]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-26 00:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found