> p0: yes, one can use an import() from a package > to make something like the scam of 'require in line'
Why is it a scam if that's what I want to do for myself? > for the twin pragma of 'use strict' and 'use warnings' > { oye! } > > p1: But there is this minor technical overhead that > comes with the process - > > 1.a: one needs to use h2xs to make sure that the > module will conform with the current best practices > and be appropriately installable in the CPAN way > my module or strict and warnings? One would assume the the developer has a responsibility to make their code > 1.b: one has to maintain that module just to make the > two lines of pragma readily available to all of one's > perl code. If that's the point of the module and users know that, isn't the maintainer supposed to, well er maintain it properly? Also wouldn't the script author have to do the same thing except in all his scripts instead of one place? > > 1.c: the count of lines of the perl module vice the > simple inclusion of the two lines makes the process > a bit Wonky if you know what I mean. Not really, if we are talkking strictly line counts then do this: in 50 scripts: use Foo::Monkey; = 50 lines ( ok 100 if you count: sub import { for('strict',warnings') { if(gotmodule($_) { $_->import; } } } # gotmodule is a function in side Foo::Monkey that basically does eval("use $_[0]") # and returns true if it was able to be loaded, it works too I tested it # also it avoids killing the script if it can't be loaded since it only does $_->import # if the module could be use()ed ) you get strict and warnings plus thae many other nifty things about Foo::Monkey use strict;use warnings = 100 lines. So depending on how you look at it, there are less or the same amount of *lines* but many more advantages as far as I can tell. > > p2: clearly the fact has been established that it can be > done, but it also notes the 'and you want this pain why?' problem.... > I don't understand the pain you speak of, could you define more clearly why I don't want to do the import() to make it automatic so this module's users have to consciously turn off strict and warnings instead of consciously turn it on like we tell people to do over an over an over... I mean as long as I make it clear, and I would definitely blab about it as an advantage, that by doing use Foo::Monkey; # enables strict and warnings for your script for better scripting practice!! # If you don't like that use no warnigns and no strict.. But why would you do that? Thanks Dan > ciao > drieux > > --- > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>