That regex won't capture files with UC letters
#!/usr/bin/perl use warnings; use strict; # 744661 my @var = [ 'foo.Bar', 'for.bar', ]; for my $var(@var) { if ( $var =~ /^(__[-!#.0-9@-Z_a-z]+)$/ ) { print "\$var: $var\n"; } else { print "no match!\n"; } }
If you're concerned about files like "foo.Bar", use the /i modifier.
In reply to Re^3: hard-to-understand taint error
by ww
in thread hard-to-understand taint error
by cmac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |