| 1 | #!/usr/bin/perl -T |
| 2 | |
| 3 | # This script attempts to reproduce: |
| 4 | # https://sourceforge.net/tracker/index.php?func=detail&aid=1565180&group_id=6926&atid=106926 |
| 5 | |
| 6 | use strictscip-perl cpan Config-IniFiles 3.002000 strict/; |
| 7 | use warningsscip-perl cpan Config-IniFiles 3.002000 warnings/; |
| 8 | |
| 9 | use Test::Morescip-perl cpan Config-IniFiles 3.002000 Test/More/ tests => 2; |
| 10 | use File::Specscip-perl cpan Config-IniFiles 3.002000 File/Spec/; |
| 11 | use Scalar::Utilscip-perl cpan Config-IniFiles 3.002000 Scalar/Util/ qw(tainted); |
| 12 | |
| 13 | use Config::IniFilesscip-perl cpan Config-IniFiles 3.002000 Config/IniFiles/; |
| 14 | |
| 15 | my $filename = File::Spec->catfilescip-perl cpan Config-IniFiles 3.002000 File/Spec/catfile().( File::Spec->curdirscip-perl cpan Config-IniFiles 3.002000 File/Spec/curdir().(), "t", "array.ini", ); |
| 16 | |
| 17 | { |
| 18 | my $cfg = Config::IniFiles->newscip-perl cpan Config-IniFiles 3.002000 Config/IniFiles/new().( |
| 19 | -file => $filename, |
| 20 | -default => "Common", |
| 21 | -nocase => 1, |
| 22 | ); |
| 23 | |
| 24 | my @val = $cfg->valscip-perl cpan Config-IniFiles 3.002000 Config/IniFiles/val().( "Sect", "Par" ); |
| 25 | |
| 26 | # TEST |
| 27 | okscip-perl cpan Config-IniFiles 3.002000 main/ok().( !taintedscip-perl cpan Config-IniFiles 3.002000 main/tainted().( $val[0] ), "val[0] is not tainted" ); |
| 28 | |
| 29 | # TEST |
| 30 | okscip-perl cpan Config-IniFiles 3.002000 main/ok().( !taintedscip-perl cpan Config-IniFiles 3.002000 main/tainted().( $val[1] ), "val[1] is not tainted" ); |
| 31 | } |
| 32 |