arunmep has asked for the wisdom of the Perl Monks concerning the following question:
Hi guys
I need to bypass a set of file with certain extension. Iam having those extension in a String file.
$exten=|\.txt|\.doc|\.xml...I am trying to do the following
if($filename=~/$exten/i) { print "Not bypassed"; }
but $exten is taken as a String variable rather than a regular expression how can i solve this problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to get the String as regularexpression
by davorg (Chancellor) on Oct 03, 2006 at 14:33 UTC | |
|
Re: how to get the String as regularexpression
by reneeb (Chaplain) on Oct 03, 2006 at 14:20 UTC | |
by davorg (Chancellor) on Oct 03, 2006 at 14:43 UTC | |
|
Re: how to get the String as regularexpression
by ptum (Priest) on Oct 03, 2006 at 14:24 UTC | |
by ikegami (Patriarch) on Oct 03, 2006 at 15:24 UTC | |
|
Re: how to get the String as regularexpression
by prasadbabu (Prior) on Oct 03, 2006 at 14:31 UTC | |
|
Re: how to get the String as regularexpression
by planetscape (Chancellor) on Oct 03, 2006 at 19:21 UTC |