in reply to Array contents vanishing...why is this???

I cant figure out why this would cause the problem.

I think you're mistaking '' as being synonymous with () when initializing an array, when what you're really doing is setting the first element to be an empty string (ie, my @dirs = ( '' );), making @dirs non-empty but giving you the appearance of nothingness as you iterate over @dirs (at least once, anyway).

You might also want to read undef'ing @arrays caveat which covered a very similar issue.

    --k.


  • Comment on Re: Array contents vanishing...why is this???

Replies are listed 'Best First'.
Re: Re: Array contents vanishing...why is this???
by Osiron (Initiate) on May 30, 2002 at 15:02 UTC
    Thanx guys, i think there is something unstable about the rest of the script, i'm getting other problems too.
    There is nothing in menu() or title() except print statements so they cant be the problem.
    I'm also getting readline() on closed filehandle main::FILE errors when another option is chosen from the menu. It seems to be pasting the results of the last file read into the filename of the next file :-)
    looks like i've really messed this one up :-)