From e4217b715895440cca4d736fcdff383c0caa15ce Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Wed, 5 Apr 2017 23:30:51 +0200 Subject: [PATCH] rm --- bin/inspect.pl | 86 -------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 bin/inspect.pl diff --git a/bin/inspect.pl b/bin/inspect.pl deleted file mode 100644 index f248cc0..0000000 --- a/bin/inspect.pl +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/perl -w - -# Copyright (c) 2015-2017 T.v.Dein . All -# Rights Reserved. Std. disclaimer applies. Artistic License, same as -# perl itself. Have fun. - -# This script can be used to interactively browse perl data -# structures, which it reads from STDIN or a file. You can use it, for -# instance, by printing some data structure in your application using -# Data::Dumper and piping this output into this scripts input. - -# If the data structure evaulates, you'll be dropped into an interactive -# prompt. Enter '?' to get help. - -# The script also demonstrates how to use different serializers. - -use Data::Interactive::Inspect; -use Data::Dumper; -use strict; - -sub usage { - print STDERR qq( -Usage: $0 - -Reads a perl data structure from . If is -, read from -STDIN. Evaluates and start an interactive Data::Interactive::Inspect -shell, which can be used to analyze the data. -); - exit 1; -} - - -my $arg = shift; -my $code; - -if (! $arg) { - usage; -} - -if ($arg ne '-' && ! -e $arg) { - print STDERR "$arg not found or not readable!\n"; - usage; -} - -if ($arg eq '-') { - $code = join '', <>; -} -else { - open CODE, "<$arg" or die "Could not open data file $arg: $!\n"; - $code = join '', ; - close CODE; -} - -# var name? throw away -$code =~ s/^\s*\$[a-zA-Z0-9_]*\s*=\s*/\$code = /; -eval $code; - -if ($@) { - print STDERR "Parser or Eval error: $@!\n"; - exit 1; -} -else { - Data::Interactive::Inspect->new(struct => $code, - serialize => sub { my $db = shift; - my $c = Dumper($db); - $c =~ s/^\s*\$[a-zA-Z0-9_]*\s*=\s*/ /; - return $c; - }, - deserialze => sub { my $code = shift; - $code = "\$code = $code"; - eval $code; - return $code; - }, - )->inspect; -} - - - - - - - - - - -