note
Marshall
<c>
#!/usr/bin/perl -w
use strict;
my $data ='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';
my @elements = split (';',$data);
my $number =1;
foreach my $element (@elements)
# or could be:
# foreach my $element (split (';',$data))
{
print "number=$number\t element=$element\n";
$number++;
}
</c>
The above works.<p>
I think that there is a "new line" in your data file
file.
<c>
sub split_the_element
{
my ($fh_in) = @_; #or: my $fh_in = shift;
my @result;
while (<$fh_in>)
{
chomp;
foreach my $element (split ';', $_)
{
push (@result, $element);
}
}
return @result;
}
</c>
949808
949844