samaniac has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Please help
by marto (Cardinal) on Nov 26, 2010 at 11:04 UTC

      Will do, sorry I didn't read it before posting.

Re: Please help
by fisher (Priest) on Nov 26, 2010 at 10:58 UTC
    print: "Before: @array \n";
    You have extra ':' after 'print'.
Re: Please help
by afoken (Chancellor) on Nov 26, 2010 at 11:00 UTC
    print: "Before: @array \n"

    ... is read as a label named print, followed by a string constant. Get rid of the colon after print.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Please help
by lidden (Curate) on Nov 26, 2010 at 10:58 UTC
    Your first print has a colon before the string.
Re: Please help
by Anonymous Monk on Nov 26, 2010 at 11:03 UTC
    print:is a statement LABEL: not a call of function print

    Somehow I think using a built-in function name as a label should cause a warnings, but this is the first time I've seen it in 10 years.

Re: Please help
by TomDLux (Vicar) on Nov 26, 2010 at 18:22 UTC

    Sometimes Perl won't provide a warning, and emacs highlighting doesn't show anything useful ... or I'm being stupid and not seeing the problem. Using perltidy and perlcritic can provide some extra information.

    Particularly useful when I mess up matching braces while editing old code, or lose track of my string delimiters.

    As Occam said: Entia non sunt multiplicanda praeter necessitatem.

Re: Please help
by samaniac (Initiate) on Nov 26, 2010 at 11:49 UTC

    Thanks guys, I knew it was something stupid I just couldn't find it! Again, thanks for all your help and quick responses.

      I know that it's often helpful to get another set of eyes to look over your code but if you don't already, consider using an editor which supports Syntax highlighting.