Re: open()
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 27 Oct 2006 10:28:04 -0700
Klaus Jantzen wrote:
In a reply by A. Guzman I found the following paragraph:
==
Please be careful with your open(), you will have problems if you do not
use a multiple argument open(), ....
And you shouldn't use bare-word filehandles.
==
So far I used quite successfully bare-word filehandles except in the
cases where
I wanted to pass the filehandle to a subroutine or store it somewhere.
Why should one separate the ">" etc. from the file name?
print "Enter a file: \n";
chomp (my $filename = <STDIN>);
open FILE, $filename or die "Cannot open file: $!";
while (<FILE>) {
print;
}
Change to a temporary directory. Create a couple files in it. Run the
above program, and enter this at the prompt:
| rm *
And then see what happens to your temp directory.
Paul Lalli
.
- References:
- open()
- From: Klaus Jantzen
- open()
- Prev by Date: Re: open()
- Next by Date: Re: how to read and process data coming on console
- Previous by thread: Re: open()
- Index(es):