Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.perl.misc > #8809
| From | Rainer Weikusat <rweikusat@mssgmbh.com> |
|---|---|
| Newsgroups | comp.lang.perl.misc |
| Subject | Re: using Exporter::export_fail |
| Date | 2013-07-22 14:55 +0100 |
| Message-ID | <877ggin1hm.fsf@sapphire.mobileactivedefense.com> (permalink) |
| References | <51ec36ff$0$6548$9b4e6d93@newsspool4.arcor-online.net> <pjstba-u641.ln1@anubis.morrow.me.uk> <51ec5a7b$0$6562$9b4e6d93@newsspool4.arcor-online.net> |
"A. Sicken" <AndSiPerl@Arcor.De> writes: > Ben Morrow wrote: >> No. If you must, you can get rid of the method on it's first invocation >> by deleting the glob from the symbol table, but I wouldn't recommend >> doing that. >> >> You could alternatively write your own import method, which removes >> enable_debug from the symbol list and calls Exporter->export_to_level to >> do the actual exporting. > > Ok. The method I want to get rid of is the export_fail-method (not the local > tied enable_debug var or the symbol) because you can call it on every object > created through this modul. And what's the problem with that? 'class modules' I'm using usually also contain auxiliary subroutines which could also be called 'on every object' except that this wouldn't be particularly useful: If you're creating modules supposed to be used by other people and a significant minority of these use them in ways you originally considered to be 'useless', that indicates your 'public interface' is lacking. [...] > The other way around (for inheritance only) I guess would be to write > export_fail-stubs for every single modul (currently about 20) which is also > a messy job :-( - and it would make it worse - because then every modul > would need to have an export_fail method which is completely unneccessary > for the object stuff. Leaving the issue mentioned above aside, you could create a single 'export fail stub' module, put the subroutine into @EXPORT and then do a use export_fail_stub; to import it as method into every module/ class supposed to utilize it.
Back to comp.lang.perl.misc | Previous | Next — Previous in thread | Next in thread | Find similar
using Exporter::export_fail "A. Sicken" <AndSiPerl@Arcor.De> - 2013-07-21 21:31 +0200
Re: using Exporter::export_fail Ben Morrow <ben@morrow.me.uk> - 2013-07-21 21:23 +0100
Re: using Exporter::export_fail "A. Sicken" <AndSiPerl@Arcor.De> - 2013-07-22 00:02 +0200
Re: using Exporter::export_fail Ben Morrow <ben@morrow.me.uk> - 2013-07-22 12:49 +0100
Re: using Exporter::export_fail "A. Sicken" <AndSiPerl@Arcor.De> - 2013-07-22 20:19 +0200
Re: using Exporter::export_fail Ben Morrow <ben@morrow.me.uk> - 2013-07-22 22:41 +0100
Re: using Exporter::export_fail Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-22 14:55 +0100
Re: using Exporter::export_fail "A. Sicken" <AndSiPerl@Arcor.De> - 2013-07-22 19:42 +0200
Re: using Exporter::export_fail Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-22 19:47 +0100
Re: using Exporter::export_fail - SOLVED "A. Sicken" <AndSiPerl@Arcor.De> - 2013-07-22 23:33 +0200
Re: using Exporter::export_fail - SOLVED Ben Morrow <ben@morrow.me.uk> - 2013-07-23 00:14 +0100
csiph-web