in reply to perl and omshell for dhcpd status

I tried searching for the correct way to do it but couldn't wrap my head around the examples I've looked at.

You don't say which examples those are so it's impossible for someone else to explain them to you. It also means that we don't know whether or not you have read the relevant FAQ: How can I open a pipe both to and from a command? which itself refers to the pertinent sections of perlipc among other sources of info.

If you could refer to the precise examples which are confusing you then maybe someone here would be able explain them.