- or download this
# author: Your name
# created on:
...
# write your changed or found lines to your output file
# close your text output file
# close your text input file
- or download this
#!/usr/bin/perl
...
use warnings;
use Data::Dumper;
- or download this
$temp_fahrenheit_1 = 32 + $temp_c_1 * 1.8;
$temp_fahrenheit_2 = 32 + $temp_c_2 * 1.8;
...
- or download this
sub c_to_fahrenheit {
my $temp_in_c = shift @_;
...
return($temp_in_f);
}
$temp_fahrenheit_1 = c_to_fahrenheit($temp_c_1);
- or download this
@temperatures_in_c = (5,10,15,20);
@temp_in_f = map(c_to_fahrenheit($_),@temp_in_c);
- or download this
do something(\@myarray,\%myhash,\$mystring);
sub do_something {
my @localarray = @{shift @_};
...
...
}
- or download this
%course = (code => $code;
weekday => $day,
time => $time,
title => $title,
location => location);
- or download this
$date{weekday} = $day;
$date{time} = $time;
$course{"date"} = %date;
...
- or download this
$testphrase = "The colours of the rainbow are red, yellow, green, blue
+, indigo, and violet";
($newphrase = $oldphrase) =~s/colour/color/;