View Single Post
Old 02-11-2013, 10:31 PM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Use a split

Simpler to use a split; "\?"
Code:
#!/usr/bin/perl

use strict;
use warnings;


my $URLstring = "http://gallys.40somethingmag.com/images/BettyBlaze_28866/?nats=XXXXXXXXXXXXX";

our @url = split  /\?/, $URLstring;

print $url[0] ."\n";

exit;
#output
#12:24 AM barry@server:~/Desktop$ ./split.cgi
#http://gallys.40somethingmag.com/images/BettyBlaze_28866/
or regex then just substr 0, -1 ( in perl chop $url[0];)

Last edited by Barry-xlovecam; 02-11-2013 at 10:35 PM..
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook