
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Multiline Strings in Perl
If you want to introduce multiline strings into your programs, you can use the standard single quotes as below −
Example
#!/usr/bin/perl $string = 'This is a multiline string'; print "$string\n";
Output
This will produce the following result −
This is a multiline string
You can use "here" document syntax as well to store or print multiline as below −
Example
#!/usr/bin/perl print <<EOF; This is a multiline string EOF
Output
This will also produce the same result −
This is a multiline string
Advertisements