@_extraJSCode = ({-type=>"text/javascript", -src=>"http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"},); # then at the main header, where it is built, I do this: if($_extraJSCode[0]) { push(@_extraJSCode, {-type=>"text/javascript", -src=>"/path/file1.js"}); } else { @_extraJSCode = ({-type=>"text/javascript", -src=>"/jsfiles/st_utilities.js"}); }