Help for this page

Select Code to Download


  1. or download this
     my $sth = $dbh->prepare("select tablename from pg_tables where schema
    +name=?");
        $sth->execute($schema);
    ...
            push @tables, @t;
        }
        $sth->finish;
    
  2. or download this
     my %children = (
                      'a' => [ 'b', 'c' ],
    ...
      sub children { @{$children{$_[0]} || []}; } 
      my @unsorted = ( 'z', 'a', 'x', 'c', 'b', 'y' );
      my @sorted = toposort(\&children, \@unsorted);