in reply to subroutine syntax
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: subroutine syntax
by marius (Hermit) on Dec 11, 2000 at 03:37 UTC |