Hello Monks :D,

OK, I'm parsing a log file, to match specific lines for billing. Each line has six values (date/time, IP, user name, user id, id number, and message). Each element is tab delimited.

So, my question would be if I store each line into an array, is it going to store six elements per line because of the tab delimiters, or will each line be an element?, as that is how I'm assigning it:

push(@array, $line)

I know this is a basic question, **ducks to avoid the llama book flying at head**, but I've been stuck in web development for a while, so I just don't remember and I searched this question and I all seem to get is documents on split.

UPDATE:

As long as I'm asking ridiculous questions, might as well include them all together, so I'm looking through the indexes of O'Reilly's books (I have on CD), and I'm seeing passing variables to subroutines as strings:

&sub($foo, $bar)

If I passed an array to &sub, would it be put into the @_ by element, as $foo and $bar would, or will it all end up in $_[0]?


"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.." -- George Bernard Shaw


In reply to Push a tab-delimited line into an array by koolgirl

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.