in reply to Re: One for the Wisest Monks
in thread Closing a system process after file creation (was: One for the Wisest Monks)

system "touch $num.bat";
But that unnecessarily starts a separate process, and is subject to security issues regarding the contents of $num.

Much safer and faster:

open DUMMY, ">>$num.bat"; close DUMMY;

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: One for the Wisest Monks
by Abigail-II (Bishop) on Jun 03, 2002 at 10:55 UTC
    system touch => "$num.bat";
    doesn't suffer from security issues regarding the content of $num. As for "much faster", I'm not quite convinced. You're doing disk I/O here, and that's likely to be the bottleneck anyway.

    Abigail