5.2. Scalar variables (use my)
$this_is_a_long_scalar_variable $ThisIsAlsoGoodButWeUseItLessInPerl $h $H # $h and $H are two different variables Example 5-1. examples/scalars/scalar_variables.pl #!/usr/bin/perl use strict; use warnings; my $greeting = "Hello world\n"; my $the_answer = 42; print $greeting; print $the_answer, "\n"; A scalar can hold either string or numerical value. They can be changed any my $x; # the value is a special value called 'undef'
|
Follow me: