- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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
- Related Articles
- V-Strings in Perl
- Transform Perl Strings into Arrays
- Transform Perl Arrays to Strings
- Multiline macros in C
- JavaScript multiline Property
- Pattern MULTILINE field in Java with examples
- How do we create multiline comments in Python?
- How to define multiline String Literal in C#?
- How to grep multiline search patterns in Linux?
- Make a multiline plot from .CSV file in matplotlib
- How to make Ellipsis to multiline text in CSS?
- Comments in Perl
- Whitespaces in Perl
- Dereferencing in Perl
- How can we write a multiline lambda expression in Java?

Advertisements