Slash Boxes
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.
More | Login | Reply
Loading... please wait.
  • What about from?

    use from 'Spreadsheet::ParseExcel' => qw(

    Or something else that looks more like English.

  • Personally I don't think it's really any cleaner. You've just hidden your meaning behind another statement, another module that the next maintainer has to go and read the docs for to figure out what it does. Sure it's a bit of extra typing, but you only do it once per file.

  • I think it adds complexity and reduces clarity just to save a few characters.

  • Actually I kinda like it since I hate all repetitions/duplications and regard them as evil.

    But it needs the simplest syntax possible to avoid burning extra brainpower. Somehow all the above examples don't cut it.

    How about supporting Unix shell's feature? And how about the name multi or many? use many 'A::{B,C}::{D,E}';

  • The original code is instantly understandable and the intent clear. Now when someone reads your new packages code, they have to pause for a few seconds to figure out what it does and why. I'm not entirely sure that extra speed bump is worth it.

  • with qw(

    Would be:

    # extrapolates from Teleweb::Mapper
    use from 'Teleweb::Mapper' => qw(
      OS Ifaces MainIP HostingType RAM CPU Apps Services Server_app

  • find srctree -type f | xargs grep Spreadsheet::ParseExcel::Font

    The suggested kind of shorthand makes it really hard to do custom searches of your code base, such as for all the code that might happen to use a particular module.  (There might be many modules named mumble::Font - when you separate Spreadshht::ParseExcel unto a separate line from Font you lose the ability to find that unique name using generic tools.
  • use Spreadsheet::ParseExcel::*;

    What, too Java?

    • Something I had considered once but was quickly talked out of. Basically, even many Java people admit that this construct was a mistake. You're not being explicit about what you want and it's therefore unclear what you get. Hell on maintenance programmers.

  • Why reinvent the wheel?