J
January Weiner
Hi,
I want to print to a file descriptor that sits in a hash ref:
my %hash ;
my $hash_ref = \%hash ;
open( $hash{fd}, ">test" ) or die "Can't write to file test: $!\n" ;
print $hash_ref->{fd} "Test\n" ;
This throws the following error:
syntax error at test.pl line 12, near "} "Test\n""
Why is that so? And what should I do, except for the obvious code below?
my $fd = $hash_ref->{fd} ;
print $fd "Test\n" ;
j.
I want to print to a file descriptor that sits in a hash ref:
my %hash ;
my $hash_ref = \%hash ;
open( $hash{fd}, ">test" ) or die "Can't write to file test: $!\n" ;
print $hash_ref->{fd} "Test\n" ;
This throws the following error:
syntax error at test.pl line 12, near "} "Test\n""
Why is that so? And what should I do, except for the obvious code below?
my $fd = $hash_ref->{fd} ;
print $fd "Test\n" ;
j.