What is the difference between single (') and double (") quote in a string in perl?



What is the difference between single (') and double (") quote in a string in perl?..

Answer / Ankit Agarwal

In Perl, single quotes (`''`) preserve all whitespace and special characters as-is, while double quotes (`""`) interpret variables and some special characters. For example:

```perl
my $single = 'Hello, World!'; # A string with no interpretation
my $double = "Hello, World!"; # A string with interpreted variables

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

Explain the difference between declarations of 'my' and 'local' variable scope in perl?

1 Answers  


What does 'do' statement do in perl?

1 Answers  


What are the various file operations in perl. Explain with example.

1 Answers  


Explain 'grep' function.

1 Answers  


How will you create a file in perl?

1 Answers  


Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??

1 Answers  


Write syntax to use grep function?

1 Answers  


How to turn on Perl warnings? Why is that important?

1 Answers  


What interface used in PERL to connect to database? How do you connect to database in Perl?

1 Answers  


write a perl script to find whether a given line of text is starting and ending with same word or not ???

2 Answers   CSS,


Can inheritance be used in perl?

1 Answers  


What are the various perl data types based on the context?

1 Answers  


Categories