Hello Matiasinf, and welcome to the Monastery!
Here are two suggestions which you will find useful:
Add a chomp statement to sub entrada:
sub entrada { my ($var) = shift; print "Ingrese $var: "; my $in = <STDIN>; chomp $in; # <== Add this return $in; }
This removes the trailing newline character from the datum input by the user.
Pick out the hash entries you want using a hash slice:
print join("\t", @contact{qw(name lastName email address phone)});
As others have already pointed out, Data::Dumper is not the appropriate tool to use here.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Print Data::Dumper with format
by Athanasius
in thread Print Data::Dumper with format
by Matiasinf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |