Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.225.149.71
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : General.pm
package Data::Serializer::Config::General;
BEGIN { @Data::Serializer::Config::General::ISA = qw(Data::Serializer) }
use warnings;
use strict;
use Config::General;
use vars qw($VERSION @ISA);

$VERSION = '0.02';
sub options {
  return (shift)->{options};
}

sub serialize {
  my $self = (shift);
  my $ref = (shift);
  return (new Config::General(%{$self->options()}, -ConfigHash => $ref))->save_string();
}

sub deserialize {
  my $self = (shift);
  my $ref = (shift);
  my %hash =  (new Config::General(%{$self->options()}, -String => $ref))->getall();
  return \%hash;
}

1;

__END__

=head1 NAME

Data::Serializer::Config::General - Creates bridge between Data::Serializer and Config::General

=head1 SYNOPSIS

  use Data::Serializer::Config::General;

=head1 DESCRIPTION

Module is used internally to Data::Serializer

=head1 METHODS
                  
=over 4
                  
=item B<serialize> - Wrapper to normalize serializer method name

=item B<deserialize> - Wrapper to normalize deserializer method name

=item B<options> - Pass options through to underlying serializer


=back

=head1 CAVEAT

Base data structure to serialize must be a hash reference

=head1 AUTHOR

Thomas Linden <tom@daemon.de>

=head1 COPYRIGHT

  Copyright 2002 by Thomas Linden.  All rights reserved.
  This program is free software; you can redistribute it
  and/or modify it under the same terms as Perl itself.

=head1 SEE ALSO

perl(1), Data::Serializer(3), Config::General(3)

=cut
© 2025 GrazzMean