As for hippo, your first case of "^audit" works for me. Could you show the contents of @dir_files using Data::Dumper?
In the second case, note that "\Aaudit" produces the warning "Unrecognized escape \A passed through" (you have warnings turned on, right?). This is because in a double-quoted string, \A doesn't have a meaning. In general, this can be fixed by using qr// to precompile your regexes, as in my $pattern = qr/\Aaudit/;.
However, since you say this is user input, if the user is inputting \Aaudit, then your string will actually be "\\Aaudit" in Perl syntax, which should work, but if it's not, you need to show us code that is more representative of what you're doing for us to be able to see what's wrong, otherwise we're just guessing.
For example, are you chomping your user's input? Use Data::Dumper with $Data::Dumper::Useqq=1; to look at $pattern (and show us that, too).
In reply to Re: Perl Regex \A or ^ Not Working
by haukex
in thread Perl Regex \A or ^ Not Working
by thundercat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |