jcpunk has asked for the wisdom of the Perl Monks concerning the following question:
I have this problem: I have got a web app but I need to run it from normal user accounts instead of the webroot. For example, instead of going to http://server.com/cgi-bin/app.pl the user must go to http://server.com/~username/cgi-bin/app.pl
Since this code will be migrated around a lot, to a lot of different kinds of systems, I need a good way of finding the username to put in the url (for linking to other pages in the app).
Thankfully, I have got two scalars from which this information can be extracted. I have one that holds the path to a directory in the user's cgi-bin directory and another that holds the path to a directory inside of the user's public_html (or whatever it is called) directory.
Finally, getting to the question at hand.
How would you extract "username" from these examples:
I haven't the slightest clue where to start beyond comparing the two strings and seeing where they differ, and removing those..... I am just really unsure.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching a string that you do not have any really good information about
by Belgarion (Chaplain) on Apr 20, 2004 at 21:45 UTC | |
|
Re: Matching a string that you do not have any really good information about
by saskaqueer (Friar) on Apr 20, 2004 at 22:33 UTC | |
|
Re: Matching a string that you do not have any really good information about
by shemp (Deacon) on Apr 20, 2004 at 22:41 UTC | |
|
Re: Matching a string that you do not have any really good information about
by TilRMan (Friar) on Apr 21, 2004 at 05:08 UTC | |
|
Re: Matching a string that you do not have any really good information about
by greenFox (Vicar) on Apr 21, 2004 at 07:24 UTC |