Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^3: Using grep in a scalar context

by tobyink (Abbot)
on Feb 07, 2013 at 12:44 UTC ( #1017645=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Using grep in a scalar context
in thread Using grep in a scalar context

I simply didn't think about doing it that way. I could probably count the number of times I've used map in a scalar context on my fingers.

That said, given that the original question was about gene sequences, which can be pretty long strings, it seems preferable to avoid the creation of a temporary array containing all matches. Whether that's an important concern or not depends on many factors (typical number of matches expected; typical length of matched strings; etc).

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Comment on Re^3: Using grep in a scalar context
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2015-11-26 07:34 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls