in reply to Print Data::Dumper with format

Hello Matiasinf, and welcome to the Monastery!

Here are two suggestions which you will find useful:

  1. 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.

  2. Pick out the hash entries you want using a hash slice:

    print join("\t", @contact{qw(name lastName email address phone)});
  3. 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
    Thanks a lot! I just try it and it's works fine. I just have to do some adjustments to do it all. Again, thanks, and now i understand that Data::Dump is not appropriate...