[pm-h] write to empty files
rlharris at oplink.net
rlharris at oplink.net
Fri Jun 8 10:11:04 PDT 2018
On Fri, June 8, 2018 7:54 am, Chris Blanc wrote:
> I would write-append these lines to the file with the >> operator.
>
>
> I would use this for the pathname:
> http://perldoc.perl.org/File/Basename.html
>
>
> This might help with the timestamp:
> https://www.perl.com/pub/2003/03/13/datetime.html/
"touch" changes the timestamp of a file, but also creates non-existent
files, and a file created by touch has zero length.
I have been using touch in a bash script to create groups of files simply
because it is an easy approach, and it has been years since I last did a
cover-to-cover read of Learning Perl. But then the contents of each file
must be created manually by copy-and-paste.
I would prefer to use Perl to create the files with the desired headers.
Once I know how to do that, I can make use of Perl to add additional
file-specific material to each file, and save much time in manual editing.
RLH
More information about the Houston
mailing list