Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.


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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2022-11-28 11:18 GMT
Find Nodes?
    Voting Booth?