"N, Guruguhan (GEAE, Foreign National, EACOE)" wrote:
> ...
> if (-s $input_file_name ) {
> open(INPUT, $input_file_name) || die "Cannot open: \nReason: $!\n";
> @temp = <INPUT> ;
> chomp @temp;
> $header = shift(@temp);
> $header =~ s/^\s+(.*)/$1/; #Remove the leading white spaces
> @col = split /\s+/, $header;
>
> foreach $i ( 0 .. $#temp ) {
...
> @data = split /\s+/, $data_line;
> $data[$i] = split /\s+/, $data_line;
This might be a source of the problem. The control statement of the for loop sets the
$i variable Whatever got assigned to the @data array, this follows that assignment
and assigns the number of elements in the split to $data[$i] . [Hmmm, are you sure
you are using warnings. I tried this syntax and got:
$array[0] = split /\s+/, $line;
Use of implicit split to @_ is deprecated at - line 3.]
Without seeing the input file , in particular the last line of that file, it is hard
to tell exactly what the gory outcome will be, but it is bound to not be pretty.
>
> }
> }
>
> @col = qw (RUN a1 a2 a3 weight sig1 sig2 sig3);
>
> @data=(
This must be the part that you highlighted in red, huh?
>
> [qw( 1 0.200000 0.200000 0.200000 0.765685 75881.9
> 29289.3 -46592.6)],
> ...
> [qw( 5 0.359921 0.253987 0.359921 1.271995 43861.3
> 19666.1 -24195.2)]
> );
Can you describe in less abstract terms what you are trying to accomplish. What is
the filter expression or function that you wish to use? We can probably show you
simpler ways to get the job done.
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>