Another way to do the match, and I think this is preferred, would be to use a pattern match on the beginning of the string. Its also a good lesson in reg-expressions:
if ($value =~ m/^ab/i) {
print "The first two letters of $value are ab \n";
} else {
print "Doesn't begin with ab\n";
}
The "i" at the end checks regardless of case, if that is important to you, then remove it.
To do part two of your problem, we simply perform a split based on your value:
if ($value = m/^file/i) {
@line = split /=/, $value;
$file = $line[1];
} else {
# Do something else
}
Then perform the redirect as usual with CGI.pm or some other method you might have concocted, using the following:
"/cgi-bin/download.cgi?download=$file&dag=monday"
Let me know if this is too confusing.
------------------
Fred Hirsch
Web Consultant & Programmer