in reply to Ars gratia artis.
23 characters.$t+=$_ for<>;print$t/$.
If adding the file to the code, use the poetry optimization:
leaves us at 31. With error handling if the file is not there! :-)@ARGV=o;$t+=$_ for<>;print$t/$.
PS: Your approach was nice. :-)
EDIT
Thanks Corion for catching a wrong closing code tag.
|
|---|