Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/usr/bin/perl
$var_A = '3.1415927 is a rough approximation of pi.';
$var_B = '2 units is the radius of this circle.';
$diameter = ( $var_A ) * ( ( $var_B ) ** 2 );
print "Diameter = $diameter\n",
"Var_A = $var_A\n",
"Var_B = $var_B\n",
"Funny how Perl works, eh?\n";
#!/usr/bin/perl -w
use strict;
my $var_A = '3.1415927 is a rough approximation of pi.';
my $var_B = '2 units is the radius of this circle.';
my $diameter = ( $var_A ) * ( ( $var_B ) ** 2 );
print "Diameter = $diameter\n",
"Var_A = $var_A\n",
"Var_B = $var_B\n",
"Funny how Perl works, eh?\n";
sub rands {
my $num = int( shift );
my @arr = ();
for( 0 .. $num ) {
push @arr, int( rand( $num ) );
}
return \@arr;
}
$" = "\n";
print "random numbers:\n@{ rands( '20.3' ) }\n";