adplus-dvertising
frame-decoration

Question

In Perl, how is a variable declared and used?

a.

variable = value; print variable

b.

$variable = value; echo $variable

c.

declare variable as value; log variable

d.

set variable = value; display variable

Answer: (b).$variable = value; echo $variable Explanation:In Perl, a variable is declared and used by using the syntax "$variable = value" and printing it with "print."

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. In Perl, how is a variable declared and used?