Thank you for replying! I assume that I would be needing to use this part in the link you sent me:
open(PASSWD, '/etc/passwd'); while (<PASSWD>) { chomp; ($login, $passwd, $uid, $gid,$gcos, $home, $shell) = split(/:/); #... }

What exactly is the first line doing? The while is reading through the file at the directory /etc/passwd ?

For my purposes would I write

open READINGFILE, "data.txt" or die $!; open LOGFILE, ">>logfile.txt" or die $!; while (<READINGFILE>) { chomp; ($domain, $IP) = split(/,/); if ($ip_obj->{src_ip} eq $IP){ print LOGFILE $domain; print LOGFILE " has been found"; } }

Right now I'm getting errors:

Global symbol "$domain" requires explicit package name at test.pl line + 113. Global symbol "$IP" requires explicit package name at test.pl line 113 +. Global symbol "$IP" requires explicit package name at test.pl line 114 +. Global symbol "$domain" requires explicit package name at test.pl line + 115. BEGIN not safe after errors--compilation aborted at test.pl line 235 ( +#1) (F) You've said "use strict" or "use strict vars", which indicates that all variables must either be lexically scoped (using "my" or +"state"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::"). Uncaught exception from user code: Global symbol "$domain" requires explicit package name at test +.pl line 1 13. Global symbol "$IP" requires explicit package name at test.pl line 113 +. Global symbol "$IP" requires explicit package name at test.pl line 114 +. Global symbol "$domain" requires explicit package name at test.pl line + 115. BEGIN not safe after errors--compilation aborted at test.pl line 235. at test.pl line 235

What am I missing?

And yes I have several files at various steps in the process to make sure I don't take steps backwards, thanks for the advice though and the link is a good reference but I need it a little more... dumbed down for me to understand. lol.


In reply to Re^2: To Split or Not to Split by burningredmoon
in thread To Split or Not to Split by burningredmoon

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.