The subroutine ends with the return-statement. Therefore, in your case the line return @val; will never be executed.
In order to return more than one value, put all your return-values in a list, array or a hash and return that. The caller of your sub will then need to split the individual return-values ...
HTH, RataIn reply to Re: return more than 1 value
by Ratazong
in thread return more than 1 value
by changma_ha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |