in reply to Create dynamically different array names based on counter incrementation

If you just want line 1 to become array1, etc., then this works:
#!/usr/bin/perl use strict; use warnings; my $file = '/path/to/file'; open FH, $file; my ( @arr, @AoA, $aref ); while (<FH>) { push @AoA, [split]; for $aref (@AoA) { print "[ @$aref ],\n"; } } close FH;
  • Comment on Re: Create dynamically different array names based on counter incrementation
  • Download Code