Printing string in Perl

后端 未结 6 1601
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-15 04:39

Is there an easy way, using a subroutine maybe, to print a string in Perl without escaping every special character?

This is what I want to do:

print          


        
6条回答
  •  时光说笑
    2021-01-15 05:16

    If you want to print a string literally and you have Perl 5.10 or later then

    say 'This is a string with "quotes"' ;
    

    will print the string with a newline.. The importaning thing is to use single quotes ' ' rather than double ones " "

提交回复
热议问题