Re: [Module::Build] notes on notes
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <Ra...@Th...> - 2003-12-31 08:16:48
|
On 12/31/2003 2:31 AM, Uri Guttman wrote:
> ok, i rtfm'ed and see what the notes method does. so my first question
> is why does new even handle a passed in args attribute (especially as it
> is not documented nor meant to be used)?
I think Ken did this so that different actions can handle their own
arguments. For example, the 'ppd' action takes an optional 'codebase'
argument from the commandline. It opens the door so that action authors
can similarly handle their own args, keeping arg handling near the code
that uses it.
> the second question is how do we punish that scalawag dave for using an
> undocumented feature and leading me down that evil path?
I leave dave's punishment to your imagination (sorry dave), but I
suspect you opened yourself to similar punishment when you *chose* to
act without RTFM. ;-)
> on a related note (sic), i have been looking at prompt and y_n. i had
> written very similar subs in my soon to be deleted stem install script
> and i had transplanted them to my build stuff. so i will replace them
> with build's method (almost a drop in replacement). my prompts can ber
> very long (using here docs of course) since i sometime describe the
> queries in detail. now, i noticed that the example does the config
> queries in Build.PL and stores the results in notes in the build
> object. i was doing the queries in the install action. is there a reason
> to do it one way or another? the only time i seem to need those values
> is in the install action. also dave wrote something that writes out
> those values into a stem module. if i need them in test script or
> whatever, i could just use that module.
I think the primary value in doing the interactive stuff up front is
that if you have to debug other parts of the build process, you will not
have to keep answering the prompts. Additionally, it might be beneficial
later if, say the interactive functions were instrumented to allow for
scripts to supply answers to the interactive queries, so that debugging
multiple configs could be automated. I imagine if everyone put the
interactive stuff up front, this would be easier to implement.
> finally, in looking at y_n:
>
> my $answer;
> while (1) {
> $answer = $self->prompt(@_);
> return 1 if $answer =~ /^y/i;
> return 0 if $answer =~ /^n/i;
> print "Please answer 'y' or 'n'.\n";
> }
>
> any reason why the assignment to $answer isn't my'ed instead of doing it
> before the loop?
>
> inquiring minds want to know,
>
> uri
>
I'm guessing evolution, but Ken may have ulterior motives :-)
Regards,
Randy.
|