AcePerl

 view release on metacpan or  search on metacpan

util/ace.PLS  view on Meta::CPAN

  # if we're local, then we just create a series 
  # of parse commands and let tace take care of reading
  # the file
  return map {"parse $_"} @files if $PATH;

  # if we're talking to a remote server, we create a series of parse 
  # commands and stop at the first file that we find
  my @c;
  local(*F);
  local($/) = undef;  # file slurp
  foreach (@files) {
    open (F,$_) || die "Couldn't open $_: $!";
    print "parse $_\n";
    my $result = $DB->raw_query(scalar(<F>),1);
    print $result;
    return if $result=~/error|sorry/i and $command ne 'pparse';
    close F;
  }
  return ();
}

sub get_help_topics {
  return () unless $DB;
  my $result = $DB->raw_query('help topics');
  return grep(/^About/../^nohelp/,split(' ',$result));
}

sub debug {
  return unless DEBUG;
  my @text = @_;
  warn "\n",@text,"\n";
  $readline::force_redraw++;
  readline::redisplay();
}

sub read_top_material {
  while ($DB->db->status == STATUS_PENDING) {
    my $h = $DB->db->low_read;
    $h=~s/\A\s+\*\*\*.+\.\n\n//s;
    $h=~s!\n// Type.*\n!!s;
    $h=~s/acedb> \Z//;
    $h=~s/\0+\Z//; # get rid of nulls in data stream!
    print $h;
  }
}

sub get_passwd {
  my $user = shift;
  local $| = 1;
  chomp(my $settings = `stty -g </dev/tty`);
  system "stty -echo </dev/tty";
  print $ENV{EMACS} ? "password: " : "$user password: ";
  chomp(my $password = <STDIN>);
  print "\n";
  system "stty $settings </dev/tty";
  return $password;
}
__END__
!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;



( run in 1.095 second using v1.01-cache-2.11-cpan-39bf76dae61 )