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:
Random number in url

 



Gregorio
User

Sep 9, 2000, 1:24 PM

Post #1 of 2 (254 views)
Random number in url Can't Post

I'm trying to add a number to a url but i keep getting a dash in it:
the code i use is:

my $randnumber;
$randnumber = sprintf "%07d", 1 + rand 9999999999;

then in the url i put: http://www.site.com/BF302$randnumber

instead of getting: http://www.site.com/BF3029999999999

i get: http://www.site.com/BF302-9999999999

how do i get rid of the dash?


perlkid
stranger

Sep 10, 2000, 12:29 AM

Post #2 of 2 (254 views)
Re: Random number in url [In reply to] Can't Post

 
Try this.

$randnumber =~ s!-!!g;

perlkid

 
 


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

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