The third parameter is an anonymous array.  What this means is that we are referring 
to an array by reference that we didn't name first.  If you printed it out, Perl would 
display it as something like ARRAY(something).
 
Just as an example, you could do something like this:
 
#######################################
 
my @array = ("dog","cat","pig","Rush Limbaugh");
my $ref1 = ["dog","cat","pig","Rush Limbaugh"];
my $ref2 = [EMAIL PROTECTED];
 
print $ref1->[2]; #Prints "pig"
print $ref2->[2]; #Also prints "pig"
 
#######################################
 
$ref1 and $ref2 are both references to arrays, but $ref1 is a reference to an array 
that was created and initialized at the time $ref1 was created, while $ref2 is a 
reference to a named array that already existed.
 
I hope that clears things up a bit.  You can also declare references to anonymous 
hashes like this:
 
my $hashref = {name => 'daffy', surname => 'duck'};
 
Finally, check out 'perldoc perlreftut'.
 

        -----Original Message----- 
        From: Nilay Puri, Noida [mailto:[EMAIL PROTECTED] 
        Sent: Wed 2/4/2004 12:35 AM 
        To: Perl List (E-mail) 
        Cc: 
        Subject: reference ?
        
        


        > Hi all,
        >
        > my $tmp_holder = find_file($VENTURA_BASEDIR . '/chapters', $title_code,
        > ['pdf']);
        >
        > 1. What's the explanation of 3rd parameter ?
        > 2. Is it declaring and passing a reference ? Is this the way to initialise
        > a reference ?
        

Reply via email to