- or download this
$ perl -le 'my (@x, @y); @x = ( "A", "B", "C" ); @y = ( "C", "D", "F"
+); &test( @x, @y, ); sub &test { @test = @_[0]; print "@test\n"; }'
Illegal declaration of anonymous subroutine at -e line 1.
- or download this
$ perl -le 'my (@x, @y); @x = ( "A", "B", "C" ); @y = ( "C", "D", "F"
+); &test( @x, @y, ); sub test { @test = @_[0]; print "@test\n"; }'
A
- or download this
$ perl -Mstrict -Mwarnings -le 'my (@x, @y); @x = ( "A", "B", "C" ); @
+y = ( "C", "D", "F" ); &test( @x, @y, ); sub test { @test = @_[0]; pr
+int "@test\n"; }'
Variable "@test" is not imported at -e line 1.
...
Global symbol "@test" requires explicit package name (did you forget t
+o declare "my @test"?) at -e line 1.
Global symbol "@test" requires explicit package name (did you forget t
+o declare "my @test"?) at -e line 1.
Execution of -e aborted due to compilation errors.
- or download this
$ perl -Mstrict -Mwarnings -le 'my (@x, @y); @x = ( "A", "B", "C" ); @
+y = ( "C", "D", "F" ); &test( @x, @y, ); sub test { my @test = @_[0];
+ print "@test\n"; }'
Scalar value @_[0] better written as $_[0] at -e line 1.
A
- or download this
$ perl -Mstrict -Mwarnings -le 'my (@x, @y); @x = ( "A", "B", "C" ); @
+y = ( "C", "D", "F" ); &test( @x, @y, ); sub test { my @test = $_[0];
+ print "@test\n"; }'
A
- or download this
$ perl -Mstrict -Mwarnings -le 'my (@x, @y); @x = ( "A", "B", "C" ); @
+y = ( "C", "D", "F" ); &test( @x, @y, ); sub test { my @test = @_; pr
+int "@test\n"; }'
A B C C D F
- or download this
$ perl -Mstrict -Mwarnings -le 'my (@x, @y); @x = ( "A", "B", "C" ); @
+y = ( "C", "D", "F" ); &test( \@x, \@y, ); sub test { my @test = @_;
+print "@test\n"; }'
ARRAY(0x20071958) ARRAY(0x200718e0)
- or download this
$ perl -Mstrict -Mwarnings -le 'my (@x, @y); @x = ( "A", "B", "C" ); @
+y = ( "C", "D", "F" ); &test( \@x, \@y, ); sub test { my @test = @_;
+foreach my $arr ( @test ) { print "@{$arr}"; } }'
A B C
C D F