logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: drieux's $def{fh} question: msg#01798

Subject: Re: drieux's $def{fh} question

On Friday, June 28, 2002, at 10:49 , Jeff 'japhy' Pinyan wrote:

Sorry, I deleted it by mistake, and I'm too lazy to get it back.

The reason is that <FH> only acts as a readline() when the thing in <> is
simple -- meaning a bareword or a SIMPLE scalar; any other expression and
the <> becomes a glob().

well the way silly struck right after i wrote the email

         $def{'fd'} = new FileHandle unless defined $def{'fd'};
.....
        ($def{'fd'})->print($loginMsg);

   while(my $line = ($def{'fd'})->getline) {
        $line =~ s/\r?\n//;
        print STDOUT "GotBack: $line\n";
        return(0) if $line =~ /Error/;
    }
......

So this is sorta, well, dopey but it works

Not sure that i still like the idea of stuffing a FileHandle
into the structure to begin with - as opposed to merely doing
the simpler Idea of having a file descriptor like scalar to
push into that place....

ciao
drieux

---


<Prev in Thread] Current Thread [Next in Thread>