423 байта с Языком:: EN:: Число:
use Lingua::EN::Numbers qw/num2en num2en_ordinal/;
@l=map{($i++?num2en($i):'a')." $_"}split/\n/,<<"";
partridge in a pear tree
turtle doves, and
french hens
calling birds
gold rings
geese a-laying
swans a-swimming
maids a-milking
ladies dancing
lords a-leaping
pipers piping
drummers drumming
print"On the ".num2en_ordinal($_+1)
." day of Christmas, my true love gave to me ",
join(', ',reverse@l[0..$_]),"\n\n"for(0..11);
Или 480 байтов в жемчуге, не используя Язык:: EN:: Числа:
@n=qw/first second third forth fifth sixth seventh eigth nineth tenth eleventh twelfth/;
@l=<DATA>;chomp@l;
print"On the $n[$_] day of Christmas, my true love gave to me ",
join(', ',reverse@l[0..$_]),"\n\n"for(0..11);
__DATA__
a partridge in a pear tree
two turtle doves, and
three french hens
four calling birds
five gold rings
six geese a-laying
seven swans a-swimming
eight maids a-milking
nine ladies dancing
ten lords a-leaping
eleven pipers piping
twelve drummers drumming
Это должно смочь быть уменьшенным далее, так как числа являются очень повторяющимися.
Assuming this is a standard Apache log, and assuming you are on Unix, I usually do
awk '{print $1}' access.log|sort -u
The awk filters out all IP addresses, the sort then removes duplicates.
To find out all accesses to a URL, I do
grep URL access.log
Of course, you will have to replace "URL" with the specific one you search for.
You could also use something like webalizer to process the logs as another option.