我一直在试图弄清楚如何运行这个例子一段时间,而我仍然坚持如何打印日期。以下是我正在处理的示例。获取perl脚本的错误输出。
(The Script for Unix/Linux)
# Backquotes and command substitution
1 print "The date is ", 'date'; # Windows users: 'date /T'
2 print "The date is 'date'", ".\n"; # Backquotes treated literally
3 $directory='pwd'; # Windows users: 'cd'
4 print "\nThe current directory is $directory.";
(Output)
1 The date is Mon Jun 25 17:27:49 PDT 2007.
2 The date is 'date'.
4 The current directory is /home/jody/ellie/perl.
这是我的工作和输出。
print "The date is ", 'date /T';
print "The date is 'date'", ".\n";
$directory='cd';
print "\nThe current directory is $directory.";
(Output)
The date is date /TThe date is 'date'.
The current directory is cd.
任何帮助,这是非常感谢。谢谢。
因为类似的问题,当我第一次尝试孩子的时候,它不鼓励我编程,所以我会添加这样的建议:美国键盘上的[backtick](https://en.wiktionary.org/wiki/backtick) ESC下面的按钮。在其他布局上,可能很难找到。在例如一个德语单词,它是退格键左边的按钮,在按住Shift键的同时按下空格键,然后按空格,因为它的意思是[重音符号,叫做重音符号](https://en.wikipedia.org/?title= Grave_accent),也可以放在一个字母上,比如'è'。如果没有帮助,请从这里复制:'\'' – simbabque
或使用'qx()',它更易于输入,甚至可能看起来更好。 –