[ic] help pulling info from URL

Duncan McGreggor interchange-users@icdevgroup.org
Thu Oct 31 21:08:01 2002


Well, one of perl's mottos is that there's more than one way to do it...
here's one elementary way:

$last_url = '[data session last_url]';
@parts = split("/", $last_url);
# position 0 should be nothing
# position 1 should be "category"
# position 2 should be "posters"
# position 3 should be "p1.html"
$pstn2 = $parts[2];
$pstn3 = $parts[3];

This /should/ work (I didn't test it...)

Grant wrote:

 >I get a value like:
 >
 >/category/posters/p1.html
 >
 >from [data session last_url], and I need to be able to pull a couple 
pieces
 >of info from it.  I'm sure Perl could make it happen but I don't know 
which
 >way is up with that language.  Can someone show me how to get the value
 >"posters" and "p1" from a string like the above?  Thank you!
 >
 >- Grant
 >
 >_______________________________________________
 >interchange-users mailing list
 >interchange-users@icdevgroup.org
 >http://www.icdevgroup.org/mailman/listinfo/interchange-users
 >