Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Am I just getting to be a fuddy duddy or something? I'd much rather see a simple eval("use $module") than even more magic UNIVERSAL things.

    This just doesn't look like the kind of thing that benefits by adding sugar.
    • Regardless of whether or not you like it, the fact remains that tons of folks are actually using this module so if you can make it easier to use, that's a plus. Also, think of the work involved in making eval automatically die. In this case, I think the UNIVERSAL::require code is actually simpler.

      • eval "use $module";
        die $@ if $@;

        That's hard? I gotta say, I'm really leery of adding more methods to UNIVERSAL::. There has to be a good reason and I kind of think UNIVERSAL::require might be a bad done. Maybe no one should have ever used that. ->require is at best, a class method and not something you'd want to be valid on an object. ->require is at best... maybe something that falls within the scope of something like Class::MOP.

        • Agreed, it should be that simple, but frankly, if I'm working on a rotten code base with this ...

          open FH, 'somefile.txt';

          ... the I want this ...

          use Fatal qw< :void open close >;

          ... or at least this ...

          use Fatal qw< open close >;

          And frankly, this isn't really that bad. Yes, it would be far better if people explicitly checked the return calls. On the other hand, if done properly, these are exceptional events that should rarely occur. Thus, the occasional problem with having a less t