Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Perl
Perl Misc
Text::ParseWords::parse_line bug?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="tsotsi, post: 4822936"] Does anyone know of any bug in ParseWords? I have an input string that I want to split on the pipe using ParseWords since split removes trailing pipes with empty data. code --------------------------------------------------------------------------------------------------------------------- use Text::ParseWords; open(INPUT,"testdata.txt"); while (<INPUT>) { chomp; my @fields = Text::ParseWords::parse_line( qr(\|), 0,$_); print "==$_==\n"; print "field0=$fields[0]\n"; print "field1=$fields[0]\n"; print "field2=$fields[0]\n"; print "field3=$fields[0]\n"; } close(INPUT); --------------------------------------------------------------------------------------------------------------------- I get the following when I run it --------------------------------------------------------------------------------------------------------------------- perl qwe.pl ==641.59 $' 19|641.59 B|TX725.H1 B49|-|1364|1|DEAN|1|TOWN|COOK|0|0|19971126|641.59 B|== field0= field1= field2= field3= [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
Text::ParseWords::parse_line bug?
Top