Thank you, fellow monks!

strict is now applied and all is working well. It took a little time but also highlighted a few not so obvious errors. Your responses also gave me some good tips and left me with a couple of questions.

What's the difference between these two lines of code and why use the first when the second will work?

(my $timestamp,my $page,my $userURL,etc) = split('\|',$line); my ($timestamp,$page,$userURL,etc) = split('\|',$line); # which is muc +h cleaner.
Not everyone would endorse this form of list initialisation BrowserUk
my ($var1,$var2,$var3) = ('','',''); my ($var4,$var5,$var6);
This seems like a easy, clean way to initilize. Any comments? Also, can variables be declared as in the second line?

BTW, that looks like you're doing a test on an uninitialized array element (graff)
You're right!
So!! Another good tip on an in-line initilizing technique. (BrowserUk)

my %hits for (....) { .. $hits{$page} = [0,0,0,0] unless exists $hits{$page}; $hits($page}[0]++; .. }
I see this piece of code. (Notromda).
Could this also be written as on line 2 and what's the difference?
print $pages{"page1"}->[1]; print $pages{"page1'}[1];

In reply to Re: Problems with 'strict' and variables created on the fly by nedals
in thread Problems with 'strict' and variables created on the fly by nedals

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.