I have an array like
@boxed = ("1051","Bucket Man","yui87y","christmas","machine");
if I withdraw an element like so
print ("The second element is $boxed[1]");
All is fine and Bucket Man appears.
Then if I send the array to a data file thus.
$data_path = "saved.data";
$now = time();
open(O, ">$data_path");
print O "@boxed";
close(O);
Then retrieve it.
$data_file="saved.data";
open(DAT, $data_file) || die("Could not open file!");
@raw_data=<DAT>;
close(DAT);
print ("The second element inside array raw_data is $raw_data[1]");
Now Bucket man refuses to appear.
Its like by saving to data file and bringing back I have
destroyed the @array format or something.
How can I get Bucket Man back to work.?
I really have spent some time looking for the answer, but relative FAQ`s
Tend towards internet entwined network entangled complicated code.
I just simply need Bucket Man back on the job.
God bless Ya all.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.