- 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
Perl Special Literals
Let me tell you about three special literals __FILE__, __LINE__, and __PACKAGE__ represent the current filename, line number, and package name at that point in your program.
They may be used only as separate tokens and will not be interpolated into strings. Check the below example −
Example
#!/usr/bin/perl print "File name ". __FILE__ . "\n"; print "Line Number " . __LINE__ ."\n"; print "Package " . __PACKAGE__ ."\n"; # they can not be interpolated print "__FILE__ __LINE__ __PACKAGE__\n";
Output
This will produce the following result −
File name hello.pl Line Number 4 Package main __FILE__ __LINE__ __PACKAGE__
- Related Articles
- What are Perl Numerical Literals?
- What are Perl String Literals?
- The $[ Special Variable in Perl
- Filehandle Special Variables in Perl
- Global Special Variable Types in Perl
- Regular Expression Special Variables in Perl
- Integer literals vs Floating point literals in C#
- Literals in C#
- What is the difference between character literals and string literals in Java?
- Literals in Java programming
- Octal literals in C
- What are JSP literals?
- Compound Literals in C
- Boolean Literals in Java
- What are literals in Java?

Advertisements