in reply to Noob could use advice on simplification & optimization

Nothing important to say, except bravo! :)

Anyway some advice you could follow if you really insist :) (I can't test your script)

use strict; use warnings;

'for' loops: try the perlish syntax

for(my $i = $#data; $i > 0; $i--) { if ($data[$i] =~ /\|/) { $last_line = $data[$i]; $i=0; # correct line found, exit loop. } } # or # for my $line (reverse @data) { $last_line = $line; last if $line =~ /\|/; }

line 70 - you don't need @result:

( $directory, $search_string, ..., $scan_down...) = split('|',$last_line);

line 136: you could use 'join':

print SAVED_SEARCH (join '|', $directory, $search_string, ..., $scan_down..., "\n");

Replies are listed 'Best First'.
Re^2: Noob could use advice on simplification & optimization
by bgreg (Initiate) on May 03, 2012 at 21:54 UTC
    Cool, thanks for the response. I'll definitely make these changes. Using strict is going to be a challenge for me, this code isn't organized for that right now.