in reply to shellscript to Perl

"Put quotes around any strings"

'Put quotes around any strings'

Before you try converting a program, read about the basic syntax, at minimum perlintro.

There is also Tutorials , Learn Perl in about 2 hours 30 minutes, http://learn.perl.org/books/beginning-perl/, Modern Perl