stuck and it's been awhile since I touched it
I have a little program that generates links like this:
blahblah.url/cgi-bin/program.pl?someimg.gif
Now what I want to do in the program.pl is have it match someimg.gif to the existing flat database (at the moment just like the example I had before with whatever|something|someimg.gif| et cetera).
I keep running into problems with the matching. I think it's the .gif part. But I don't know.
The rest is done (lord help me) except for this one MAJOR little detail.
Can anyone help or point me in a better direction than pattern matching?
Suzanne
------------------
Zero Cattle
Suzanne
Tables DeMystified
Rob Pengelly posted this at 21:43 — 13th May 2000.
They have: 850 posts
Joined: Jul 1999
http://www.thehungersite.com - http://www.therainforestsite.com
http://www.ratemymullet.com - Beauty is only mullet deep.
Suzanne posted this at 22:04 — 13th May 2000.
She has: 5,507 posts
Joined: Feb 2000
Yes, that does help, thanks!
$lookfor in this case would be $ENV{QUERY_STRING}?
What I need to do is where you have print... in the if statement, is have a new variable set there.
So if the name is found (which it will be if they just click on the link, because the name is generated), then the item's location will be returned?
$lookfor = $array[$number][0]
I think I am coming at this the wrong way.
Hmmm.
Thanks for the response, I am going to go off and mutter to myself for awhile.
Suzanne
anti posted this at 23:52 — 13th May 2000.
They have: 453 posts
Joined: Jan 1999
Hi,
why don't you use a hash ?
If you setup like this:
$array{ "wathever" } = "http://wherever/here.html";
.
.
.
Then you can just use:
print "Location: ".( $array{ $ENV{QUERY_STRING} } )." \n\n";
I'm not sure that this is what you want, but it works for me.
ciao
Anti
Suzanne posted this at 00:04 — 14th May 2000.
She has: 5,507 posts
Joined: Feb 2000
I think that you are right -- at least that's what the Perl Cookbook asks when it tries to tell me how to do with without a hash.
*sigh*
I would be doing it that way, but I'm not up to that lesson yet. Guess it's back to the books for a moment.
Thanks very much for taking the time to drill commonsense into my head!
Suzanne
------------------
Zero Cattle
Suzanne
Tables DeMystified
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.