open (A1, "<2 normaal.txt") or die "can't open"; my @MainArray; while (<A1>) { my $in = $_; chomp $in; push (@array1, split(//, $in)); }
Another way to do it:
open my $A1, '<', '2 normaal.txt' or die "can't open '2 normaal.txt' b +ecause: $!"; my @MainArray; while ( my $in = <$A1> ) { push @MainArray, [ $in =~ /[[:alpha:]]/g ]; }
In reply to Re: Parse txt file into array of array
by jwkrahn
in thread Parse txt file into array of array
by Dr Manhattan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |