in reply to Re^5: Printing first and last line
in thread Printing first and last line

There will be 3 (ms) right as ms appears thrice so are you missing one in the one that you have put?

Replies are listed 'Best First'.
Re^7: Printing first and last line
by maheshkumar (Sexton) on Aug 14, 2012 at 16:22 UTC

    Can you advice something to read on the errors i keep on getting, like uninitialised or sometimes global variable and all

      It is useful to begin every script with:

      use strict; use warnings; use diagnostics;

      The diagnostics pragma puts extra information into warning messages, which can help in figuring what the warnings are really about.

      As a rule, concentrate on the first error or warning message and fix it. Often, this will fix the other warnings or errors too.

      Here are some helpful references:

      “Uninitialised” warnings generally mean your variables don’t contain the data you think they do. Get in the habit of printing out the contents of variables. Here is an easy way:

      use Data::Dumper; my %hash; # Fill %hash with data print Dumper(\%hash);

      Data::Dumper is a core module, so you have it already. See Data::Dumper for more information.

      That’s the best advice I can think of at the moment. Hope it helps,

      Athanasius <°(((><contra mundum