>>>>> "SHC" == Shawn H Corey <[email protected]> writes:
SHC> my @data = qw( The quick brown fox jumped over the lazy dogs. );
SHC> my $regx = qr{ [aeiou] }msx;
SHC> my @matches = map { /($regx)/ } @data;
SHC> print '@matches : ', Dumper \...@matches;
not a major point, but why do you use dumper just to print a list of
tokens? i use dumper for deeper stuff where i can't just print the data
easily without some code. even single level hashes i will print directly
as i can format it my way and not dumper's.
you can do the same thing with print/map:
print "matches:\n:, map "\t$_\n", @matches;
and when i print strings that i am not sure have spaces in them (yours
don't), i use [] to delimit:
print "matches:\n:, map "\t[$_]\n", @matches;
i generally don't print the sigils ($...@%) when printing vars since i know
what i am printing and i don't need to escape or single quote them (yes,
i know % doesn't need escaping).
and i do a lot of debug printing. it is still the most effective
debugging tool around.
uri
--
Uri Guttman ------ [email protected] -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/