in reply to Re^2: hard-to-understand taint error
in thread hard-to-understand taint error
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: hard-to-understand taint error
by ikegami (Patriarch) on Feb 18, 2009 at 14:27 UTC | |
by ww (Archbishop) on Feb 18, 2009 at 15:56 UTC | |
by ikegami (Patriarch) on Feb 18, 2009 at 16:19 UTC |