On 3/3/06, Families Laws <[EMAIL PROTECTED]> wrote:
> what is the purpose of ". 2>&1 |" ? This is a AIX
> machine. Thanks.
> open(FILEHANDLE, "$PATH_TO_WSADMIN -f $tmpFile
> ". ' 2>&1 |');
The '2>&1' part is shell syntax meaning to redirect what would go to
filehandle 2 (STDERR) to file
I believe this is actually part of the shell command to open that
file. It redirects STDOUT and STDERR to a file (shell's, not
perl's). As for the "|", I don't know.
On Mar 3, 2006, at 1:12 PM, Families Laws wrote:
2>&1 |
On Tuesday 17 January 2006 09:30, radhika wrote:
[ . . ]
> 409$plain_text .= $_ foreach (<$fh>);
>close $fh;
> --code end--
>
> I keep getting this error:
>
> readline() on closed filehandle $fh at
> /home/ars/sys/libperl/site/ARS/REPORTS/AggregateFills.pm line 409.
Is that above line
# (Prematurely?) declare lexical variable
405 my $fh;
# Get file name from the $file object.
406 my $txtfile = $file->fileName();
# Open file using lexical variable
# declared earlier for file handle.
# Do not test file opening for success.
407
radhika wrote:
Hi,
Can someone tell me what is going on in this peice of code?
Especially, line 409.
--code start--
405my $fh;
406my $txtfile = $file->fileName();
407open $fh, $txtfile;
open $fh, $txtfile or die "cannot open $txtfile: $!\n";
408my $plain_text = '';
409$p
: is it possible to open a filehandle on a file change one line in that file
: without outputing to another file.
You can open the file, seek() to a particular position in it, and start
overwriting the file at that position, but when you reach the end of
that line, you'll keep on writing past it