Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. bichonfrise74

    piping previous command's output into perl

    Another way... #!/usr/bin/perl use strict; open( my $ls_output, '-|', 'ls' ) or die "Cannot execute ls - $!"; print "$_\n" while (<$ls_output>); close( $ls_output );
  2. bichonfrise74

    Combining hash values for like hashs.

    Try this... #!/usr/bin/perl use strict; my %record; while (my $line = <DATA>) { chomp $line; my ($quantity, $key) = $line =~ /\d+:\s\w+=(\d\.\d+)\s\,\w+=(\w+)\s+.*/; $quantity += $record{$key}->[0] if exists $record{$key}; @{ $record{$key} } = ( $quantity, $line ); } for my...
  3. bichonfrise74

    Combining hash values for like hashs.

    Can you show the actual output that you want?
  4. bichonfrise74

    understanding check between two files

    I'm not sure why you do not want to use the diff function. Anyway, here's a crude way of doing what you want. #!/usr/bin/perl use strict; my $file_1 =<<file_a; apple|1 banana|1 kiwi|3 file_a my $file_2 =<<file_b; banana|2 kiwi|3 strawberry|1 file_b my %record_1; open( my $file, '<'...

Part and Inventory Search

Back
Top