in reply to Re^2: Loading specific columns into arrays
in thread Loading specific columns into arrays
Taking some advice from Basic debugging checklist lets see what you have so far
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd pp /; my $string = qq/a b c\nb b c\nd b c\n/; { my @stuff = split '/\s+/', $string; dd $string; dd \@stuff; } __END__ "a b c\nb b c\nd b c\n" ["a b c\nb b c\nd b c\n"]
So there is 1)problem with your split invocation
If you copy/paste from split documentation or your previous post Regex for non-patterned input a corrected split invocation, you have
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd pp /; my $string = qq/a b c\nb b c\nd b c\n/; { my @stuff = split /\s+/, $string; dd $string; dd \@stuff; } __END__ "a b c\nb b c\nd b c\n" ["a", "b", "c", "b", "b", "c", "d", "b", "c"]
Do you see any issues with this? Do you see what your next step should be?
|
|---|