Re: can not print

Re: can not print

am 09.08.2006 16:15:55 von Paul Lalli

George Bouras wrote:

> # This does not work (the one I need) . I think it is a perl bug.
> # Any idea ?

Several. None of them overly polite... ;-)

> $hash->{fileid} = 'id1';
> open $hash->{fileid}, '>oooooooooooooo' or die;
> print $hash->{fileid} 'hello world';
> close $hash->{fileid};

Before assuming that you know what you're doing and Perl does not,
consider reading the documentation for the function you're using

perldoc -f print

Note that if you're storing FILEHANDLES in an array
or other expression, you will have to use a block
returning its value instead:

print { $files[$i] } "stuff\n";
print { $OK ? STDOUT : STDERR } "stuff\n";

Paul Lalli

can not print

am 10.08.2006 01:06:22 von George Bouras

# works (of course ...)
$var = 'id1';
open $var, '>oooooooooooooo' or die;
print $var 'hello world';
close $var;

# also works (of course ...)
$hash->{fileid} = 'id1';
open $hash->{fileid}, '>oooooooooooooo' or die;
print id1 'hello world';
close $hash->{fileid};

# This does not work (the one I need) . I think it is a perl bug.
# Any idea ?
$hash->{fileid} = 'id1';
open $hash->{fileid}, '>oooooooooooooo' or die;
print $hash->{fileid} 'hello world';
close $hash->{fileid};