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

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Use of uninitialized value in numeric comparison (<=>) error
by japhy (Canon) on Apr 12, 2006 at 13:25 UTC
    In addition, I would suggest changing [ $_, [stat]->[10], [stat]->[9] ] to [$_, (stat)[10,9]], as it a) saves a call to stat(), and b) uses a list slice rather than two anonymous array refs.

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
Re: Use of uninitialized value in numeric comparison (<=>) error
by McDarren (Abbot) on Apr 12, 2006 at 13:06 UTC
    #!/usr/bin/perl -w use strict; use Data::Dumper::Simple; # Your code goes here print Dumper(@files);
    I'd say that there is a very good chance that the output of that will give you your answer.
Re: Use of uninitialized value in numeric comparison (<=>) error
by davidrw (Prior) on Apr 12, 2006 at 13:07 UTC
    can you use Data::Dumper to see which is the offending file? I guess it means that there's a file where the mtime or ctime is empty... (Update {after reading McDarren's reply} Probably see that one of the elements in @files is undef OR one of the elements in @files is a file that does not exist/can't be stat'd)
    use Data::Dumper; print Dumper [ map { [ $_, [stat]->[10], [stat]->[9] ] } @files ];
    Also note that while it said "line 54", lines 54,55,56 (which has the <=>),57 are all the same statement.
    A reply falls below the community's threshold of quality. You may see it by logging in.