# a=463.3742.23 # b=99 sub getFoo{ my $a; my $b; my $strFoo; ($a,$b) = @_; $strFoo .= $a; $strFoo .= "_"; $strFoo .= $b; $strFoo .= "_testme"; $strFoo .= ".xml"; return $strFoo; } Result: $strFoo=463.3742.23_99_testme.xml #### # single value passed in = 463.3742.23 sub getFoo{ my $strFoo = @_; $strFoo .= "_testme"; $strFoo .= ".xml"; return $strFoo; } Result: $strFoo=463.3742.23_testme.xml *or* $strFoo=1_testme.xml