我剛開始學習Perl。我看着beginning perl page並開始工作。Perl中單引號和雙引號的區別是什麼?
它說:
單引號和雙引號之間的區別在於,單引號意味着他們的內容應該從字面上理解,而雙引號意味着它們的內容應該被解釋
當我運行此程序:
#!/usr/local/bin/perl
print "This string \n shows up on two lines.";
print 'This string \n shows up on only one.';
它輸出:
This string shows up on two lines. This string shows up on only one.
我錯了嗎? 版本以下的Perl:
perl -v
This is perl, v5.8.5 built for aix
Copyright 1987-2004, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
請給更多的信息標題您的問題,在這種情況下,「如何在Perl串插工作,不同類型的報價?」。這有助於正確的人查看和回答你的問題。 – 2010-01-08 14:34:40
「perl疑問」:可怕的標題!我會把它編輯成合理的。 – 2010-01-08 14:34:44
我無法複製您的問題。第二張照片出現在我的一條線上,正如我預期的那樣。請提供更多信息:您使用的是哪種操作系統和Perl版本?顯示以下輸出:perl -v – toolic 2010-01-08 14:45:10