On Nov 14, angie ahl said:

>I want to return an array and 2 scalars.

Well, you're returning an array reference and two scalar references.  I
don't think the scalars need to be referenced, but I would probably keep
the array reference.

>sub EventList {
>    my ($class, %arg) = @_;
>    # load of code here
>    return ([EMAIL PROTECTED], \$startdate, \$enddate);
>}

  return ($startdate, $enddate, [EMAIL PROTECTED]);

>my $event = Event->new;
>my @tempres = $event->EventList(skip=>0, max=>10);
>my $startdate = $tempres[2];
>my $enddate = $tempres[3];

You'd need $tempres[1] and $tempres[2], since arrays are 0-based, but
you'd also need ${ $tempres[1] } and ${ $tempres[2] }, since you're
returning references to those scalars.  Using my return values, you'd do:

  my ($start, $end, $listref) = $event->EventList(skip => 0, max => 10);

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to