in reply to Proper way to split a line with the "," delimiter
Hello Anonymous Monk,
Just to add something minor here. I My personal preference that helps me a lot to debug my code is Data::Dumper.
Sample code:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @array = split(/\,/, 'nick,1,2,,56,88'); print Dumper \@array, scalar @array; __END__ $ perl sample.pl $VAR1 = [ 'nick', '1', '2', '', '56', '88' ]; $VAR2 = 6;
Hope this helps, BR.
|
|---|