Astro-FITS-Header
view release on metacpan or search on metacpan
lib/Astro/FITS/Header.pm view on Meta::CPAN
Comment cards are a special case because they have no normal value and
their comment field is treated as the hash value. The keywords
"COMMENT" and "HISTORY" are magic and refer to comment cards; nearly all other
keywords create normal valued cards. (see "SIMPLE and END cards", below).
=head2 Multi-card values
Multiline string values are broken up, one card per line in the
string. Extra-long string values are handled gracefully: they get
split among multiple cards, with a backslash at the end of each card
image. They're transparently reassembled when you access the data, so
that there is a strong analogy between multiline string values and multiple
cards.
In general, appending to hash entries that look like strings does what
you think it should. In particular, comment cards have a newline
appended automatically on FETCH, so that
$hash{HISTORY} .= "Added multi-line string support";
adds a new HISTORY comment card, while
lib/Astro/FITS/Header.pm view on Meta::CPAN
# store key and value pair
#
# Multiple-line kludges (CED):
#
# * Array refs get handled gracefully by being put in as multiple cards.
#
# * Multiline strings get broken up and put in as multiple cards.
#
# * Extra-long strings get broken up and put in as multiple cards, with
# an extra backslash at the end so that they transparently get put back
# together upon retrieval.
#
sub STORE {
my ($self, $keyword, $value) = @_;
my @values;
# Recognize slash-delimited comments in value keywords. This is done
# cheesily via recursion -- would be more efficient, but less readable,
# to propagate the comment through the code...
( run in 0.339 second using v1.01-cache-2.11-cpan-a1d94b6210f )