|
| Author |
Message |
Nate God Like

Joined: 12 Nov 2003 Posts: 553
    
|
Posted: Wed Jan 21, 2004 7:57 pm Post subject: |
|
|
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

Joined: 03 May 2006 Posts: 2292 Location: Colorado
     
|
Posted: Wed Jan 21, 2004 8:07 pm Post subject: |
|
|
$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

Joined: 12 Nov 2003 Posts: 553
    
|
Posted: Thu Jan 22, 2004 1:47 am Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
Myzterio Not Yet a God

Joined: 13 Dec 2003 Posts: 429
    
|
Posted: Thu Jan 22, 2004 3:50 am Post subject: |
|
|
| Wats the Data Dumper? Is it need To be used to make a specific command? |
|
| Back to top |
|
 |
Keenie Almost An Agent

Joined: 31 Oct 2003 Posts: 1071
 
|
|
| Back to top |
|
 |
|