Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    ...
    ...
        if ($^W == 1) {say "Let's get started..."}
        else {die $@}
    }
    
  2. or download this
    my $resistance = <STDIN>;
    if ($current =~ /mA/) {
    ...
        $current =~ s/(^\s+| )//;
        $current /= 1000;
    }
    
  3. or download this
    my $input = <STDIN>;
    my ($current) = $input =~ /^\s*[\d.]+\s+/ or do {
    ...
        ... # next, redo, or return, as appropriate
    };
    $input =~ /\s+mA\s*$/ and $current /= 1000;