[Za-pm] Problem with array.

kmf at pop.co.za kmf at pop.co.za
Mon Jun 23 03:49:19 CDT 2003


Hi 
I'm a uber noob to perl. 
I trying a basic perl app. With the following 
objectives. Placing the different users in 
different categories. 
 
Sorry 
forgive me for pasting the code I don't know the rules. 
 
Thanks  
  Karl 

____________________________________________________________ 
#!/usr/bin/perl 
-w 
$a="Are they good or evil?"; 
@good=qw(Neo Trinity Morpheus); 

@builder=qw(Oracle Architect); 
@bad=qw(Smith Agents Agent Twins); 
print 
("Enter the name to see if you can trust them \n"); 
print ("$a \n"); 
print 
("What is Your Name? \n"); 
$name=<STDIN>; 
chomp $name; 
if ($name=@good){print 
"Your are here to change everyone. \n" 
} #else { print"I don't know you!" }; 
 
elsif ($name=@builder){print "Your are a builder of the Matrix \n" 
  } elsif 
($name=@bad){print "Uber Eek! I won't mess with you \n" 
}; 




More information about the Za-pm mailing list