Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: regexp list return 5.6 vs 5.8

by Errto (Vicar)
on Jan 24, 2008 at 18:49 UTC ( #664114=note: print w/replies, xml ) Need Help??

in reply to Re: regexp list return 5.6 vs 5.8
in thread regexp list return 5.6 vs 5.8

What do you mean exactly? What kind of "array-specific" behavior are you trying to avoid? If you want to take data you are creating as a list but apply it in scalar context, you need to make some decision for yourself about what data you want and code accordingly. For example, map operates on a list and returns a list. If you want to use that in scalar context, and want something other than the length of the list as the value, you need to decide what you want. If you always want the last value, one way to do that is
my $scalar = (map { some code } some list)[-1];

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://664114]
[Corion]: For testing I imagine one would want to test a random sampling of such "bad"/"unexpected" requests, while for downloading, one would want to generate them all in order, but not necessarily as a huge list
[Corion]: s/Algorithm:: Permute/Algorithm ::Loops/

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-01-16 15:45 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (151 votes). Check out past polls.