There's got to be a better way than this that preserves the logic while sparing me the multitude of lines:

```
sub has_path {
  clearerr;
  my %Graph = gref(shift);
  my $A = shift;
  my $B = shift;
  my $C = shift;
  my $D = shift;
  my $E = shift;
  my $F = shift;
  my $G = shift;
  my $H = shift;
  my $I = shift;
  my $J = shift;
  my $K = shift;
  my $L = shift;
  my $M = shift;
  my $N = shift;
  my $O = shift;
  my $P = shift;
  my $Q = shift;
  my $R = shift;
  my $S = shift;
  my $T = shift;
  my $U = shift;
  my $V = shift;
  my $W = shift;
  my $X = shift;
  my $Y = shift;
  my $Z = shift;
  # returns VT_BOOL
  my $bool = 0;
  my $switcher = dectab( [ $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S, $T, $U, $V, $W, $X, $Y, $Z ] );
  given ($switcher) {
   when ( "--------------------------" ) {
    seterr( "No path." );
    } # no path
   when ( "X-------------------------" ) {
    seterr( "Path of one element." );
    } # path of 1 element
   when ( "XX------------------------" ) {
    $bool = $Graph->has_path( $A,  $B );
   }
   when ( "XXX-----------------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C );
   }
   when ( "XXXX----------------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D );
   }
   when ( "XXXXX---------------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E );
   }
   when ( "XXXXXX--------------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F );
   }
   when ( "XXXXXXX-------------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G );
   }
   when ( "XXXXXXXX------------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H );
   }
   when ( "XXXXXXXXX-----------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I );
   }
   when ( "XXXXXXXXXX----------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J );
   }
   when ( "XXXXXXXXXXX---------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K );
   }
   when ( "XXXXXXXXXXXX--------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L );
   }
   when ( "XXXXXXXXXXXXX-------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M );
   }
   when ( "XXXXXXXXXXXXXX------------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N );
   }
   when ( "XXXXXXXXXXXXXXX-----------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O );
   }
   when ( "XXXXXXXXXXXXXXXX----------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P );
   }
   when ( "XXXXXXXXXXXXXXXXX---------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q );
   }
   when ( "XXXXXXXXXXXXXXXXXX--------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R );
   }
   when ( "XXXXXXXXXXXXXXXXXXX-------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S );
   }
   when ( "XXXXXXXXXXXXXXXXXXXX------" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S, $T);
   }
   when ( "XXXXXXXXXXXXXXXXXXXXX-----" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S, $T, $U );
   }
   when ( "XXXXXXXXXXXXXXXXXXXXXX----" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S, $T, $U, $V );
   }
   when ( "XXXXXXXXXXXXXXXXXXXXXXX---" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S, $T, $U, $V, $W );
   }
   when ( "XXXXXXXXXXXXXXXXXXXXXXXX--" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S, $T, $U, $V, $W, $X );
   }
   when ( "XXXXXXXXXXXXXXXXXXXXXXXXX-" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S, $T, $U, $V, $W, $X, $Y,);
   } 
   when ( "XXXXXXXXXXXXXXXXXXXXXXXXXX" ) {
    $bool = $Graph->has_path( $A,  $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, $N, $O, $P, $Q, $R, $S, $T, $U, $V, $W, $X, $Y, $Z );
   }
  }  
  return $bool;
 }

```

This is the dectab (decision table) sub it refers to:

```
 sub dectab {
  my($ref)=shift;
  my ($res);
  foreach my $key( @$ref){ 
   if ( ! defined $key ) { 
    $res .= '-';
   } else {
    $res .= "X";
   }
  }
  return $res;
 }

```

`clearerr`, `seterr`, and `gref`:

```
sub clearerr {
    $ERRORFLAGGED = 0;
    $ERRORTEXT = "";
}

sub seterr {
    $ERRORTEXT = shift;
    $ERRORFLAGGED = 1;
}

sub gref {
    my $gref = shift;
    if ( defined $grefs->{$gref} ) {
        return $grefs->{$gref};
    } else {
        return undef;
    }
}

```

This is all part of a much much larger wrapping of the Graph module. It's being turned into a COM DLL using ActiveState's PerlCtrl.

Calling the sub would be done, in VBScript (for example), by

```
set o = CreateObject("Wrapper.Graph.2")
...
if o.has_path( "tom", "dick", "harry" ) then 
...

```

Graph.pm, by the way, defines `has_path` as

```
has_path

   $g->has_path($a, $b, $c, ..., $x, $y, $z)

Return true if the graph has all the edges $a-$b, $b-$c, ..., $x-$y, $y-$z, false otherwise.

```