Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Count Quoted Words

by smls (Friar)
on Jun 07, 2013 at 03:51 UTC ( [id://1037567]=note: print w/replies, xml ) Need Help??


in reply to Count Quoted Words

Given an array @words like shown in the question, you could do:
my $count; foreach (@words) { my $quote = ($_ eq '"'); if ($quote ... $quote) { if (!$quote) { $count++ } elsif ($count) { print "$count quoted words\n"; $count = 0 } } }
Although I admit that the ... operator is slighty obscure... :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-18 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found