in reply to home work help

You have (or someone has) obviously put a lot of work into this thus far if you've written all that perl code. That said, did they say you have to use perl at all?

From the requirements you specified "allow up to 3 unix commands to be piped together and executed" it sounds like you want something more like this:

cat /etc/passwd | grep 'yourusername' | gzip > me.gz

Where we're "piping a bunch of unix commands together" to create a gzip of all the users in the passwd file that match 'yourusername'.