Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Perl (http://www.programmingforums.org/forum21.html)
-   -   Strange (http://www.programmingforums.org/showthread.php?t=7452)

ProjectX Dec 8th, 2005 1:10 PM

Strange
 
Ok so i was bored and I just started playing around with loops in perl so I did this first
:

#!C:/PERL/BIN/perl.exe -w

for($i = 0; $i < 50; $i++){
        print ":: $i\n";
}

so then i tried this
:

#!C:/PERL/BIN/perl.exe -w

for($i = 0; $i < 50; $i++){
        print ":: $i\n";
}
if($i == 50){
    print ":: Begining the second loop...\n\n";
    sleep(3);
    for($me = 0x00; $me < 0xff; $me++){
    print "~ $me\n";
  }
}

and then I get ... you have to run it because its too long.
can anyone tell me why I got numbers instead of 0xff or something like that.

Polyphemus_ Dec 8th, 2005 1:20 PM

0xFF IS a number, with base 16 instead of base 10. You don't tell Perl to print it using base 16 instead of base 10.

ProjectX Dec 8th, 2005 1:24 PM

oh ok. thanks alot


All times are GMT -5. The time now is 11:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC