On Wed, 27 Jun 2001, Doug MacEachern wrote:
> On Thu, 28 Jun 2001, Stas Bekman wrote:
>
> > So if I add a new feature and want to add it via source_scan, only you can
> > do that if don't want to overwrite each others version of
> > xs/tables/current/Apache/FunctionTable.pm. Do you think we should make
> > sourcescan produce an identical code, no matter what machine it's running
> > on ( I suppose this is just an issue of sorting the keys before dumping
> > the datastructures).
>
> if you can make that happen, that would be cool. but i think it depends
> on Data::Dumper, which doesn't have a sort option that i know of.
First we can use Data::Denter which sorts the keys. Now it's output is not
suitable for strightforward require(), so the manpage suggests:
For example if you wanted to set up a config file with 3
options, you might choose a format like this:
option1 => value1
option2 => value2
option3 => @
sub-value-a
sub-value-b
To read this into Perl you could say:
use Data::Dumper;
use Data::Denter;
$Data::Denter::HashMode = 1;
open CONFIG, 'config' or die $!;
my %config = Undent join '', <CONFIG>;
print Dumper \%config;
So we store the keys sorted and easily maintainable. And only need to
preprocess with Data::Dumper to deserialize.
Alternatively, since we know what data we want to dump (only arrays,
hashes and scalars), a simple function which generates the output like
Dumper but sorted will do.
> in the meantime, if you want to add a new feature to source_scan.pl you
> can do that without checking in the changed xs/tables
ok
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]