xzatech has asked for the wisdom of the Perl Monks concerning the following question:
I hope my question is a simple one for you, for me it has been not. if you have the time the % in perl what is it doing insomething like this $number %2 == 1
i used it in the following but want to understand what it is actually doingas I have read theres no s for string no g for floating point no d for decimal so by itself what is it doing and how is it making this work .. no where have i found info on % by itself with a number .#!/usr/bin/perl print "\tPick a number\n"; $number = <>; if($number %2 == 1){ print "That was a odd number\n"} else { print "That was a even number\n"} exit
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: % in perl
by boblawblah (Scribe) on Feb 10, 2009 at 22:23 UTC | |
|
Re: % in perl
by jdporter (Paladin) on Feb 10, 2009 at 21:44 UTC | |
|
Re: % in perl
by syphilis (Archbishop) on Feb 10, 2009 at 23:53 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |