MCQs > IT & Programming > Perl > Output of the Perl program? use strict; my @x = ('Red', 'Blue', 'Black'); print `@x = ` . '@x\n'; my ($Mary, $Lisa, $Lara)= @x; print '$Mary $Lisa $Lara\n'; my ($here, $there)= @x; print '$here $there\n'; my ($this) = @x; print '$this\n'; my $this = @x; print '$this\n'; my ($a, $b, $c, $d, $e)= ('a', 'b', 'c', 'd', 'e'); print '[$a] [$b] [$c] [$d] [$e]\n'; ($a, $b, $c, $d, $e)= @x; print '[$a] [$b] [$c] [$d] [$e]\n'; my $var_a = 'Monday'; my $var_b = 'Friday'; ($var_a, $var_b)= ($var_b, $var_a); print '$var_a $var_b\n';

Perl MCQs

What will be the output of the following Perl program?

use strict;

my @x = ("Red", "Blue", "Black");

print `@x = ` . "@x\n";

my ($Mary, $Lisa, $Lara)= @x;

print "$Mary $Lisa $Lara\n";

my ($here, $there)= @x;

print "$here $there\n";

my ($this) = @x;

print "$this\n";

my $this = @x;

print "$this\n";

my ($a, $b, $c, $d, $e)= ("a", "b", "c", "d", "e");

print "[$a] [$b] [$c] [$d] [$e]\n";

($a, $b, $c, $d, $e)= @x;

print "[$a] [$b] [$c] [$d] [$e]\n";

my $var_a = "Monday";

my $var_b = "Friday";

($var_a, $var_b)= ($var_b, $var_a);

print "$var_a $var_b\n";


Answer

Correct Answer:

Red Blue Black

Red Blue Black

Red Blue

Red

3

[a] [b] [c] [d] [e]

[Red] [Blue] [Black] [] []

Friday Monday  


Explanation:

Note: This Question is unanswered, help us to find answer for this one

Perl Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Perl Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it