You know, I wish that I were a better programmer, so that I could be more succinct, but since Perl is very new to me, I do the best that I can, and try and learn from you folks. To answer your questions: @ARGV is set on the command line using the following syntax:
merge.pl file_1 a,b,c file_2 d,e,f
where "a,"b",c" and "d,"e",f" are column headers. Columns are defined in the files as such:
#DFD ' ' #H Period Interface SrcRouter Subset MbitsCap Polls MbpsIn MbpsOut MbpsSum InMinUtil In5pUtil InAvgUtil In95pUtil InMaxUtil InUtilSD InMaxTS OutMinUtil Out5pUtil OutAvgUtil Out95pUtil OutMaxUtil OutUtilSD OutMaxTS EffMinUtil Eff5pUtil EffAvgUtil Eff95pUtil EffMaxUtil EffUtilSD EffMaxTS Class InPctDiscards InPctErrors InPctDiscErr InPctDiscErr95Q OutPctDiscards OutPctErrors OutPctDiscErr OutPctDiscErr95Q SecSysUpTime InWrapEvts InWrapCnts OutWrapEvts OutWrapCnts PctPollsGT80pUtil PctPollsGT1pDiscErr Flags KppsIn KppsOut IfDescr IfIndex #F %-17s %-35s %-15s %-6s %9.5f %7d %14.3f %14.3f %14.3f %7.3f %7.3f %7.3f %7.3f %7.3f %9.5f %14s %7.3f %7.3f %7.3f %7.3f %7.3f %9.5f %14s %7.3f %7.3f %7.3f %7.3f %7.3f %9.5f %14s %3s %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f %10d %7d %7d %7d %7d %7.3f %7.3f %-10s %14.3f %14.3f %-30s %-10s
Specifically, what I want to do is: From file_1:
create a hash whose keys are any of the headers specified on the command line. Each key value is a reference to an array containing the data from each column.
From file_2:
create another hash whose keys are any of the headers specified on the command line. Each key value is a reference to an array containing the data from each column.
NOTE: There will ALWAYS be matching data between both files, but NOT necessarily under the same header label! For example:
the column "SrcRtr" from file_1 contains the exact same data as the column "DstDev" in file_2
After assembling these data structures, I want to merge them, in structured format, and print the resulting merged file to <STDOUT>. I'm not sure if this is any clearer, but please let me know if it's not.

In reply to Re: @ARGV Manipulation by Limo
in thread @ARGV Manipulation by Limo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.