Hello,

I have a list of html-page-creating cgi scripts, which is being
randomly accessed. Once my random selection of the script has been
made, I need to be able to access the middle part of the script name to
use this part to complete the path to an html page that needs to be
called by the selected cgi-script (which is creating a frameset).

I've tried to do this with a regex, but my regex isn't doing it. Here's
my code:

##############################

#!/usr/local/bin/perl5
use CGI qw(:standard);                  

#make array of cgi-scripts:
@Scripts=("f-aaaa.cgi", "f-bbbbbb.cgi", "f-cccc.cgi", "f-dddd.cgi",
"f-eeeeee.cgi", "f-ffffff.cgi");

# pick one at random
srand;
$RandomScript = $Scripts[int(rand(@Scripts))];

#here's the non-working regex:
$ScriptName =~ s/$RandomScript/\w{3,}\b/;

$RandomScriptURL = "path/".$ScriptName.".htm";

##################################

Everything here is working except my attempt at a regex. I'm trying to
get rid of "f-" at the begining and the ".cgi" at the end. I thought
\w{3,}\b would get me the first block of word characters that came in a
set of three or more until the end of the word. I'm getting nothing at
all from this and am not sure what I'm missing.

Any help much appreciated.

Rohesia

=====
Rohesia Hamilton Metcalfe

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to