On Mon, Jan 06, 2003 at 04:29:41PM -0500, Paul Kraus wrote:
> I don't understand why the output of the two print statements inside the
> subroutine is different. The one only prints the new line. 

Hmm, I get "Use of uninitialized value in concatenation (.) or string at
qw" for both.

> #!/usr/bin/perl -w
> 
> @array=qw/paul david kraus/;
> $arrayref=\@array;
> 
> print "$arrayref\n";
> print "$$arrayref[0]\n";
> 
> &suby($arrayref);
> 
> sub suby {
>   $temp=$_[0];
>   print "$$_[0][0]\n";
>   print "$temp[0]\n";
> }

Try any of the following:

  print "${$_[0]}[0]\n";
  print "$_[0][0]\n";
  print "$_[0]->[0]\n";
  print "$$temp[0]\n";
  print "$temp->[0]\n";

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

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

Reply via email to