Hello by [ Perl ], also print & qw()

Post Reply
User avatar
BABYLON
Posts: 2
Joined: Mon Feb 19, 2024 4:42 pm

Hello by [ Perl ], also print & qw()

Post by BABYLON »

First, we created the first.pl file. We saved it to the Home folder in Ubuntu, and its content was as follows.

Code: Select all

$p = "Ben Perl, inci\n";
print $p;
print "Hello $_!\n" for qw(Hello world baraq web);
The expected output will be as follows. :
Ben Perl, inci
Hello Hello!
Hello world!
Hello baraq!
Hello web!

In the qw() function, each element separated by a space completes the character sequence that comes before it by repeating it. "\n" is the escape string used to enter a new line.


HELLO PERL
Post Reply