Deb wrote:
>
> At 16:10:24, on 07.10.03:
> Cracks in my tinfoil beanie allowed Jamie Risk to seep these bits into my brain:,
> > I'm a casual PERL programmer at best, and I have a working facsimile of the
> > non-working code below. When I run it, I get an error "print() on closed
> > filehandle
Please see correction, below:
At 13:14:50, on 07.10.03:
Cracks in my tinfoil beanie allowed deb to seep these bits into my brain:,
> Try this (untested):
> #The variable $fh is not a filehandlie - you need to assign that:
>
> my $fh = "somefile";
>
This line isn't quite right:
> open (FILE, ">$f
Try this (untested):
#The variable $fh is not a filehandlie - you need to assign that:
my $fh = "somefile";
open (FILE, ">$fh test") || die $!; # Open file for writing
while () {
print FILE "Hello\n";
}
close (FILE);
Some would say you don't need to do the close. Some say you do. I usually
Jamie Risk wrote:
> I'm a casual PERL programmer at best, and I have a working facsimile
> of the non-working code below. When I run it, I get an error
> "print() on closed filehandle $fh at ./test.pl line [n]".
>
> This is just my first step to being able to pass file handles to my
> sub-routine
Jamie Risk wrote:
> I'm a casual PERL programmer at best
The best Perl programmers are the most casual :)
> I have a working facsimile of the non-working code below.
> When I run it, I get an error "print() on closed filehandle
> $fh at ./test.pl line [n]".
>
> This is just my first step to being