| Perlbug documentation | Contained in the Perlbug distribution. |
Perlbug::Utility - Object handler for Utility methods
Utility wrapper for Perlbug modules usage
use Perlbug::Utility; print Perlbug::Utility->new()->dump;
Create new Perlbug::Utility object.
my $o_ute = Perlbug::Utility->new;
Wraps Dumper() and dumps given args
print $o_ute->dump($h_data);
Encodes and dumps given args
print $o_ute->html_dump($h_data);
Richard Foley perlbug@rfi.net 2001
| Perlbug documentation | Contained in the Perlbug distribution. |
# Perlbug javascript routines # (C) 2000 Richard Foley RFI perlbug@rfi.net # $Id: Utility.pm,v 1.2 2002/01/25 16:12:58 richardf Exp $ #
package Perlbug::Utility; use Data::Dumper; use HTML::Entities; use strict; use vars qw(@ISA $VERSION); $VERSION = do { my @r = (q$Revision: 1.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; $| = 1; use CGI;
sub new { my $proto = shift; my $class = ref($proto) || $proto; bless({}, $class); }
sub dump { my $self = shift; my @args = @_; my $res = "rjsf dump: \n"; my $i_cnt = 0; foreach my $arg (@args) { $res .= "\t$i_cnt($arg): ".Dumper(\$arg); $i_cnt++; } $res .= "\n"; return $res; }
sub html_dump { my $self = shift; my @args = @_; my $res = "<table>\n<tr><td>rjsf html_dump: </td></tr>\n"; my $i_cnt = 0; foreach my $arg (@args) { $res .= qq|<tr><td>$i_cnt($arg): <pre>|.Dumper($arg).qq| </pre></td></tr>\n|; $i_cnt++; } $res .= "</table>\n"; return $res; }
1