hi, everyone

I code this program but It don' t run, I don't know what the problem
with it, Can anyone help? Thank you!

----------------------------------------

#!/perl/bin/perl

use strict;

print "Enter id: ";
chomp (my $id=<STDIN>);

print match($id);

sub match
{
        my $matchID=shift;
        my @localID=qw/ 0001 0003 0002 0004 00056/;

        my %person=( name=>{    0001=>'chao sophal',
                                0003=>'lee lyekuan',
                                0002=>'theavylong',
                                0004=>'surgrapany',
                                00056=>'SZE PENG'
                            },

                        age=>{  0001=>'22',
                                0003=>'20',
                                0002=>'22',
                                0004=>'24',
                                00056=>'26'
                                },

                       school=>{0001=>'Unversity Science Malaysia',
                                0003=>'Northing University',
                                0002=>'Stamford College',
                                0004=>'Summani Informaiton Technology, India',
                                00056=>'Norting University'
                                }
                );

        foreach (@localID)
        {
                if($matchID eq $_)
                { 
                        my @data;
                        push @data, $person{name}->{$matchID}, 
$person{age}->{$matchID},
$person{school}->{$matchID};
                        return @data;
                }
        }
        return "not such Id in database";
}

-- 
May GOD blesses you, and your family
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to