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

Re: problem with foreach

by neniro (Priest)
on Jun 16, 2006 at 07:39 UTC ( #555703=note: print w/replies, xml ) Need Help??

in reply to problem with foreach

EDIT: I'm to slow - see node above

You can fill the array in one step using qw, and you can count all 'b' in this array in one step using grep:

my @ar = qw /a b b a/; my $cnt = 0 ; $cnt = grep /b/, @ar;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://555703]
[erix]: my objection to sigs is just that they take screen space. ( Some monks would have *several* slogans underneath a 1-liner reply )
[Discipulus]: a solution would be disabiltate sig as default and let users to show them
[karlgoethebier]: now it's getting weird...
[GotToBTru]: 'getting'?
[Discipulus]: why karlgoethebier ?

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2017-06-22 12:46 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (519 votes). Check out past polls.