in reply to Re: Arrays manipulation
in thread Arrays manipulation
Easier to read and avoids the map in void context:
#!/usr/bin/perl my @array = ( 'nfs,7,rw', 'afp,12,rro', 'cifs,32,ro', 'dns,5,rw', ); my @cols; for my $row (@array) { my $i = 0; push @{$cols[$i++]}, $_ for split /,/, $row; } use Data::Dumper; print Dumper(\@cols);
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Arrays manipulation (no $i either)
by Aristotle (Chancellor) on May 02, 2003 at 00:56 UTC | |
by sauoq (Abbot) on May 02, 2003 at 18:46 UTC | |
by Aristotle (Chancellor) on May 03, 2003 at 00:57 UTC | |
by sauoq (Abbot) on May 03, 2003 at 01:47 UTC | |
by Aristotle (Chancellor) on May 03, 2003 at 01:59 UTC |