in reply to Re^4: How to fetch the value of unix command result
in thread How to fetch the value of unix command result

Hi Expert,

I have used your code and tested and i found the below output

code

#!/usr/bin/env perl use warnings; use strict; use IO::Zlib; my $fh = IO::Zlib->new('test.txt.gz', 'rb') or die "Zlib failed: $!"; my %count; $count{$_}++ for map { (split /\|/)[2] } <$fh>; printf "%-10s %4d\n", $_, $count{$_} for sort keys %count;

The output which i got

<ocde> CHECK 7 KCEHC 4 </code>

Can i store them separately in $c and $c1 ? how can i print them individualy, how can i assign 4 to $c1 and 7 to $c1, please explain

Replies are listed 'Best First'.
Re^6: How to fetch the value of unix command result
by poj (Abbot) on Jun 30, 2013 at 13:42 UTC
    how can i assign 4 to $c1 and 7 to $c1

    Are you sure you mean that, or should one of those $c1s be $c ?

    poj
      Hi Expert,

      I mean 4 should be assigned to $c and 7 should be assigned to $c1

      Thanks

        $c = $count{'KCEHC'}; #4 $c1 = $count{'CHECK'}; #7
        poj