Don't ask to ask, just ask | |
PerlMonks |
Re: why does open ">..." sometimes touches the directory?by vinoth.ree (Monsignor) |
on Feb 05, 2013 at 08:42 UTC ( [id://1017084]=note: print w/replies, xml ) | Need Help?? |
In Linux '>' redirect symbol is used to create new file, if the file exists it removes the existing content and creates new file. Use Three-argument open(), to open a file its safer open my $fh, '>', $filename or die "Can't write to '$filename': $!\n"; Update: Shorthand Flags: Entities Definition< or r Read Only Access > or w Creates, Writes, and Truncates >> or a Writes, Appends, and Creates +< or r+ Reads and Writes +> or w+ Reads, Writes, Creates, and Truncates +>> or a+ Reads, Writes, Appends, and Creates
In Section
Seekers of Perl Wisdom
|
|