Files
SauvegardePST/Perl/bin/ppm-shell
2025-08-27 09:03:01 +02:00

23 lines
503 B
Perl

#!/usr/bin/perl -w
use strict;
BEGIN { $ENV{PERL_RL} = "stub" if $^O eq "MSWin32" }
use Term::ReadLine ();
use Text::ParseWords qw(shellwords);
system("ppm", "--version");
exit 1 if $? != 0;
my $term = new Term::ReadLine 'PPM';
my $prompt = "ppm> ";
my $OUT = $term->OUT || \*STDOUT;
while ( defined ($_ = $term->readline($prompt)) ) {
last if /^(quit|exit)$/;
my @w = shellwords($_);
if (@w) {
system("ppm", @w);
$term->addhistory($_);
}
}
print "\n";