![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
Whitespaces in Perl
A Perl program does not care about whitespaces. Following program works perfectly fine −
#!/usr/bin/perl print "Hello, world\n";
But if spaces are inside the quoted strings, then they would be printed as is. For example −
Example
#!/usr/bin/perl # This would print with a line break in the middle print "Hello world\n";
Output
This will produce the following result −
Hello world
All types of whitespace like spaces, tabs, newlines, etc. are equivalent to the interpreter when they are used outside of the quotes. A line containing only whitespace, possibly with a comment, is known as a blank line, and Perl totally ignores it.
Advertisements