hi,
iam perl begginer,i have written the program
#!/usr/bin/perl
#use warnings;
use strict;
print "Enter the name:","\n";
my $name=<STDIN>;
my %hash=(siva => "9902774481",
dev => "9916391244",
venky => "9440506760",
manohar => "9440232695"
);
print "$name no is: $hash{$name}","\n";
iam not getting expected output
my expected output is
enter the name:siva
siva no is:9902774481
but what iam getting is
enter the name:siva
siva no is:
number iam nt getting....will anybdy solve this
First please use code tags
Please use code tag
Probably you might save few seconds when not using it, but many in the forum have to spend their time in reading the code that is not within CODE tags, please use code tags.
Try,
chomp($name)
what is that code tag means..wl u explain..plzzz
oh! balajesuri@ by the time I searched for that awesome video, you posted it. Thanks
---------- Post updated at 10:57 AM ---------- Previous update was at 10:56 AM ----------
And please don't use cyber chat style language
thanks ...i used 'chomp' .it is working fine....
will you please send me some perl progrmming questions..to get practice..??