If we simply provide you modified code you are not learning Perl, you are simply learning to be a (falsely) lazy free loader. You will get your job done much faster by reading the documentation many people have suggested you read and doing the tasks, such as writing good questions and providing clean runable sample code (see my example above as an example). You are wasting both your time and our time by not doing some work for yourself. Show some effort as suggested by many people and we will bend over backwards to help you. Show no effort and both you and we will continue to be frustrated and no progress will be made.
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond