#!/usr/bin/perl use strict; use warnings; # Parse Gaussian '03 output files for the lengths of the bonds in # Diaminopolymethine Dyes strictly between Carbon and Nitrogen or Carbon and # Carbon chomp (my $infile = <>); chomp (my $outfile = <>); open FILE, '<', $infile or die "Unable to open $infile: $!"; my @inlog = grep {/\d/ && ! /[a-zA-Z]/ && $_ >= 1} map {split (/\s/, $_)} grep {!/h|c{3}?|nc{2}?|(estimate)|c{2}?n{1}?/} grep {/^\s?!{1}?\s*(c|n)/} ; close FILE; open LOG, '>', $outfile or die "Unable to create $outfile: $!"; print LOG join "\n", @inlog; close LOG; #### @array = (); #### @array = ; #### my $var1; my $var2;