#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my @arrays; my $count = -1; while (<DATA>) { chomp; $count++ if $_ eq '['; next if /[][]/; push @{ $arrays[$count] }, $_; } print Dumper \@arrays; __DATA__ [ aaaa bbbbb ] [ ccc dddd eeeee ] [ f ]
In reply to Re: need help to create array dynamically
by choroba
in thread need help to create array dynamically
by vkp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |