ponysay/pq4ps.pl

27 lines
457 B
Perl
Raw Normal View History

2012-08-01 00:19:34 +02:00
#!/usr/bin/perl
2012-08-01 03:33:30 +02:00
opendir(DIR, $ARGV[0]."/share/ponysay/ponies/");
2012-08-01 00:19:34 +02:00
@files = readdir(DIR);
2012-08-01 03:33:30 +02:00
opendir(DIR, $ARGV[0]."/share/ponysay/quotes/");
2012-08-01 00:19:34 +02:00
@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";
} }
} }
}