<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Parse::FireDiamond - Parse Fire Diamond (NFPA 704) notation

VERSION
    This document describes version 0.001 of Parse::FireDiamond (from Perl
    distribution Parse-FireDiamond), released on 2023-03-28.

SYNOPSIS
     use Parse::FireDiamond qw(
         parse_fire_diamond_text
     );

     my $res = parse_fire_diamond_text(notation =&gt; 'H3/F2/R1/');

DESCRIPTION
    Keywords: chemicals, materials, hazardous, safety.

FUNCTIONS
  parse_fire_diamond_text
    Usage:

     parse_fire_diamond_text(%args) -&gt; [$status_code, $reason, $payload, \%result_meta]

    Parse Fire Diamond (NFPA 704) text notation.

    Examples:

    *   Parse the fire diamond for citric acid:

         parse_fire_diamond_text(notation =&gt; "H2/F1/R0/");

        Result:

         [
           200,
           "OK (parsed)",
           {
             fire_hazard_meaning   =&gt; "slightly hazardous",
             fire_hazard_number    =&gt; 1,
             health_hazard_meaning =&gt; "hazardous",
             health_hazard_number  =&gt; 2,
             reactivity_meaning    =&gt; "stable",
             reactivity_number     =&gt; 0,
           },
           {
             "func.fire_hazard_explanation"   =&gt; "",
             "func.health_hazard_explanation" =&gt; "Intense or continued but not chronic exposure could cause temporary incapacitation or possible residual injury (e.g. diethyl ether, ammonium phosphate, carbon dioxide, chloroform, DEET).",
             "func.reactivity_explanation"    =&gt; "",
           },
         ]

    *   Parse the fire diamond for sucrose:

         parse_fire_diamond_text(notation =&gt; "H0/F1/R0/");

        Result:

         [
           200,
           "OK (parsed)",
           {
             fire_hazard_meaning   =&gt; "slightly hazardous",
             fire_hazard_number    =&gt; 1,
             health_hazard_meaning =&gt; "normal material",
             health_hazard_number  =&gt; 0,
             reactivity_meaning    =&gt; "stable",
             reactivity_number     =&gt; 0,
           },
           {
             "func.fire_hazard_explanation"   =&gt; "",
             "func.health_hazard_explanation" =&gt; "Poses no health hazard, no precautions necessary and would offer no hazard beyond that of ordinary combustible materials (e.g. wood, sugar, salt, propylene glycol)",
             "func.reactivity_explanation"    =&gt; "",
           },
         ]

    *   Parse the fire diamond for sulfuric acid:

         parse_fire_diamond_text(notation =&gt; "H3/F0/R2/W+OX");

        Result:

         [
           200,
           "OK (parsed)",
           {
             fire_hazard_meaning   =&gt; "not flammable",
             fire_hazard_number    =&gt; 0,
             health_hazard_meaning =&gt; "extreme danger",
             health_hazard_number  =&gt; 3,
             reactivity_meaning    =&gt; "violent reaction",
             reactivity_number     =&gt; 2,
             specific_hazards      =&gt; [
                                        { meaning =&gt; "reacts with water", symbol =&gt; "W" },
                                        { meaning =&gt; "oxidizer", symbol =&gt; "OX" },
                                      ],
           },
           {
             "func.fire_hazard_explanation"   =&gt; "Materials that will not burn under typical fire conditions (e.g. carbon tetrachloride, silicon dioxide, perfluorohexane), including intrinsically noncombustible materials such as concrete, stone, and sand. Materials that will not burn in air unless exposed to a temperature of 820 \xC2\xB0C (1,500 \xC2\xB0F) for more than 5 minutes.",
             "func.health_hazard_explanation" =&gt; "Short exposure could cause serious temporary or moderate residual injury (e.g. liquid hydrogen, sulfuric acid, calcium hypochlorite, carbon monoxide, hexafluorosilicic acid, zinc chloride, sodium hydroxide)",
             "func.reactivity_explanation"    =&gt; "",
             "func.specific_hazards"          =&gt; [
                                                   {
                                                     explanation =&gt; "Reacts with water in an unusual or dangerous manner (e.g. caesium, sodium, diborane, sulfuric acid)",
                                                     symbol =&gt; "W",
                                                   },
                                                   {
                                                     explanation =&gt; "allows chemicals to burn without an air supply (e.g. potassium perchlorate, ammonium nitrate, hydrogen peroxide)",
                                                     symbol =&gt; "OX",
                                                   },
                                                 ],
           },
         ]

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   notation* =&gt; *str*

        (No description)

    Returns an enveloped result (an array).

    First element ($status_code) is an integer containing HTTP-like status
    code (200 means OK, 4xx caller error, 5xx function error). Second
    element ($reason) is a string containing error message, or something
    like "OK" if status is 200. Third element ($payload) is the actual
    result, but usually not present when enveloped result is an error
    response ($status_code is not 2xx). Fourth element (%result_meta) is
    called result metadata and is optional, a hash that contains extra
    information, much like how HTTP response headers provide additional
    metadata.

    Return value: (any)

HOMEPAGE
    Please visit the project's homepage at
    &lt;https://metacpan.org/release/Parse-FireDiamond&gt;.

SOURCE
    Source repository is at
    &lt;https://github.com/perlancar/perl-Parse-FireDiamond&gt;.

SEE ALSO
    Credits: explanation text are taken from Wikipedia page
    &lt;https://en.wikipedia.org/wiki/NFPA_704&gt;.

AUTHOR
    perlancar &lt;perlancar@cpan.org&gt;

CONTRIBUTING
    To contribute, you can send patches by email/via RT, or send pull
    requests on GitHub.

    Most of the time, you don't need to build the distribution yourself. You
    can simply modify the code, then test via:

     % prove -l

    If you want to build the distribution (e.g. to try to install it locally
    on your system), you can install Dist::Zilla,
    Dist::Zilla::PluginBundle::Author::PERLANCAR,
    Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two
    other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps
    required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE
    This software is copyright (c) 2023 by perlancar &lt;perlancar@cpan.org&gt;.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

BUGS
    Please report any bugs or feature requests on the bugtracker website
    &lt;https://rt.cpan.org/Public/Dist/Display.html?Name=Parse-FireDiamond&gt;

    When submitting a bug or request, please include a test-file or a patch
    to an existing test-file that illustrates the bug or desired feature.

</pre></body></html>