You've got:
if($array[$i] =~ /$ .pst/)
This will never match anything. The "$" matches the end of the string. So what you're trying to match is the end of the string, followed by five characters. Clearly you can't have characters after the end of the string!
What you want is:
if($array[$i] =~ /\.(pst|prj)$/)
This matches a literal full stop character, then either "pst" or "prj", and then the end of the string.
In reply to Re: Or condition in Perl
by tobyink
in thread Or condition in Perl
by rajkrishna89
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |