shebang line: #!/usr/bin/env perl - this is dependable as all *nix systems should have /usr/bin/env and perl witll return the path for the env variable problem is perl flags: #!/usrl/local/perl -w does not work with the above ========================= glob foo.* is same as ls foo.* foreach my $file (glob "foo.*"){} ======================================= use FindBin qw($Bin); locates the path of the original script ======================================= keep contants close to where they are being used: ======================================= open (FH,...) FH is global.. that is BAD much better to use open(my $fh,...) ================================== 'redo' keyword in perl redoes the iteration ================================== qr// -- quotes the regex ================================== last 2 goes up two outer loops? ================================== while(.... my ($st,$pat) = each (%patterns)){ more effiicient than foreach( my $key (keys %patterns)){} ================================== Data::Dumper Data::Serializer -- does everything... gozer says ================================== use Benchmark Benchmark::cmpthese() Benchmark::timethese() ================================== my @foo = map{chomp; $_; } @bar #iterated through each @bar, and does something, and pushes on @foo more efficient than doing it yourself with your own loop example: my @multiples_of_2 = map{$_ * 2} @ints;