我試圖做一個類似於這個php函數的perl子程序。WriteOutput Perl?
private function writeOutput($msg, $type) {
echo date("H\:i\:s") . " - [$type] . > $msg\n";
}
我需要定義$msg
和$type
一點幫助。
sub WriteOutput {
$sec = sprintf ("%02d", $sum%60);
$mins = sprintf("%02d", ($sum%3600)/60);
$hrs = int($sum/3600);
print "[$hrs:$mins:$sec]:[$type]>: $msg";
}
我很抱歉,但它是完全我不清楚你在問什麼。也許你可以嘗試以不同的方式表述它?謝謝。 –
php函數的工作方式就像這樣'writeOutput(「test」,「type1」);'所以我想知道是否可以在perl中完成它 – user2524169
知道perl的人不需要理解php。考慮獨立解釋問題。什麼是輸入,子程序有多少個參數? – jkshah