in reply to FindBin and taint mode

I stopped using FindBin long ago, after reading FindBin is broken (RE: How do I get the full path to the script executing?). Perhaps that would be a better solution.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: FindBin and taint mode
by szabgab (Priest) on Nov 21, 2006 at 17:56 UTC
    If I understand you suggest to use rel2abs of File::Spec. As far as my understanding goes it is still tainted so while it might be better than FindBin (see the other node) but it still does not solve my problem.
    #!/usr/bin/perl -T use strict; use warnings; use File::Spec (); use File::Basename (); my $path; BEGIN { $path = File::Basename::dirname(File::Spec->rel2abs($0)); if ($path =~ /(.*)/) { $path = $1; } } use lib File::Spec->catdir($path, '..', 'lib'); use CGI; print CGI->new->header;