develooper Front page | perl.perl5.porters | Postings from September 2012

RE: Changing the Perl error message when a module is not found

Thread Previous | Thread Next
From:
vadim.konovalov
Date:
September 19, 2012 04:25
Subject:
RE: Changing the Perl error message when a module is not found
Message ID:
35BF8D9716175C43BB9D67CA60CC345E3D245B83@FRMRSSXCHMBSC2.dc-m.alcatel-lucent.com
> From: Konovalov, Vadim 
> > From: demerphq 

> > Given your concerns we eagerly anticipate the patch that strips the
> > "Can't locate" out of those strings in a nice sane way.
> 
> stripping just "Can't locate" will save approx 60+ bytes with 
> a cost of adding complexity, so it hardly worth it.

I've tried with latest git, (v5.17.3-485-gdd76683)
I made a change to sv.c which eliminates a few strings,
namely, instead of 

Can't coerce %s to integer in %s
Can't coerce %s to number in %s
Can't coerce %s to string in %s
Can't coerce readonly %s to string
Can't coerce readonly %s to string in %s

I replaced these with one single following string:

Can't coerce %s%s to %s%s%s

with a simple change that is attached.
(test passes correctly)

For not very well understood by me reasons, perl517.dll became a
bit larger, not smaller,
it became 974,927 bytes instead of 974,922 bytes without my patch.

> Saving could be done with extracting error messages into 
> separate text file,
> with adding benefit of e.g. translatibility,
> and with the same cost of added complexity, thus maintainability,

I am not sure, if it worth the effort, and - if it does - I am very 
welcoming general ideas on the matter, eg. how such error messages
could be organized.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About