Hi, I got this script that is executed like this: ./colstat.pl -f <filename> -e ; (specifywhat to use in the split function in order to divide the columns) I would like to put each line from the input file into an array, and I want to put this array into a hash, where the column number equals to the hash key/pointer, so the print would look somehow like this:
nr 1: 34 67 927 536 8 92 nr 2: 4 563 1 56789 983 nr 3: 43 02 903 63 73 893 . . . . . Following is the script I got this far, this does not print out the output I just described, but an output looking like this: 6: 34 4 78 1 5463 The part with the probem: while ( $line = <FILE> ) { chomp $line; @dataarray = split /$var/,$line; $column = $dataarray[$c]; push(@array,$column); $counter++; } $hash{$counter + 1} = [ @array ]; for my $nr ( keys %hash ) { print sort "$nr: @{ $hash{$nr} }\n"; } -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/