} else { # No other page created it, so create it now... my @otherBlocksOfCode; # <===== lexically scoped to else block push(@otherBlocksOfCode, {-type=>"text/javascript", -src=>"/path/file1.js"}); }