define an array in perl

2007-07-31 Thread jeniffer
Hi I am a newbie in perl. I have an array block_list : push ( @block_list ,$word); # this word is read from a file. $list_name = $block_list[$#block_list]; # i extract the last element ie $word in this case now i want to define an array with the name $list_name like , my @"$list_name"; But th

read file

2007-07-11 Thread jeniffer
I have a file of the format action arg1 \ arg2 \ arg3 \ action2 arg1 \ arg2 \ arg3 \ I read this by :- foreach $line (@lines) { ($action , @argument_list) = split(/\s+/,$line); This would work fine if the file is of the format action arg1