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

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

  1. saapa

    saapa

    Joined:
    Jun 12, 2009
    Messages:
    1
    Likes Received:
    0
    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>
    <sompath2>
    <somepath3>

    james --> <somepath4>
    <somepath5>

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

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mohit Mehral
    Replies:
    3
    Views:
    1,487
    Nigel Wade
    Mar 24, 2006
  2. Philipp
    Replies:
    21
    Views:
    1,629
    Philipp
    Jan 20, 2009
  3. rp
    Replies:
    1
    Views:
    919
    red floyd
    Nov 10, 2011
  4. Adam Akhtar
    Replies:
    5
    Views:
    891
    Adam Akhtar
    Mar 25, 2008
  5. Srijayanth Sridhar
    Replies:
    19
    Views:
    1,058
    David A. Black
    Jul 2, 2008
  6. Älphä Blüë

    Hash of Hash of Arrays Question

    Älphä Blüë, Jul 18, 2009, in forum: Ruby
    Replies:
    5
    Views:
    958
    Älphä Blüë
    Jul 18, 2009
  7. Tore Aursand
    Replies:
    3
    Views:
    801
    Anno Siegel
    Sep 16, 2003
  8. Lynn

    Accessing Hash of hash of arrays

    Lynn, Feb 14, 2005, in forum: Perl Misc
    Replies:
    9
    Views:
    792
    Alan J. Flavell
    Feb 16, 2005
Loading...