ponysay/pq4ps.pl

27 lines
447 B
Perl
Raw Normal View History

2012-08-01 00:19:34 +02:00
#!/usr/bin/perl
opendir(DIR, "/usr/share/ponysay/ponies/");
@files = readdir(DIR);
opendir(DIR, "/usr/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";
} }
} }
}