Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: A proper name for is_sorted function that can check more than just sorting order?

by ikegami (Pope)
on Dec 25, 2017 at 20:42 UTC ( #1206173=note: print w/replies, xml ) Need Help??


in reply to Re: A proper name for is_sorted function that can check more than just sorting order?
in thread A proper name for is_sorted function that can check more than just sorting order?

Or you could actually use all.

all { $res[$_ - 1]{end_date} eq $res[$_]{start_date} } 1 .. $#res

Or if you want to know which ones are "bad" so you can output a message for each of them:

map { $res[$_ - 1] } grep { $res[$_ - 1]{end_date} ne $res[$_]{start_date} } 1..$#res
  • Comment on Re^2: A proper name for is_sorted function that can check more than just sorting order?
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1206173]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2018-06-18 02:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (107 votes). Check out past polls.

    Notices?