Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Debugging a module that's failing under taint mode

by GrandFather (Saint)
on Jul 01, 2021 at 21:26 UTC ( #11134556=note: print w/replies, xml ) Need Help??


in reply to Debugging a module that's failing under taint mode

Is there some reason you can't run the code under the debugger or, even better, use an IDE such as Komodo? You can require the module instead of useing it so you can debug the load process.

But really, you need to untaint $RealBin. Something like:

BEGIN { use FindBin qw($RealBin); my ($cleanPath) = $RealBin =~ m/(some sane path match here)/; use lib $FindBin::Bin; }
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Replies are listed 'Best First'.
Re^2: Debugging a module that's failing under taint mode
by Bod (Curate) on Jul 01, 2021 at 22:45 UTC
    Is there some reason you can't run the code under the debugger or, even better, use an IDE such as Komodo?

    I can't use an IDE as this is running on shared hosting.

    Having never used the Perl debugger, I would not know where to start or how to use the information it gave me. Perhaps I should look at it.

      "I can't use an IDE as this is running on shared hosting."

      Of course you can use an IDE. There are several ways you can go about it depending on the IDE, but at least you can copy the code to your local machine mocking up parts of the system as needed. At best your IDE can connect to a remote system and let you debug the code running on that system. Using a good IDE for debugging is vastly more productive than any other technique.

      While not as good as an IDE, the Perl debugger allows you to place breakpoints to pause execution while you inspect the state of variables. You can then trace through code one statement at a time to see where execution really goes. See perldebtut. If you do any significant amount of coding the time spent to use a debugger will be paid back in time saved many times over!

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11134556]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2021-10-22 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?