in reply to Re^6: split function
in thread split function
1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36
1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36
1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36
1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36
However, the line get chop after the lengh is >= 51. Is there any workaround which can read the full line?sub split_the_element{ my ($local_fh) = @_; while (<$local_fh>) { chomp; my $size = length $_; print "size $size\n"; foreach my $element (split ';', $_) { printf $fhout "%s,\n", $element; } }
size 51
size 51
size 51
size 51
size 51
size 51
size 51
size 51
size 51
size 36
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: split function
by Anonymous Monk on Jan 26, 2012 at 09:00 UTC | |
|
Re^8: split function
by Anonymous Monk on Jan 26, 2012 at 09:14 UTC | |
|
Re^8: split function
by Marshall (Canon) on Jan 27, 2012 at 04:20 UTC |