From f2f876e6bbfbf4c53f720dd9691e96c6d7eeff02 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Tue, 26 Oct 2010 14:04:50 +0200 Subject: spore2dot: refactor without read_from_json() --- utils/spore2dot.pl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'utils') diff --git a/utils/spore2dot.pl b/utils/spore2dot.pl index c59d79a..57588e9 100644 --- a/utils/spore2dot.pl +++ b/utils/spore2dot.pl @@ -11,7 +11,8 @@ pod2usage(1) unless scalar(@ARGV) > 0; my @specs; foreach (@ARGV) { - push @specs, read_from_json($_); + my $content < io $_; + push @specs, JSON::decode_json($content); } print << 'DOT'; @@ -73,13 +74,6 @@ foreach my $spec (@specs) { } print "}\n"; -sub read_from_json { - my ($fname) = @_; - - my $content < io $fname; - return JSON::decode_json($content); -} - __END__ =head1 NAME -- cgit v1.2.3