[ic] help pulling info from URL

Stefan Hornburg interchange-users@icdevgroup.org
Fri Nov 1 06:24:01 2002


On Thu, 31 Oct 2002 21:08:54 -0500
Duncan McGreggor <oubiwann@myrealbox.com> wrote:

> 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];

And here a shorter way to do it (also untested):

($pstn2, $pstn3) = (split("/", $Session->{last_url})[2,3];

Ciao
        Racke