in reply to Filehandle in hash value gets lost

perhaps they go away when you "do some stuff." :)

a little more code might help.

Replies are listed 'Best First'.
Re: Re: Filehandle in hash value gets lost
by mr. jaggers (Sexton) on Dec 20, 2002 at 02:48 UTC
    :P sorry about that... actually it was stupid and I solved it myself five minutes after posting (I already said in a post that I'm an idiot...).

    Actually, I needed to:
    foreach (@files) { $_->{fh}->close; }
    and that basically took care of it, but it looks pretty ugly to me. But then again, I am just learning perl (my resident guru says I still "speak perl with a C accent"). ...sigh... Well, at least I'm trying!

      To make it look more pretty try:

      foreach my $file (@files) { $file->{fh}->close(); }

      Update: Changed close to close() to improve readability.

        Is that "better code" too? (stylistically, etc)
        To make it look more pretty...
        This is a matter of taste, and the basis of many flame wars.
        In short, if that's how he likes his code, let him do it.
        I for one like it his way.
        Changed close to close() to improve readability.
        And I suppose you'd change print; to print(); to improve readability?
        Anyway, close takes no arguments. I like to leave out unnecessary parens whenever possible, and I'm guessing other people do too.

        jdporter
        ...porque es dificil estar guapo y blanco.

      ah, it's all good.