Topic awaiting preservation: ...And on your left, a Perl subroutine... |
|
---|---|
Author | Thread |
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
posted 06-23-2002 03:14
I know about using 'shift()', but |
Paranoid (IV) Inmate From: California |
posted 06-23-2002 03:52
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 |
posted 06-23-2002 03:55
What's nice about Perl is you can return a list of things... |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-23-2002 04:02 |
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
posted 06-23-2002 04:20
so, you're saying is- all I need is the 'return();' function? |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 06-23-2002 06:31
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 |
posted 06-23-2002 06:41
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 |
posted 07-04-2002 21:56
ok but subroutines do not need parenthsis either. code: sub this {
|