Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: split problem

by Marshall (Canon)
on Nov 29, 2016 at 22:43 UTC ( #1176866=note: print w/replies, xml ) Need Help??


in reply to split problem

Please explain further what you intend to accomplish as an end result. Your code is actually fine albeit strange.
use strict; use warnings; use Data::Dumper; my $value = "A\tB\tC\tD\tE\tF\t\t\t\t"; my @flds; @flds = split(/\t/,$value); $flds[16] = undef; $flds[8] = 0; print Dumper \@flds; __END__ $VAR1 = [ 'A', 'B', 'C', 'D', 'E', 'F', undef, undef, 0, undef, undef, undef, undef, undef, undef, undef, undef ];
PS: I see other replies, I am using Perl 5.20 Could be a bug.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1176866]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2022-08-10 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?