aboutsummaryrefslogtreecommitdiff
path: root/pq4ps.pl
blob: a10c9981350978a4ef3e7bb5b21d2bdb37e836f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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";
	    }   }
    }   }
}