I am fairly new to perl, so this is probably looks like a silly question:
I am trying to write text to a file as specified by the query string
environment variable. Since the file names are all numbers, I'm using a
regex to strip anything other than a digit from the variable, and assign the
new value to a variable. I've R-ed a few different FM's for the way to do
this, and it says to use the regex memory value, which isn't tainted. When
I try this using my current regex it leaves the $1 variable undefined. Code
snipet:
@temp = split(/=/, $ENV{'QUERY_STRING'});
$temp[0] =~ s/([^0-9])//g;
$filename = $1;
I made a sort of mini-debug function that prints out each variable. It
prints the unprocessed query string after spliting and the value of $temp[0]
after processing (which is all numbers) correctly, but the variable
$filename doesn't have a value... Not sure where I went wrong with this...
Unless the $1 is null because the matched pattern is deleted... or does the $1 hold
the return value?
TIA,
Reactor