Help for this page

Select Code to Download


  1. or download this
    Formula::State::$state
    
  2. or download this
    sub calculate_xyz {
        my ($x, $y, $x, $state_variance) = @_;
        $state_variance //= 1;
        return (($x + $y) / $z) * $state_variance;
    }
    
  3. or download this
    ... calculate_xyz($x, $y, $x) ...      # Use standard value
    ... calculate_xyz($x, $y, $x, 1.5) ... # Add 50% to standard value
    ... calculate_xyz($x, $y, $x, 2) ...   # Double standard value
    
  4. or download this
    BEGIN {
        my $state = ... get state from somewhere (e.g. $ARGV[0]) ...
        require "Formula/State/$state.pm";
        "Formula::State::$state"->import(@optional_arguments);
    }
    
  5. or download this
    $ alias perle
    alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -E'
    ...
    
    $ perle 'BEGIN { my $x = $ARGV[0]; require "List/$x.pm"; "List::$x"->i
    +mport("uniq") } my @u = uniq (1,1,2,3,3,3); say "@u"' MoreUtils
    1 2 3
    
  6. or download this
    $ perle 'BEGIN { my $x = $ARGV[0]; require "List/$x.pm"; "List::$x"->i
    +mport("first") } say first { not $_ % 2 } 1, 2, 3' Util
    2
    ...
    $ perle 'BEGIN { my $x = $ARGV[0]; require "List/$x.pm"; "List::$x"->i
    +mport("first") } say first { not $_ % 2 } 1, 2, 3' MoreUtils
    Could not find sub 'first' exported by List::MoreUtils at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.