| Subject: | Re: sub and return question |
|---|---|
| From: | Rob Dixon |
| Date: | Fri, 10 Oct 2008 20:06:28 +0100 |
| Newsgroups: | perl.beginners |
Richard Lee wrote:
>
> can't you do below??
>
> sub criteria {
> return qw/ 1,3,5,7,9 /;
> }
>
> I was going to do
>
> sub criteria {
> my @array = qw/1,3,5,7,9/;
> }
>
> but was wondering if I can do without if i was calling the sub like this
>
>
> my @array_result = criteria();
Yes, it works fine (once you replace the commas with whitespace). You could have
tried it yourself though :)
Rob
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: sub and return question, Richard Lee |
|---|---|
| Next by Date: | Re: Concerning passing refs of anonyme Hash to subs..., Rob Dixon |
| Previous by Thread: | Re: sub and return question, Richard Lee |
| Next by Thread: | Percentile of inserted element, Kelly Jones |
| Indexes: | [Date] [Thread] [Top] [All Lists] |