The out put is:#!/usr/bin/perl use strict; use warnings; use Text::ParseWords; my $text; do {local $/; $text = <DATA>}; my @words = quotewords('\s+', 1,$text); my $i = 0; foreach (@words) { if (/^".+"$/s) { printf "<%s> : COUNT %d\n", $_, scalar split; } } __DATA__ "Yes, yes, how was it now?" he thought, going over his dream. "Now, how was it? To be sure! Alabin was giving a dinner at Darmstadt; no, not Darmstadt, but something American. Yes, but then, Darmstadt was in America. Yes, Alabin was giving a dinner on glass tables, and the tables sang, _Il mio tesoro_--not _Il mio tesoro_ though, but something better, and there were some sort of little decanters on the table, and they were women, too," he remembered.
C:\Old_Data\perlp>perl t33.pl <"Yes, yes, how was it now?"> : COUNT 6 <"Now, how was it? To be sure! Alabin was giving a dinner at Darmstadt; no, not Darmstadt, but something American. Yes, but then, Darmstadt was in America. Yes, Alabin was giving a dinner on glass tables, and the tables sang, _Il mio tesoro_--not _Il mio tesoro_ though, but something better, and there were some sort of little decanters on the table, and they were women, too,"> : COUNT 66
In reply to Re: Count Quoted Words
by Cristoforo
in thread Count Quoted Words
by flash4syth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |