in reply to Re: Perl Hashes, keys under keys (I think)?
in thread Perl Hashes, keys under keys (I think)?


Sorry I just noticed they were curly-brackets and not square ones. Cool, this is what I get now:

$records{"$owner_record[1]"} = { USER => "$owner_record[5]", FILENAME => "$owner_record[0]", PID => "$owner_record[6]", TIME => "$owner_record[9]", DATE => (join ":", "$owner_record[10] $owner_record[11]"), + ELAPSED => [] }; ___OUTPUT___ $VAR1 = { '999?SheetMusic' => { 'PID' => '5151515', 'TIME' => '10:51:00', 'DATE' => 'Sep 16', 'ELAPSED' => [], 'FILENAME' => '/ud/NEW-PrOdUcTs/NWA', 'USER' => 'bill' }, '667!NEWPRODUCT' => { 'PID' => '5555555', 'TIME' => '10:25:00', 'DATE' => 'Sep 16', 'ELAPSED' => [], 'FILENAME' => '/ud/QC-PROD/NWO', 'USER' => 'matthew' }, '001!SCHEDULE' => { 'PID' => '5005444', 'TIME' => '10:50:44', 'DATE' => 'Sep 16', 'ELAPSED' => [], 'FILENAME' => '/ud/QC-DATA/CONTROL', 'USER' => 'richard' } };

Awesome, thanks for your help!

What is the difference between using curly-brackets there and square-brackets?


Thanks,
Matt

Replies are listed 'Best First'.
Re^3: Perl Hashes, keys under keys (I think)?
by AnomalousMonk (Archbishop) on Sep 19, 2011 at 17:04 UTC
    What is the difference between using curly-brackets there and square-brackets?

    In this context, curly brackets are the anonymous hash 'composer' (to use the terminology of perlref), square brackets are the anonymous array composer. See Making References items 3 and 2, respectively, in perlref.

    Update: Maybe one should say "the anonymous { hash => 'composer' } and the anonymous [ qw(array composer) ]".


      AnomalousMonk,

      Hey thanks for the reply. You know what, now that you say that I do remember seeing that. Thanks!


      Thanks Again,
      Matt
Re^3: Perl Hashes, keys under keys (I think)?
by duyet (Friar) on Sep 19, 2011 at 15:57 UTC
    you got it!