Re: references and objects

From: Angie Ahl (angie_at_vertebrate.co.uk)
Date: 11/14/03


Date: Fri, 14 Nov 2003 11:55:07 +0000
To: Perl List <beginners@perl.org>

Sorry I forgot to mention that the package IS an object ;)

on 14/11/03 angie ahl said:

>Hi everyone
>
>I'm failing to find something in the manuals (or at least the bit I'm
>missing ;)
>
>I have an package called "Event"
>
>in it I have a subroutine called EventList
>
>I want to return an array and 2 scalars.
>
>sub EventList {
> my ($class, %arg) = @_;
> # load of code here
> return (\@list, \$startdate, \$enddate);
>}
>
>So far so good (I think)
>
>but I don't seem to be able to access it. I've tried all sorts:
>
>my $event = Event->new;
>my @tempres = $event->EventList(skip=>0, max=>10);
>my $startdate = $tempres[2];
>my $enddate = $tempres[3];
>
>could anyone give me a clue as to how I would get 2 scalars and an
array
>out of an object and what kind of syntax to use to access the returned
>values. I'm just missing something I'm sure.
>
>Thanks
>
>Angie
>



Relevant Pages

  • Re: Reference to derived type element by index?
    ... as a set of distinctively-named scalars. ... In another scope, the same common block ... would be a single array. ... algorithm and a specific application of the algorithm, ...
    (comp.lang.fortran)
  • FAQ 4.39 What is the difference between a list and an array?
    ... What is the difference between a list and an array? ... A list is a fixed collection of scalars. ... However, if the list element is itself a variable, it appears that you ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ...
    (comp.lang.perl.misc)
  • FAQ 4.39 What is the difference between a list and an array?
    ... What is the difference between a list and an array? ... A list is a fixed collection of scalars. ... However, if the list element is itself a variable, it appears that you ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ...
    (comp.lang.perl.misc)
  • FAQ 4.39 What is the difference between a list and an array?
    ... What is the difference between a list and an array? ... A list is a fixed collection of scalars. ... However, if the list element is itself a variable, it appears that you ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ...
    (comp.lang.perl.misc)
  • FAQ 4.39 What is the difference between a list and an array?
    ... What is the difference between a list and an array? ... A list is a fixed collection of scalars. ... However, if the list element is itself a variable, it appears that you ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ...
    (comp.lang.perl.misc)