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"; }
In reply to Text::ParseWords and pipe delimiter by LanceDeeply
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |