一時ファイルに一重引用符を付けて hello world を保存しようとしています 一時ファイルを開きます hello world 一重引用符なしで表示する これを解決する方法
#!/usr/bin/perl -w
chomp($TMPFILE = `mktemp bumatinaskk.XXXXXXXXXX`);
$echo = "echo \'hello word\' >>$TMPFILE";
system ("$echo");
use 5.010;
use strict;
use warnings FATAL => 'all';
use autodie;
use File::Temp qw(tempfile);
use IO::File qw();
my ($file_handle, $file_name) = tempfile('bumatinaskk.XXXXXXXXXX', UNLINK => 1);
$file_handle->say(q{'hello world'});
$file_handle->close;
say "wrote into temporary file $file_name";
sleep 30; # giving you some time to inspect the temporary file
END { say 'temporary file is going to be deleted now' }
ドキュメント: File::Temp、IO::File