User Control Panel
Advertisements

HELP US, HELP YOU!

Data Dumper

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Wed Jan 21, 2004 7:57 pm    Post subject: Reply with quote

Hey, I have a question about Data::Dumper.

How do you set the variable you're "dumping" into another variable that can actually be used, like an array or something.

Like if you have $jumble and do
Code:
print "Variable: $jumble\n\n";<br />print Dumper($jumble);


And get something like this...

Code:
Variable: ARRAY(434322x0)<br /><br />$VAR1 = [<br />   (what Data::Dumper printed as the contents)<br />];


Ok, so there's a jumbled up array that you use Data::Dumper for, but it always uses "$VAR1" which isn't an array, so foreach $VAR1 loops wouldn't work.

Anyway, the question is, can you get the contents of a jumbled up variable into an array or associative array?
Back to top
eric256
The Keymaker
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Wed Jan 21, 2004 8:07 pm    Post subject: Reply with quote

$VAR1 would be a reference to an array in that case. Data::Dumper does not put the stuff into var1 thougt. It makes a string which can then be evaled to get the same data structure back

In this way you can store a whole hash or array into a file as text and reload it later.

_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Thu Jan 22, 2004 1:47 am    Post subject: Reply with quote

Aha. I can probably go from there.

I decided to try writing an e-mail POP/SMTP server again and route my domains to it, lol. But then I remembered that the things being sent were all in ARRAYS and SCALARS and I couldn't figure out anything with the Data-Dumper to help me situation any.

But I have lots of ideas of features to put into it, like some ideas for spam protection that other free e-mail providers don't have. Razz
Back to top
Myzterio
Not Yet a God
Not Yet a God


Joined: 13 Dec 2003
Posts: 429

Reputation: 38.1Reputation: 38.1Reputation: 38.1Reputation: 38.1

PostPosted: Thu Jan 22, 2004 3:50 am    Post subject: Reply with quote

Wats the Data Dumper? Is it need To be used to make a specific command?
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Thu Jan 22, 2004 4:08 am    Post subject: Reply with quote

http://search.cpan.org/~ilyam/Data-Dumper-2.121/Dumper.pm
read the name of it slowly, shouldnt be hard to figure out what it does
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group