afmook
10-18-2005, 09:03 AM
Looked online a bit... These things are so confusing.
I'm making a cgi script that will process other files. IE you pass a "page" var to it and it'll open that page, run through and find whatever I want, translate stuff and spit it back.
One of the things I want to fix is that the images aren't displaying because they aren't in the CGI directory. I don't want to have to enter huge url's for each image, nor clutter the cgi-bin, so I figured I'd run a quick translation.
The problem is that it's not quite working as expected.
if ($z =~ m/src=\".+\.(jpg|jpeg|gif|bmp)\"/) {
I'm using this to find any *.jpg, *.gif, etc. And that part works, but what I need is a way to reference the * part, the actual filename without the extension.
I thought you could do $1 for it, but that gives me "gif" or whatever the second part is. Figuring I screwed up I tried $0 but that gives me the cgi script's name.
How do you reference those properly?
Thx a bunch.
I'm making a cgi script that will process other files. IE you pass a "page" var to it and it'll open that page, run through and find whatever I want, translate stuff and spit it back.
One of the things I want to fix is that the images aren't displaying because they aren't in the CGI directory. I don't want to have to enter huge url's for each image, nor clutter the cgi-bin, so I figured I'd run a quick translation.
The problem is that it's not quite working as expected.
if ($z =~ m/src=\".+\.(jpg|jpeg|gif|bmp)\"/) {
I'm using this to find any *.jpg, *.gif, etc. And that part works, but what I need is a way to reference the * part, the actual filename without the extension.
I thought you could do $1 for it, but that gives me "gif" or whatever the second part is. Figuring I screwed up I tried $0 but that gives me the cgi script's name.
How do you reference those properly?
Thx a bunch.