Hi fellow Monks
I have 2 machines both running perlbrew Perl 5.16.0 and both using the same version of Data::Printer. The small script below produces contradictory results on the 2 machines:
machine 1:
$ perl --version
This is perl 5, version 16, subversion 0 (v5.16.0) built for x86_64-li
+nux
$ perl -MData::Printer -le 'print $Data::Printer::VERSION'
0.36
$ cat /tmp/x.pl
use 5.016;
use strict;
use warnings;
use Data::Printer {alias => "pp", return_value => 'dump'};
my @x = (1,2,3);
say pp(\@x);
$ perl /tmp/x.pl
Type of arg 1 to Data::Printer::p must be one of [@$%&] (not reference
+ constructor) at /tmp/x.pl line 8, near "@x)"
Execution of /tmp/x.pl aborted due to compilation errors.
Now edit script to take '\' out from the pp call and rerun:
$ perl /tmp/x.pl
[
[0] 1,
[1] 2,
[2] 3
]
machine 1:
$ perl --version
This is perl 5, version 16, subversion 0 (v5.16.0) built for i686-linu
+x
$ perl -MData::Printer -le 'print $Data::Printer::VERSION'
0.36
$ cat /tmp/x.pl
use 5.016;
use strict;
use warnings;
use Data::Printer {alias => "pp", return_value => 'dump'};
my @x = (1,2,3);
say pp(\@x);
$ perl /tmp/x.pl
[ 1, 2, 3 ]
Now edit script to take '\' out from the pp call and rerun:
$ perl /tmp/x.pl
When calling p() without prototypes, please pass arguments as referenc
+es at /tmp/x.pl line 8.
So on one one machine I'm told to pass a reference and on the other machine I'm told to not pass a reference. Any idea what is causing this? I'd like to run the same code on both machines but I cannot see why they differ.