如何在perl脚本中创建属性文件

时间:2018-12-11 11:55:29

标签: perl

我想创建一个order.properties,并在order.properties文件中创建一个名为starttime的变量,并使用perl脚本以YYYYMMDDHH24MM格式分配当前时间(系统时间)的值

我是Perl脚本的初学者,请帮助我。

预先感谢

1 个答案:

答案 0 :(得分:0)

  

我想在Perl脚本中创建一个order.properties文件

open my $fh, '>', 'order.properties' or die $!;
# Do you want to put any data into the file? Do it here
close $fh;
  

并将当前日期发送到变量$starttime

use Time::Piece;

my $starttime = localtime->strftime('%Y%m%d%H%M');
相关问题