perl.beginners
[Top] [All Lists]

Re: sub and return question

Subject: Re: sub and return question
From: Richard Lee
Date: Fri, 10 Oct 2008 14:12:51 -0400
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();

??
actually qw/ 1 3 5 7 9/; i was wrongly adding commas there.. sorry abou thtis post.. disregard please.

<Prev in Thread] Current Thread [Next in Thread>