Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Regarding Declaring Variables

by vishi83 (Pilgrim)
on Nov 17, 2005 at 05:50 UTC ( [id://509297]=note: print w/replies, xml ) Need Help??


in reply to Regarding Declaring Variables

Hi Tech77 !!

This is another way to do the same program, though Grandfather had given a better one i guess..

use strict; use warnings; my $no=12; my $target; do { print "Guess the number : "; chomp($target = <STDIN>); print "$target is too low\n" if ($target < $no); print "$target is too high\n" if ($target > $no); } until ( $target == $no);

Thank you

A perl Script without 'strict' is like a House without Roof; Both are not Safe;

Replies are listed 'Best First'.
Re^2: Regarding Declaring Variables
by Tech77 (Novice) on Nov 17, 2005 at 15:40 UTC
    Thank you to vishi83 and GrandFather for the help! Also, to Delusional for the randomization. That's a little more advanced that where I am now, but I'll get there! Your explanations really helped me understand what's going on with my code!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509297]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-19 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found