Perl Question regarding file handles
Hi Everybody, I created a Perl class, and one of the attributes is a file handle. I used the standard FileHandle class to create the file handle. Opening and writing to the file handle is no problem, but reading from it has a bit of a syntactic problem. Example: $line = <$this->{FH}> ### Generates a syntax error. The problem is that interpreter sees the first > as the end of the operator. I have tried $line = <{$this->{FH}}> $line = <${this->{FH}}> with no success. Any ideas on how I can overcome this problem. Thanks Marius Roets
On Monday 04 August 2003 07:11, Marius Roets wrote: Ok this time to the list. Try something like this. $handle = $self->{'handle'}; if (open($handle, $self->{'path'})) { $data = <$handle>; ... close($handle); }
participants (2)
-
jbudd
-
Marius Roets