in reply to references hashes arrays fun ... again :-(

Well, for one thing, you don't need all those single quotes in the hash accesses, because hash accesses allow for unquoted barewords -- they get quoted automatically, after a fashion -- unless there are characters in it that look like an expression, e.g. + ! @ $ / ... Also, you might want to localize CONST (local *CONST;), because otherwise you're using a global filehandle from a subroutine, which is generally considered bad practice. The return is happening before the close, so the close never occurs. Where is @timing_paths declared (are you using strict?)? And why do you need [$i++] when there's push around?

Just my \$0.02...

Update: Why are you assigning [] to an array? [] is an array reference. That means your array will have one item, a reference to an array with no elements. I'm not sure this is what you want...

Replies are listed 'Best First'.
Re: Re: references hashes arrays fun ... again :-(
by diarmuid (Beadle) on Aug 09, 2001 at 19:45 UTC
    I will localize CONST
    @timing_paths is defined outside the subroutine. I am using strict.

      @timing_paths is defined outside the subroutine.
      I hope you have a very good reason for that usage of a global variable ... I can't see any from your snippet.

      -- Hofmator