Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Filtering array of strings and numbers

by BillKSmith (Monsignor)
on Apr 29, 2016 at 20:14 UTC ( [id://1161909]=note: print w/replies, xml ) Need Help??


in reply to Filtering array of strings and numbers

It is impossible to do this perfectly! Consider two strings that consist of the same digits and different trailing whitespace. As numbers, they are equal. As strings, they are not. There is no way to tell (from the data alone) which is intended. Coercing everything to strings suppresses the "nastygrams" and is correct for all but a few special cases.
Bill
  • Comment on Re: Filtering array of strings and numbers

Replies are listed 'Best First'.
Re^2: Filtering array of strings and numbers
by graff (Chancellor) on Apr 30, 2016 at 17:04 UTC
    Say rather that it may take more effort than we would like (but it shouldn't be impossible) to fully describe what is meant by "perfectly" for a given task relating to a given set of data.

Log In?
Username:
Password:

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

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

    No recent polls found