in reply to FindBin and Tainted
You can apply the usual untainting mantra by also using a BEGIN section:
use strict; use warnings; use FindBin 1.51 qw( $RealBin ); BEGIN { ($RealBin) = $RealBin =~ /(.+)/; } use lib "$RealBin/../lib"; use MyLib;
Of course, you need to trust your installation to not mess with the current working directory (because this is why $RealBin comes out tainted in the first place).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: FindBin and Tainted
by mikkoi (Beadle) on Aug 14, 2020 at 23:57 UTC | |
by haj (Vicar) on Aug 15, 2020 at 08:55 UTC | |
by mikkoi (Beadle) on Aug 15, 2020 at 20:18 UTC |