Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Case insensitive string comparison (updated x2)

by AnomalousMonk (Bishop)
on Jun 28, 2020 at 03:16 UTC ( #11118615=note: print w/replies, xml ) Need Help??


in reply to Re^2: Case insensitive string comparison (updated x2)
in thread Case insensitive string comparison

... a ref to a single scalar ...

My guess about a possible rationale for this is that the strings being handled are in reality very long and DAN0207 wants to avoid making a bunch of copies of these long strings (e.g., to pass to subroutines). In a case like this, I'd agree that taking a reference to a scalar (string) and passing it around could be quite advantageous in the right circumstances. But this is all just guesswork.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^4: Case insensitive string comparison (updated x2)
by Marshall (Canon) on Jun 29, 2020 at 08:23 UTC
    My guess is that the OP has an array of similar lines, not just a ref to a single line. If he wants to send that array info to a sub, then pass a reference to that array. The OP provided nothing in terms of work flow and we are left to guess. With the info given, passing a ref to a single line doesn't appear to make any sense. Passing a ref to the entire array of strings would make sense.

    I also don't really understand why some csv lines should be transformed into a single token and others left as they are. This transformation is presumably being done for some future processing. Ok, what processing is that? And why is condensing a subset of lines to a particular single token result necessary?

    Maybe what is of interest are the lines that don't match the pattern? Maybe the returned array should be limited to the lines that don't match? I have no idea because this is application specific.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2020-09-22 18:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (129 votes). Check out past polls.

    Notices?