-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi All,

This is my first post at beginners. I am working with Learning Perl
(Llama!) and I like to tweak some of the problems and create more
creative solutions to some things. I cannot figure out why this is not
working. Can anyone point out an error in my code.

#! Perl

@names = qw( fred barney betty wilma dino );
print "Enter some numbers 1 to 5, one per line, then press ctrl Z:\n";
chomp (@numbers = <STDIN>);
~  if (@numbers > 5) {
          print "Error: choose numbers less then 6!\n";
~  } else {
          foreach (@numbers); {
                  print "$names[ $_ - 1 ]\n";
          }
Best,
- --
Hakim Singhji
New York University
[EMAIL PROTECTED]
http://i5.nyu.edu/~hzs202
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCoTsjs2AZ6g3dZu8RAtAdAJ44jsNG/TUOiP4kDyuZWN3tWIrrFQCdFB+V
WKsRYfcrHasOTOB4lhrlMOg=
=K40v
-----END PGP SIGNATURE-----

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to