YAML can save objects into a file:
use strict; use YAML::Any; use DateTime; my $dt = DateTime->new( year => 1964, month => 10, day => 16, hour => 16, minute => 12, second => 47, nanosecond => 500000000, time_zone => 'Asia/Taipei', ); print Dump($dt);
Output:
--- !!perl/hash:DateTime formatter: ~ local_c: day: 16 day_of_quarter: 16 day_of_week: 5 day_of_year: 290 hour: 16 minute: 12 month: 10 quarter: 4 second: 47 year: 1964 local_rd_days: 717260 local_rd_secs: 58367 locale: !!perl/hash:DateTime::Locale::en_US default_date_format_length: medium default_time_format_length: medium en_complete_name: English United States en_language: English en_territory: United States id: en_US native_complete_name: English United States native_language: English native_territory: United States offset_modifier: 0 rd_nanosecs: 500000000 tz: !!perl/hash:DateTime::TimeZone::Asia::Taipei is_olson: 1 max_year: 2018 name: Asia/Taipei spans: - - -1.#INF - 59800434840 - -1.#INF - 59800464000 - 29160 - 0 - LMT - - 59800434840 - 61357104000 - 59800463640 - 61357132800 - 28800 - 0 - CT - - (... SNIP ...) - - 62474770800 - 1.#INF - 62474799600 - 1.#INF - 28800 - 0 - CST utc_rd_days: 717260 utc_rd_secs: 29567 utc_year: 1965

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James


In reply to Re: BBCode Parser in configuration file by CountZero
in thread BBCode Parser in configuration file by Pr0t0n

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.