ponysay/pq4ps.pl
Mattias Andrée 70c27ca36f some edits
2012-08-01 03:33:30 +02:00

26 lines
457 B
Perl
Executable file

#!/usr/bin/perl
opendir(DIR, $ARGV[0]."/share/ponysay/ponies/");
@files = readdir(DIR);
opendir(DIR, $ARGV[0]."/share/ponysay/quotes/");
@quotes = readdir(DIR);
foreach $file (@files)
{
$_ = $file;
$_ =~ s/\.pony$//g;
$f = $_;
if (! /^\./)
{ foreach $quote (@quotes)
{
$_ = $quote;
$_ =~ s/\.\d+//g;
$_ = '+'.$_.'+';
if (! /^\./)
{ if (/\+$f\+/)
{ print $f."@".$quote."\n";
} }
} }
}