in reply to subroutine syntax
After doing this, $a and $xyz won't be available to you outside of the subroutine. This is all assuming you're operating under strict. Really, you ought to read the Llama book if nothing else, it's fantastic information and explains a lot of this much more clearly than I can. =]&example(15); sub example { my($xyz) = shift || 0; my($a) = $xyz + 49; print $xyz; print $a }
|
|---|