Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Would you mind critiquing my script?

by dwm042 (Priest)
on Feb 24, 2014 at 20:50 UTC ( [id://1076034] : note . print w/replies, xml ) Need Help??

in reply to Would you mind critiquing my script?

1. You could improve readability by assigning those large directory strings to lexical variables.

my $target_dir = "/data2/jennb/landsat8/antarctica/$dir"; my $download_dir = "/data2/jennb/landsat8/downloads";

2. I agree with Laurent_R. Look at the POSIX module and try using those commands instead of system("this") and system("that") everywhere. chdir() is a perl built-in, iirc.

3. Consider seeing if your functionality repeats enough to convert some of your code into subroutine/function calls. The for loops with tars and jpegs looks like the first place to start. Long stretches of linear code is a sign that you're not really trying to break the task down by function.