You can untaint $Bin in a BEGIN block.
#!/usr/bin/perl -T use warnings; use strict; use FindBin qw/$Bin/; BEGIN { if ($Bin =~ m!([\w\./]+)!) { $Bin = $1; } else { die "Bad directory $Bin\n"; } } use lib "$Bin/../lib"; use Data::Dumper; print "Hello!!\n";
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re^3: Variable use lib with taint (FindBin problem)
by davorg
in thread Variable use lib with taint (FindBin problem)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |