CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [davorg] Problem with rand() function: Edit Log



abuschr
Novice

Aug 20, 2002, 4:48 AM


Views: 2207
Re: [davorg] Problem with rand() function

Here's a part of my code:


Code
    

my $d = HTTP::Daemon->new(LocalPort => $PORT) or die;

# Getting the calls from the form.
while (my $c = $d->accept) {
if (my $r = $c->get_request) {

....
....
....

# I do not want to get zero in the random number
while($Rand_Num == 0) {
$Rand_Num = rand 256;
}
$KEY = chr($Rand_Num);
# Encrypting ...
my $KeyStr = $KEY x length($Msg);
$Msg = $Msg ^ $KeyStr;
....
....
....



(This post was edited by abuschr on Aug 20, 2002, 5:12 AM)


Edit Log:
Post edited by abuschr (Novice) on Aug 20, 2002, 5:12 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives