in reply to AUTHOR default setting in h2xs

Um... Anyway you ice it ... anything you use there Will be editing youll have to do... module-starter ,dzil...

my ($email,$author,$licence); eval { my $username; ($username,$author) = (getpwuid($>))[0,6]; if (defined $username && defined $author) { $author =~ s/,.*$//; # in case of sub fields my $domain = $Config{'mydomain'}; $domain =~ s/^\.//; $email = "$username\@$domain"; } }; $author =~ s/'/\\'/g if defined $author; $author ||= "A. U. Thor"; $email ||= 'a.u.thor@a.galaxy.far.far.away';

Replies are listed 'Best First'.
Re^2: AUTHOR default setting in h2xs
by perlboy_emeritus (Scribe) on Feb 26, 2018 at 23:04 UTC

    Thanks for the insight. So, that domain was compiled into Config.pm, presumably by some Apple developer? And the only way I can change it, other than editing each instance of Makefile.PL, is to recompile Perl? Is that right? sd.apple.com could be some internal Apple domain that the developers use, sd for software development. Just a guess. It would be so cool if Config.pm used something like .configrc or .config_profile to specify configuration variables, particularly those that are of interest to Perl users rather that Perl builders.

      And the only way I can change it, other than editing each instance of Makefile.PL, is to recompile Perl? Is that right?

      No - if it's set in Config.pm, amending that setting to whatever you want should be all that's needed.
      In Windows, it's specified only in lib/Config_heavy.pl. I don't know which file(s) specify it in MacOS but I expect it would be lib/Config.pm and/or lib/Config_heavy.pl (if the latter even exists on MacOS).

      For a quick check to see what it's set to you can just run perl -V:Author

      Cheers,
      Rob
        Cool! And thanks. Found it with grep:   Config_heavy.pl:mydomain='.sd.apple.com', and also learned something extremely useful about Config.

      So, that domain was compiled into Config.pm, presumably by some Apple developer? And the only way I can change it, other than editing each instance of Makefile.PL, is to recompile Perl? Is that right?

      Not important. No, that isn't right.

      It would be so cool if Config.pm used something like .configrc or .config_profile to specify configuration variables, particularly those that are of interest to Perl users rather that Perl builders.

      No.

      Maybe you can take a minute and read the documentation for Config to figure out its purpose.

      If you're making modules you're gonna have to edit Makefile.PL no matter the tools you use, as as you're going to have to edit any .xs files, or .pm files.

      h2xs is just a template/stubber.

      h2xs is not an IDE (integrated development environment).

      That h2xs pluck host out of %Config tells you how old it is and who wrote it (its the guy who wrote perl itself).

        Duh! Yes guy, I know I'm going to have to do lots of edits when making modules. I just don't like to make the same damn edit over and over again. I did not know about Config_heavy.pl. Now I do, thanks to Rob.