in reply to Print Data::Dumper with format
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, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Print Data::Dumper with format
by Matiasinf (Initiate) on Oct 20, 2014 at 03:11 UTC |