ature 'say';
package Foo {
sub new {
my $class = shift;
my $val = 12345;
my $self = \$val;
bless($self, $class);
return $self;
}
sub hello {
my $self = shift;
return "I am ".$$self;
}
};
my $foo = Foo-&g
Hi All,
I needed to slightly alter the behaviour of a module I use in Perl.
In order to see the data structure I used Data:Dumper to get an output so I
could find the piece that I required for the change of logic.
To my shock and horror it gave me this:
$VAR1 = bless( do{\(my $o = '139790129395
> On Feb 3, 2017, at 7:17 PM, Ken Slater wrote:
>
> HTH
Yes, it does. Thanks to both you and Chas for the help.
Frank
On Fri, Feb 3, 2017 at 7:18 PM, SSC_perl wrote:
> I have the following sub that creates a log file using
> Data::Dumper. It also lists the name of each of the variables that it’s
> fed. It works great except for one problem - every line is appended with “
> = undef;” (minu
ption is to pass either a hashref or (as I have done below) a
list into your logging function:
#!/usr/bin/perl
use strict;
use Data::Dumper;
use File::Path;
use warnings;
my $database = "db1";
my @matches = ("foo", "bar", "baz");
my %image = (
I have the following sub that creates a log file using Data::Dumper.
It also lists the name of each of the variables that it’s fed. It works great
except for one problem - every line is appended with “ = undef;” (minus the
quotes).
I’ve tried stripping it out of $var_value
On Wed, Jun 01, 2011 at 09:07:45AM -0700, eventual wrote:
> use Data::Dumper;
>
> Hi,
> Can someone give me a few examples on the purpose of use Data::Dumper;
> I tried reading but I could not understand.
> Thanks
Data::Dumper is a useful modules for converting perl data struct
On Wed, Jun 1, 2011 at 6:07 PM, eventual wrote:
> use Data::Dumper;
>
> Hi,
> Can someone give me a few examples on the purpose of use Data::Dumper;
> I tried reading but I could not understand.
> Thanks
use Data::Dumper;
simply tells perl to load the Data::Dumper module. Yo
use Data::Dumper;
Hi,
Can someone give me a few examples on the purpose of use Data::Dumper;
I tried reading but I could not understand.
Thanks
On Sun, Jun 20, 2010 at 04:41, philge philip wrote:
> hi
>
> can someone tell me how i can sort by keys from a hash (huge data) stored
> using Data::Dumper?
snip
Data::Dumper can be configured through the use of its package
variables (or methods if you are using the OO version).
On Sunday 20 Jun 2010 11:41:42 philge philip wrote:
> hi
>
> can someone tell me how i can sort by keys from a hash (huge data) stored
> using Data::Dumper?
>
You need to do:
[code]
my @keys = sort { $a cmp $b } keys(%hash);
[/code]
Is it causing a memory overflow?
Regards,
hi
can someone tell me how i can sort by keys from a hash (huge data) stored using
Data::Dumper?
thanking you
philge
On 2010.05.18 00:58, Uri Guttman wrote:
> SB> Perhaps I completely missed something within the latter posts to this
> SB> thread, so I must ask...
>
> SB> ...why not:
>
> SB> use Storable;
>
> SB> ...to store temporary data? I understood what Uri said, but does
> SB> Storable not co
ng the dumper
>>> output with eval).
>>
>> By saving the output of Data::Dumper to a *.pm file, it can be reloaded
>> via "use".
SB> Perhaps I completely missed something within the latter posts to this
SB> thread, so I must ask...
SB> .
On 2010.05.17 00:12, Shawn H Corey wrote:
> On 10-05-16 11:17 PM, Uri Guttman wrote:
>> it can be used to save data (e.g. a config
>> file) in a file for reloading in the future (via running the dumper
>> output with eval).
>
> By saving the output of Data::Dumpe
#x27;t make much of a difference.
>>
>>
> Unless the parser is really slow, it shouldn't matter since this is a one
> time event.
>
> The thing about using Data::Dumper to store the configuration is that it is
> in Perl. You don't have to learn a second syntax t
YML,
but for a config file, I guess it wouldn't make much of a difference.
Unless the parser is really slow, it shouldn't matter since this is a
one time event.
The thing about using Data::Dumper to store the configuration is that it
is in Perl. You don't have to learn a secon
"Bob McConnell" wrote on 05/17/2010 02:26:58 PM:
> What is the difference between this and exporting a YAML file? Where
> would either be preferred over the other?
Except for the obvious syntax and that YAML might be easier to read for
"end users" that just happen to edit a config file, I guess t
Bob McConnell asked:
> >mBy saving the output of Data::Dumper to a *.pm file, it can be
> reloaded mvia "use".
> What is the difference between this and exporting a YAML file? Where
> would either be preferred over the other?
You don't need a YAML parser to rea
From: Shawn H Corey
>On 10-05-16 11:17 PM, Uri Guttman wrote:
>> it can be used to save data (e.g. a config
>> file) in a file for reloading in the future (via running the dumper
>> output with eval).
>m
>mBy saving the output of Data::Dumper to a *.pm file, it can be
r
On 10-05-17 12:22 AM, Uri Guttman wrote:
SHC> # Set maximum depth for Data::Dumper, zero means unlimited
SHC> local $Data::Dumper::Maxdepth = 0;
why do you localize some but not all of the dumper options? local will
make it work only for a call in this scope which is file scope.
>>>>> "SHC" == Shawn H Corey writes:
SHC> On 10-05-16 11:17 PM, Uri Guttman wrote:
>> it can be used to save data (e.g. a config
>> file) in a file for reloading in the future (via running the dumper
>> output with eval).
SHC> By sav
On 10-05-16 11:17 PM, Uri Guttman wrote:
it can be used to save data (e.g. a config
file) in a file for reloading in the future (via running the dumper
output with eval).
By saving the output of Data::Dumper to a *.pm file, it can be reloaded
via "use".
#!/usr/bin/perl
use s
>>>>> "PJ" == Peng, Jeff writes:
PJ> Dump the data structure for printing.
PJ> It's useful for checking the complex data strucure of Perl.
PJ> For example,
PJ> use Data::Dumper;
PJ> my %hash = ( 1 => [1,2,3,4],
PJ>
Dump the data structure for printing.
It's useful for checking the complex data strucure of Perl.
For example,
use Data::Dumper;
my %hash = ( 1 => [1,2,3,4],
2 => { 1 => { 2 => [3,4,5] } },
);
print Dumper \%hash;
Run it and see what is printing.
Als
What is the use of Data::Dumper module?
can any body please give examples?
Have been using perl for some time and never used this module. Not sure if i
am missing something by not using it.
Thanks,
-Ben
On Sat, Apr 25, 2009 at 21:45, Dan Fish wrote:
> I use Log::Dispatch frequently to set up both file and email logging. In
> the past I have also used it with Data::Dumper for logging in debug mode
> doing something like:
>
>
>
> $dispatcher->log(level => 'debug
I use Log::Dispatch frequently to set up both file and email logging. In
the past I have also used it with Data::Dumper for logging in debug mode
doing something like:
$dispatcher->log(level => 'debug', message
=>sprintf("%s",Data::Dumper(\$somevar)));
This
On Mon, Dec 29, 2008 at 00:40, mod_perl User wrote:
> Hello, I tried installing Data::Dumper module, getting error when i make the
> file. >makecc -c-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8
> -D_TS_ERRNO -xO3 -xspace -xildoff-DVERSION=\"2.121\"
Hello, I tried installing Data::Dumper module, getting error when i make the
file. >makecc -c-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8
-D_TS_ERRNO -xO3 -xspace -xildoff-DVERSION=\"2.121\"
-DXS_VERSION=\"2.121\" -KPIC "-I/usr/perl5/5.8.4
ee, which sub- and sub-sub-sub ( and whatever )
> >> > items inside are all hashes.
> >> >
> >> > and the next step I dealing with this hash tree is to use
> >> > Data::Dumper to dump it out.
> >> >
> >> > What I hope that the D
ide are all hashes.
>> >
>> > and the next step I dealing with this hash tree is to use
>> > Data::Dumper to dump it out.
>> >
>> > What I hope that the Data::Dumper result can keep the order as
>> > what I declared at very first. Is that anyway
Hi Owen,
2008/12/15 Chas. Owens
> On Mon, Dec 15, 2008 at 04:18, Panda-X wrote:
> > Hello,
> >
> > I have a hash tree, which sub- and sub-sub-sub ( and whatever )
> > items inside are all hashes.
> >
> > and the next step I dealing with this hash tree is
From: Panda-X
> I have a hash tree, which sub- and sub-sub-sub ( and whatever )
> items inside are all hashes.
>
> and the next step I dealing with this hash tree is to use
> Data::Dumper to dump it out.
>
> What I hope that the Data::Dumper result can keep the order as
On Mon, Dec 15, 2008 at 04:18, Panda-X wrote:
> Hello,
>
> I have a hash tree, which sub- and sub-sub-sub ( and whatever )
> items inside are all hashes.
>
> and the next step I dealing with this hash tree is to use
> Data::Dumper to dump it out.
>
> What I hope that
Hello,
I have a hash tree, which sub- and sub-sub-sub ( and whatever )
items inside are all hashes.
and the next step I dealing with this hash tree is to use
Data::Dumper to dump it out.
What I hope that the Data::Dumper result can keep the order as
what I declared at very first. Is that anyway
gt; data into a new array, I can't access individual elements of the
> array. Using data dumper, I see several variables that are undefined,
> in addition to the 3 digit wind directions that I'm looking to access
> individually via $wnddir[2] etc.
> My goal is to only have what
cess individual elements of the
array. Using data dumper, I see several variables that are undefined,
in addition to the 3 digit wind directions that I'm looking to access
individually via $wnddir[2] etc.
My goal is to only have what I'm trying to parse (wind directions of 3
digits each in th
he
array. Using data dumper, I see several variables that are undefined,
in addition to the 3 digit wind directions that I'm looking to access
individually via $wnddir[2] etc.
My goal is to only have what I'm trying to parse (wind directions of 3
digits each in this case) in my array that
On 8/27/07, nitesh kumar <[EMAIL PROTECTED]> wrote:
> Hi All,
> Can anybody suggest me how can I implement my own Data::Dumper(a function
> which work similar to perl Dumper).
>
> Thanks and Regards
> Nitesh
>
Before you implement your own version of Data::Dumper m
nitesh kumar schrieb:
> Hi All,
> Can anybody suggest me how can I implement my own Data::Dumper(a function
> which work similar to perl Dumper).
>
> Thanks and Regards
> Nitesh
>
I think "ref" is your friend.
perldoc -f ref
HTH, Martin
--
To unsubscribe
Hi All,
Can anybody suggest me how can I implement my own Data::Dumper(a function
which work similar to perl Dumper).
Thanks and Regards
Nitesh
(1,2);\n";
> $call = Bar->print_result(1,2);
>
> __END__
>
> package Bar;
>
> use strict;
> use warnings;
> use Data::Dumper 'Dumper';
>
> sub print_result{
> print Dumper [EMAIL PROTECTED];
> }
>
> 1;
Hi Charles,
Thank you very
his may be a more useful test.
use strict;
use warnings;
use Bar;
print "Sub routine call:\n\tBar::print_result(1,2);\n";
my $call = Bar::print_result(1,2);
print "\n\nMethod call:\n\tBar->print_result(1,2);\n";
$call = Bar->print_result(1,2);
__END__
package Bar
Hi all,
I write a small script to see what is the difference
between calling methods and regular subroutines. Then
I use Data::Dumper to see the data structure. What I
expecte is to print out a string(This is the data1 1
and data2 2) after using Dumper. But here are the
results I get from using
Hi List,
I'm having a little trouble with YAML. The current version of a script
uses Data::Dumper to keep running totals over multiple runs of the script
in a nested hash, as well as a couple of arrays to give other programs
hints about how to order the data (for, say, graphing). I'd
On Mon, 2006-15-05 at 17:46 -0700, chen li wrote:
> Hi all,
>
> I get data from Data::Dumper in an array format.
> I just wonder if there is a means to format the
> content in alphabetic order, something like "sort keys
> or sort values".
Data::Dumper can output has
Hi all,
I use the following script to find out the methods
available from a class of Bio::Seq.
#!c:/Perl/bin/Perl.exe
use warnings;
use strict;
use Bio::Seq;
use Data::Dumper;
use Class::Inspector;
my $methods=Class::Inspector->methods('Bio::Seq',
'full','public&
Jeff Pang schreef:
> print Dumper @sort;
I always go for the whole thing:
print Data:Dumper->Dump( [EMAIL PROTECTED], [qw(*sort)] );
perl -MData::Dumper -e '
@s = sort( 1, 7, 3, 2, 5 ) ;
print Data::Dumper->Dump( [ [EMAIL PROTECTED] ], [ qw(*s) ] )
'
@s = (
1,
>Jeff Pang wrote:
>
>: my @original=(...);
>: my @sort=sort {$a cmp $b} @original;
>: print Dumper @sort;
>
>You might like the results better using an array reference.
>
>print Dumper [EMAIL PROTECTED];
>
Sorry,my mistake.It's right really to use an array reference here.
--
Jeff Pang
NetEas
Jeff Pang wrote:
: my @original=(...);
: my @sort=sort {$a cmp $b} @original;
: print Dumper @sort;
You might like the results better using an array reference.
print Dumper [EMAIL PROTECTED];
Or you could avoid the extra array with the anonymous array
constructor (or is it an operator?
>
>I get data from Data::Dumper in an array format.
>I just wonder if there is a means to format the
>content in alphabetic order, something like "sort keys
>or sort values".
I would give you a simple way,you can sort the array and put the results into
another array
Hi all,
I get data from Data::Dumper in an array format.
I just wonder if there is a means to format the
content in alphabetic order, something like "sort keys
or sort values".
Thanks,
Li
__
Do You Yahoo!?
Tired of spam? Yahoo! Ma
Took the original code from AS Doc:
$Data::Dumper::Sortkeys = \&my_filter;
my $foo = { map { (ord, "$_$_$_") } 'I'..'Q' };
my $bar = { %$foo };
my $baz = { reverse %$foo };
print Dumper [ $foo, $bar, $baz ];
sub my_filter {
my
Dont do;
my $temp = join '', ;
do
my $temp = do {local $/; };
is faster.
For serialize, I use this code:
sub serializeSimple($)
{
my ($object) = @_;
my $Dumper = Data::Dumper->new([$object]);
$Dumper->Indent(0);
$Dumper->Purity(1);
$Dumper->
at to the core and use Data::Dumper to write a reference to my data to
> a file ("..." indicates an omitted hash of arrays of hashes):
>
> #!/usr/bin/perl -w
>
> use strict;
> use Data::Dumper;
>
> my %monate = ...
>
> open OUT, "> monate.dbm";
&
Hi all,
I want to store some complex data. My first solution made use of Storable, which
worked just fine. Now I learned that neither Storable nor MLDBM are available on the
machine I want to use the program on (and they cannot be made available).
So I retreat to the core and use Data::Dumper
since the
parameter-passing process need not change it in any way. Then the called
function can use it to access the original, intact structure:
Greetings! C:\>perl -w
use Data::Dumper;
my %entry;
$entry{"genre"} = '$genre';
$entry{"artist"} = '$ar
Tore Aursand wrote:
> On Thu, 30 Oct 2003 23:45:25 +0100, Kevin Pfeiffer wrote:
> > print Dumper(\$hash_ref);
>
> I guess $hash_ref already _is_ a hash reference, so you don't need to
> reference it again;
>
> print Dumper( $hash_ref );
>
Probably not. If it had been he would have gotten bette
On Thu, 30 Oct 2003 16:53:14 -0500, Dan Anderson wrote:
> my $dumper = Data::Dumper->new( [%entry], [ qw () ] );
> my $dumpedvalues = $dumper->Dump();
> print $dumpedvalues . "\n";
Why all this fuss? :-) I constantly use this syntax:
use Data::Dumper;
print Dumper(
On Thu, 30 Oct 2003 23:45:25 +0100, Kevin Pfeiffer wrote:
> print Dumper(\$hash_ref);
I guess $hash_ref already _is_ a hash reference, so you don't need to
reference it again;
print Dumper( $hash_ref );
--
Tore Aursand <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
In article <[EMAIL PROTECTED]>, Kevin Old
wrote:
[...]
> Yeah, I guess that's it. I'm not really sure how it works (yet), but I
> got it from Programming Perl. Here's that whole subsection:
Thanks. I see I just need to "do my homework".
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PR
t; $entry{"album"} = "Away from the Sun";
> > $entry{"disc"} = "Away from the Sun";
> > $entry{"file"} = "3dd.mp3";
> > $entry{"fullpath"} = "/mp3s/3dd";
> > $Data::Dumper::Purity =
ot;disc"} = "Away from the Sun";
> $entry{"file"} = "3dd.mp3";
> $entry{"fullpath"} = "/mp3s/3dd";
> $Data::Dumper::Purity = 1;
> print Data::Dumper->Dump( [\%entry], [ '*entry' ] );
> #my $dumpedvalues =
$entry{"file"} = $file;
> $entry{"fullpath"} = $fullpath;
>
> my $dumper = Data::Dumper->new( [%entry], [ qw () ] );
> my $dumpedvalues = $dumper->Dump();
> print $dumpedvalues . "\n";
>
> I get the following output:
>
>
in the form:
>
> $hash = {
>album => "Prose Combat",
> # etc...
> }
Try...
use Data::Dumper
print Dumper(\$hash_ref);
(If I understood what you mean)
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
When I use the following code to dump a hash:
$entry{"genre"} = $genre;
$entry{"artist"} = $artist;
$entry{"album"} = $album;
$entry{"disc"} = $disc;
$entry{"file"} = $file;
$entry{"fullpath"} = $fullpath;
m
;s hard to
use, you should try adding enhancements...
>main::dumpvalue() to dump out things (I guess that tells you how long!
>8-))
>
>I had a look at Data::Dumper - but its dumps are either too terse (i.e.
>all one line) or too verbose (i.e. I am dumping data structures and
>don
I have used Perl for a while, and always used dumpvar.pl /
main::dumpvalue() to dump out things (I guess that tells you how long!
8-))
I had a look at Data::Dumper - but its dumps are either too terse (i.e.
all one line) or too verbose (i.e. I am dumping data structures and
don't really ne
le:
> $profile = MY_PROFILE->new();
> $profile->{NAME} = "theName";
> $profile->{ARRAY} = [MY_OBJECT->new(), MY_OBJECT->new(), ...];
> $profile->myFunction(); # calls a method of MY_PRIOFILE
>
>
> I then use Data::Dumper to write
= "theName";
$profile->{ARRAY} = [MY_OBJECT->new(), MY_OBJECT->new(), ...];
$profile->myFunction(); # calls a method of MY_PRIOFILE
I then use Data::Dumper to write out a file with a header and an array
of profiles:
$Data::Dumper::Purity = 1;
$Data::Dum
On Tue, 2002-03-19 at 05:44, [EMAIL PROTECTED] wrote:
> heh - that was exactly half of what i was looking for - how to dump stuff! great :)
>
> mayby you can help me out with the second part too? :
>
> if i have a datastructure (a hash) dumped to a file using Data::Dumper,
>
heh - that was exactly half of what i was looking for - how to dump stuff! great :)
mayby you can help me out with the second part too? :
if i have a datastructure (a hash) dumped to a file using Data::Dumper,
how can i recreate the datastructure/hash in another program?
if i do something like
On Tue, 2002-03-19 at 04:11, [EMAIL PROTECTED] wrote:
> hi
>
> i have read the documentation on Data::Dumper from Learning Perl, Perl Cookbook and
>perldoc. however, im still very confused. im looking for some beginners documentation
>and examples. can anyone direct me?
>
hi
i have read the documentation on Data::Dumper from Learning Perl, Perl Cookbook and
perldoc. however, im still very confused. im looking for some beginners documentation
and examples. can anyone direct me?
:o)
martin
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
Robert,
I haven't been following your thread too closely, and have no knowledge of
Data::Dumper, but your description of your task makes me wonder if the
AnyData module would be of any assistance to you. It's on CPAN, and is a
module which allows you to work with a database-style
From: Robert Thompson <[EMAIL PROTECTED]>
> The more I thought about it, Data::Dumper has little to do with the
> exact problem I am having, but the way it works constricts me to
> using particular steps in my script. Data::Dumper is a utility to
> build
The more I thought about it, Data::Dumper has little to do with the exact
problem I am having, but the way it works constricts me to using particular steps in
my script. Data::Dumper is a utility to build simple text based databases. Basically
what it does is take input data, escapes
From: Robert Thompson <[EMAIL PROTECTED]>
> I am using Data:Dumper in a script and am running into a problem with
> "use strict" and eval. Basically the conundrum is that the data I
> will be loading from the Data::Dumper file is going to be based
Tuesday, December 11, 2001, 1:09:06 AM, Robert Thompson wrote:
> I am using Data:Dumper in a script and am running into a problem with "use
>strict" and eval. Basically the conundrum is that the data I will be loading from the
>Data::Dumper file is going
> to be
Hello List,
I am using Data:Dumper in a script and am running into a problem with "use
strict" and eval. Basically the conundrum is that the data I will be loading from the
Data::Dumper file is going to be based off input to the final script, so it may not be
the same for e
> -Original Message-
> From: mark crowe (JIC) [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 11:25 AM
> To: beginners
> Subject: eval and Data::Dumper
>
>
> Please can someone give me some advice about Data::Dumper. I
> have a program
Please can someone give me some advice about Data::Dumper. I have a program
which will generate a large multidimensional array which I then want to
import into another program. From what I remember from some posts a while
ago (and can't find again now) I should be able to do this using
>Could someone please help me translate this. All I can figure out for sure
>are the first 2 lines. For a class assignment we need to: Read the
>documentation on the Data::Dumper module (type 'perldoc Data::Dumper' ).
>Use it to display the contents of your data structu
Could someone please help me translate this. All I can figure out for
sure are the first 2 lines. For a class assignment we need to: Read
the documentation on the Data::Dumper module (type 'perldoc
Data::Dumper' ). Use it to display the contents of your data
structure. Thanks in a
85 matches
Mail list logo