A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/perl/hello-world-program-in-perl/ below:

Hello World Program in Perl

Hello World Program in Perl

Last Updated : 11 Jul, 2025

Perl

programming language is exclusively designed for text processing purposes. Its abbreviation denotes

Practical Extraction and Report Language

. It is compatible on various platforms, such as Windows, Mac OS, and almost all versions of UNIX. Hello World! program in every programming language gives the beginner programmer a leap in proceeding further in the new language. The basic Hello world program just gives the output by printing " Hello World!" on the screen. In Perl, a basic program consists of the following steps of execution,

Step 1: Transfer the file to Perl Interpreter:

Always in Perl, the first line starts with a pair of characters #!. It insists Perl interpreter how the file should be executed. Here, the file should be transferred to Perl interpreter that resides in /usr/bin/perl folder. So, the first line of the program will go this way,

#!/usr/bin/perl
Step 2: Pragma in Perl:

A pragma is a specific module in Perl package which has the control over some functions of the compile time or Run time behavior of Perl, which is strict or warnings. So the next two lines go like this,

use strict;
use warnings;
Step 3: Use of print() function:

Lastly displaying the output, We use print() function to display a string in perl.

print("Hello World\n");
Code: Perl
#!/usr/bin/perl

# Modules used
use strict;
use warnings;

# Print function 
print("Hello World\n");
Output:
Hello World
  Important Points: How to Run a Perl Program?

Generally, there are two ways to Run a Perl program-



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4