How to run an script and its commands via proxy?

Hi,

i used this tutorial which tells me to use following example command to proxify traffic from my linux

export {http,https,ftp}_proxy=122.228.156.126:80

when i do this command from command line it works and then i curl http://site/ipcheck.php i see its proxified, which is what i want to achieve.

BUT, i have bash script in which i execute that command.. but from mentioned bash script im then executing another perl script and I want to ask how to make sure commands in that perl script goes via proxy too, without editting that perl script.

Because i see that the traffic initiated by that perl script not goes via proxy :frowning:

thank you

Post an example of commands from perl script.

that perl script is too complicated and big

No I didn't mean the entire script just a section showing what you are trying to do(i.e. run a shell command, write to a port, read, etc...).

I believe you can use(IO::Socket::socks::Wrapper), and check out this info:
HTTP(S) request from Perl over proxy with IO::Socket only - Stack Overflow
Re: https / proxy problem (LWP::UserAgent)
About LWP::UserAgent, https and proxy setup | Ddumont's Blog

Im sorry, im not a perl programmer so i actually dont understand functions of the perl script. I just ask how to run whole perl script thru proxy in linux, or if you find any function in that perl script, please mention how i can make it run thru the proxy.