Help for this page

Select Code to Download


  1. 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
    
  2. or download this
    #!/usr/bin/perl
    
    ...
    use warnings;
    
    use Data::Dumper;
    
  3. or download this
    $temp_fahrenheit_1 = 32 + $temp_c_1 * 1.8;
    $temp_fahrenheit_2 = 32 + $temp_c_2 * 1.8;
    ...
    
  4. 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);
    
  5. or download this
    @temperatures_in_c = (5,10,15,20);
    @temp_in_f = map(c_to_fahrenheit($_),@temp_in_c);
    
  6. or download this
    do something(\@myarray,\%myhash,\$mystring);
    sub do_something { 
        my @localarray = @{shift @_};
    ...
        ...
    }
    
  7. or download this
    %course = (code => $code; 
        weekday => $day, 
        time => $time, 
        title => $title, 
        location => location);
    
  8. or download this
        $date{weekday} = $day;
        $date{time} = $time;
        $course{"date"} = %date;
        ...
    
  9. or download this
    $testphrase = "The colours of the rainbow are red, yellow, green, blue
    +, indigo, and violet";
    ($newphrase = $oldphrase) =~s/colour/color/;