![]() Topic awaiting preservation: ...And on your left, a Perl subroutine... (Page 1 of 1) |
|
---|---|
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
![]() I know about using 'shift()', but |
Paranoid (IV) Inmate From: California |
![]() Here is a quick little sub that shows you how to return a value. It's pretty straight forward: code: sub parse_template {
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() What's nice about Perl is you can return a list of things... |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() |
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
![]() so, you're saying is- all I need is the 'return();' function? |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Well, yes. But technically speaking, return isn't a function. I'm tempted to say it's an operator, but I'm not sure, so I'm going to look it up... |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() note the return statement is not even always needed, if not explictly called the sub will automatically return the value of the last statement. |
Bipolar (III) Inmate From: Michigan |
![]() ok but subroutines do not need parenthsis either. code: sub this {
|