how to save output of a command into a hash of arrays

Discussion in 'Perl' started by saapa, Jun 12, 2009.

  1. saapa


    Jun 12, 2009
    Likes Received:
    hi all,

    i am new to perl...
    i am trying to put the output of below command into a hash of arrays...

    `find $mypath ! -user mainuser -printf \"\%u \%h\\n\"`;

    this command gives output as

    john <somepath1>
    john <somepath2>
    john <somepath3>
    james <somepath4>
    james <somepath5>

    now what i want is to directly make an hash of arrays which stores :

    john --> <somepath1>

    james --> <somepath4>

    is this possible??
    thanks in advance for the help.
    saapa, Jun 12, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.