#!/usr/bin/perl use strict; use warnings; my @output; while ( my $line = <> ) { my @zahlen = split /\s+/, $line; my $row = 0; for my $wert ( @zahlen ) { push @{$output[$row++]}, $wert; } } for my $row ( @output ) { print "@$row\n"; }