http://qs1969.pair.com?node_id=584628


in reply to Re: Sorting files you Have read
in thread Sorting files you Have read

Hey swampyankee, thank you, but when I run the script, I get the following

Global symbol "@unsorted" requires explicit package name at one-c.pl line 6.
Global symbol "@unsorted" requires explicit package name at one-c.pl line 7.
Global symbol "@sorted" requires explicit package name at one-c.pl line 10.
Global symbol "@unsorted" requires explicit package name at one-c.pl line 10.
Execution of one-c.pl aborted due to compilation errors.

I am on an XP machine, if that has any bearing, but would there be something else amiss with my installation?

The reason i ask is my first responder suggested some code and that looked like it ran successfully, but did not translate any result to the screen or a file.
Now your code returns errors... hmm

Any other thoughts?

Replies are listed 'Best First'.
Re^3: Sorting files you Have read
by swampyankee (Parson) on Nov 16, 2006 at 23:36 UTC

    I cleverly forgot to declare @unsorted and @sorted. This is why one should (a) test code before posting and (b) use strict; and use warnings;.

    They do wonders to prevent things like:

    @array = (1,2,3,4,5,6,7,8,9); $sum+= $_ foreach @array; $mean = $sum/scalar(@aray);

    (Yes, I know scalar(@aray) is 0.)

    emc

    At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.

    —Igor Sikorsky, reported in AOPA Pilot magazine February 2003.