in reply to Edit a New file in place after reading it in
Not relevant to your original question, but:
Perl's open will create a file if it does not exist. There would normally be no need to shell out to create it before you open it.
my $New_Part_Date = system "date"; assigns $New_Part_Date the exit status of the date command (probably 0). The actual date goes to the terminal that runs the Perl script. In general if you want to capture the output of a command you use something like my $New_Part_Date = `date`;. But in this specific case I would do my $New_Part_Date = localtime;, which does not involve shelling out.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Edit a New file in place after reading it in
by perlynewby (Scribe) on Dec 22, 2021 at 16:04 UTC | |
by Fletch (Bishop) on Dec 22, 2021 at 18:25 UTC |