codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $pos = tell DATA; my @tmp; my @AoA; while (<DATA>) { @tmp = split; push @AoA, \@tmp; } print "wrong:\n", Dumper \@AoA; seek DATA, $pos, 0; @AoA = (); while (<DATA>) { @tmp = split; push @AoA, [@tmp]; } print "right:\n", Dumper \@AoA; __DATA__ 1 2 3 4 5 6 7 8 9
Private
[
?
]
Run code
Submit