mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-26 14:18:00 +01:00
27 lines
447 B
Perl
27 lines
447 B
Perl
|
#!/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";
|
||
|
} }
|
||
|
} }
|
||
|
}
|