[prog] Perl code

Noir acknak_halflife at yahoo.co.uk
Sat Feb 5 23:46:30 EST 2005


Can anyone tell me what's wrong with the following
code?

#!/usr/bin/perl -w
@names = qw#fred betty barney dino wilma pebbles
bamm-bamm#;
print "Enter number:  \n";
chomp (@number = <STDIN>);
foreach (@number) {
    print "$names [ $_ - 1 ]\n";
}

Input: 1 2 3
Output (after ctrl-d): fred betty barney


	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com


More information about the Programming mailing list