On Jan 23, 2008 7:07 PM, Juan Luis Belmonte <[EMAIL PROTECTED]> wrote:
snip
> If  you 'call' @{$y} you are using the array with the content of $y as
> name of the array.
snip

Yeah, that is a bad practice called symbolic references left over from
before we had real references.  Modern Perl code uses the strict
pragma to turn that nightmare into an error.  The following code
produces the error

Can't use string ("foo") as an ARRAY ref while "strict refs" in use at
t.pl line 7.

#!/usr/bin/perl

use strict;
use warnings;

my $y = "foo";
foreach  (@{$y}){
    print "i'm doing something with $_ \n ";
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to