Think about Loose Coupling | |
PerlMonks |
URL $ENV variablesby bodmin (Acolyte) |
on Aug 04, 2003 at 08:26 UTC ( [id://280596]=perlquestion: print w/replies, xml ) | Need Help?? |
bodmin has asked for the wisdom of the Perl Monks concerning the following question: Hi, If my url is http://www.perlmonks.com/index.pl?node=Seekers, I am trying to get my script name, i.e. index.pl. I use $ENV{REQUEST_URI} to get the current url. I have some params attached to the url which I access via $ENV{QUERY_STRING}. So in order to get index.pl (as in the example above) I use the following:
The above gives me index.pl?node=Seekers, half way there. To strip off ?node=Seekers I use the following:
And that is where my code breaks. How do I strip off the query string so I am left with index.pl?
Back to
Seekers of Perl Wisdom
|
|