Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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.

David

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1076034]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2025-06-21 14:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.