Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: I need some beginners help

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


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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found