[Rt-commit] r19342 - rt/3.999/branches/config-in-db/sbin
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Fri Apr 24 08:29:32 EDT 2009
Author: sunnavy
Date: Fri Apr 24 08:29:31 2009
New Revision: 19342
Modified:
rt/3.999/branches/config-in-db/sbin/rt-update-config
Log:
Data::Dump can print only values, we do *not* need to fiddle Data::Dumper's outputs anymore :)
Modified: rt/3.999/branches/config-in-db/sbin/rt-update-config
==============================================================================
--- rt/3.999/branches/config-in-db/sbin/rt-update-config (original)
+++ rt/3.999/branches/config-in-db/sbin/rt-update-config Fri Apr 24 08:29:31 2009
@@ -55,6 +55,7 @@
}
use Getopt::Long;
+use Data::Dump qw/dump/;
my %args;
die "unknown option"
@@ -74,7 +75,6 @@
print 'updated with success' . "\n";
}
else {
- use Data::Dumper;
my %doc;
if ( ! $args{'without-doc'} ) {
@@ -123,9 +123,7 @@
if ( $args{show} ) {
for my $name ( sort keys %map ) {
- my $value = Data::Dumper->Dump( [ $map{$name} ], [''] );
- $value =~ s/^\$ = //;
- $value =~ s/;\s*$//;
+ my $value = dump( $map{$name} );
print "$name: $value\n";
}
}
@@ -133,9 +131,7 @@
my $to_be_edited = '';
for my $name ( sort keys %map ) {
$to_be_edited .= $doc{$name} || '';
- my $value = Data::Dumper->Dump( [ $map{$name} ], [''] );
- $value =~ s/^\$ = //;
- $value =~ s/;\s*$//;
+ my $value = dump( $map{$name} );
$to_be_edited .= "set( $name => $value );\n";
$to_be_edited .= "\n"
if $doc{$name}; # add an extra blank line to ease eyes
More information about the Rt-commit
mailing list