Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: I need some beginners help

by mexnix (Pilgrim)
on Aug 06, 2001 at 20:47 UTC ( [id://102604]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: I need some beginners help
in thread I need some beginners help

My 2 cents: You need to make all your statements lowercase (i.e. CHOP, IF, PRINT, ELSE). You need to know $name is different from $NAME, so the program will not even recognize $NAME. \N needs to be \n. Case is very important in perl! I'm not even sure what \N does. Other than that, you can enable warnings by making the #!/usr/bin/perl line #!/usr/bin/perl -w. That will show you your errors. Someone else suggested using chomp, so i'll put it in there too. Keep hacking away!
#!usr/bin/perl -w print "What is your name? "; $name = <STDIN>; chomp($name); if ($name eq "Randal") { print "HELLO, RANDAL! HOW GOOD OF YOU TO BE HERE!\n"; } else { print "HELLO, $name!\n"; #ORDINARY GREETING }

____________________________________________
<moviequote name="Hackers">
The Plague: [...]Well let me explain the New World Order. Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo!
</moviequote>

mexnix.perlmonk.org

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://102604]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.