programming-examples/perl/SystemFunction/Pass new variable name to Data-Dumper function.pl
2019-11-15 12:59:38 +01:00

20 lines
306 B
Perl

#!/usr/bin/perl -w
use strict;
use Data::Dumper;
# create a complex data type
my @a = (
'hello, world',
1234.56,
[ 2, 4, 6 ],
{ one => 'first', two => 'second' }
);
# create a reference to it
my $r = \@a;
# dump it out
print Data::Dumper->Dump([$r], ['myvarname']);