Hi,
I need some quick help with a Perl program that I didn't write that I have to debug. Here is the statement...
Assume $file = myfile.txt.2105
($name, $path, $id) = fileparse($file, '\.2|.0\d+');
When it gets to fileparse, here are the results...
name=myfile.txt.2
path=./
id=105
The problem is that I need it to consider 2105 as the id, not just 105.
My thought is that the '\.2|.0\' part means, any suffix starting with a ".2" or ".0" and that \d+ means find any number of digits after that.
So, what's wrong?
Thanks.
-Tyler
I need some quick help with a Perl program that I didn't write that I have to debug. Here is the statement...
Assume $file = myfile.txt.2105
($name, $path, $id) = fileparse($file, '\.2|.0\d+');
When it gets to fileparse, here are the results...
name=myfile.txt.2
path=./
id=105
The problem is that I need it to consider 2105 as the id, not just 105.
My thought is that the '\.2|.0\' part means, any suffix starting with a ".2" or ".0" and that \d+ means find any number of digits after that.
So, what's wrong?
Thanks.
-Tyler