Like this:
See how elegant that is? Whatever variable you pass to example gets assigned to $var and operated upon.$xyz = 15; $abc = 30; &example($xyz); &example($abc); sub example { local $var = @_; $a = $var + 49; print $var; print $a; }
enjoy - epoptai
In reply to Re: subroutine syntax
by epoptai
in thread subroutine syntax
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |