K
ko
Quick question. The code snippet works under the following builds:
v5.6.1 built for MSWin32-x86-multi-thread (Activestate 635)
v5.6.1 built for i386-freebsd (pkg_info = perl-5.6.1_11)
==CODE==
use strict;
use warnings;
my $string = '1 2 3 4';
my @$ar = split(/\s+/,$string);
print "@$ar\n";
==RESULTS==
1 2 3 4
But if run under Activestate 804 or 5.005_03 for i386-freebsd (taking
out 'use warnings, and replacing with #!/usr/bin/perl -w), I get the
following error message:
'Can't declare array dereferences in my at...'
Looking at the error message, I would guess that you're only allowed
to declare scalar, array, or hash variables? Being a novice
programmer, I thought the declaration was ok through autovivification.
Could someone please explain what I am missing and why it works under
Perl 5.6.1?
Thanks in advance
keith
v5.6.1 built for MSWin32-x86-multi-thread (Activestate 635)
v5.6.1 built for i386-freebsd (pkg_info = perl-5.6.1_11)
==CODE==
use strict;
use warnings;
my $string = '1 2 3 4';
my @$ar = split(/\s+/,$string);
print "@$ar\n";
==RESULTS==
1 2 3 4
But if run under Activestate 804 or 5.005_03 for i386-freebsd (taking
out 'use warnings, and replacing with #!/usr/bin/perl -w), I get the
following error message:
'Can't declare array dereferences in my at...'
Looking at the error message, I would guess that you're only allowed
to declare scalar, array, or hash variables? Being a novice
programmer, I thought the declaration was ok through autovivification.
Could someone please explain what I am missing and why it works under
Perl 5.6.1?
Thanks in advance
keith