#! /usr/bin/perl use strict; use warnings; #a plethora of my's ...strict baffles me my @contents; my @aoa; my @ctags; my @ctagarray; my @aoac; my @headc; my @contentc; my @fontc; my @scalarclose; my $ctag; my $font; my $head; my $content; my $val; my $newlength; my $count; my $scalarclose; my $headc; my $fontc; my $contentc; my $i; #two arrays of arrays to populate @aoa=qw/header font content/ ; @aoac=qw/headerc fontc contentc/; # array of array values @contents=( ["html","head","body",], ["font","face","size","color"], ["h1","p","code"] ); #scalar ref to array for later population $scalarclose=\@aoac; #populate the aoa for (0...$#aoa){ $aoa[$_]=$contents[$_]; } #use contents of populated aoa foreach $val(@aoa){ # an incrementer hacked to use for populating # an aoa with modified values ++$i; $count=$i-1; #get values from original aoa and modifiy, #begin population of new aoa our $length=scalar @$val; for (0...$length-1){ $ctag="<\\$val->[$_]>"; push @ctags ,$ctag ; } $newlength=$length+1; @ctagarray=splice @ctags,0,$newlength; #this line is problematic @$scalarclose[$count]=map {$_}, @ctagarray; } #scalar refs to aoa $headc=$aoac[0]; $fontc=$aoac[1] ; $contentc=$aoac[2]; #print to see the populus >>broken<< print " $headc->[1]\n"; print " $fontc->[1]\n"; print " $contentc->[1]\n";