LanceDeeply has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use Text::ParseWords; s1 ("just|another|perl|hacker"); s2 ("just|another|perl|hacker"); sub s1 { my $text = shift; my @words = split /\|/, $text; foreach my $word ( @words ) { print "[$word]"; } print "\n"; } sub s2 { my $text = shift; my @words = parse_line("|", 0, $text); foreach my $word ( @words ) { print "[$word]"; } print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Text::ParseWords and pipe delimiter
by jeffa (Bishop) on Jul 29, 2002 at 17:46 UTC | |
by LanceDeeply (Chaplain) on Jul 29, 2002 at 17:55 UTC |