Data::...operty(3pm)
π Data::ICal::Property π
okay bestie, so this one comes from the User Contributed Perl Documentation corner of the perl world, and it's literally the little building block that iCalendar files are made of. slay.
β¨ NAME β¨
Data::ICal::Property β no cap, it represents a property on an entry in an iCalendar file π
πΈ DESCRIPTION πΈ
So a Data::ICal::Property object is one single property sitting on an entry inside an iCalendar file. and the thing you gotta know is that properties don't just have a value β they have parameters too. it's giving layered. it's giving complexity. obsessed.
ngl, you really shouldn't be creating Data::ICal::Property values directly β that's not your job, bestie, that's the module's job. just use add_property in Data::ICal::Entry and let it handle the vibes for you π«Ά
Here's the tea on the encoding parameter though: the actual value of encoding is only ever interpreted by Data::ICal inside the decoded_value and encode methods. every single other method goes straight for the encoded version (if there even is an encoding). so like, don't expect the other methods to do your decoding for you, okay? π
and currently? the only supported encoding is QUOTED-PRINTABLE. that's it. that's the list. periodt. π
π METHODS π
β new $key, $value, [$parameter_hash]
Creates a brand new Data::ICal::Property with key $key and value $value. iconic behaviour honestly.
If $parameter_hash is provided, it sets the property's parameters to it. and here's the rules for that hash, so listen up:
- the keys have to equal the names of the parameters, and they're case insensitive β so whatever you do, don't put two different keys in there that end up being the same once you convert them to upper case, that's just messy π
- the values should be a string if the parameter has a single value, or an array reference of strings if the parameter has multiple values π
β key [$key]
Gets or sets the key name of this property. cute and simple. we love a low-maintenance method π
β value [$value]
Gets or sets the value of this property. yes bestie, just the value. that's the whole method. sometimes it's really that easy β¨
β parameters [$param_hash]
Gets or sets the parameter hash reference of this property. heads up though: parameter keys get converted to upper case. so don't come crying when your lowercase keys aren't lowercase anymore π
β vcal10 [$bool]
Gets or sets a boolean that says whether this should be interpreted as vCalendar 1.0 (as opposed to iCalendar 2.0). and generally? you can just chill and set this on your main Data::ICal object when you construct it, because:
add_entryautomatically makes sure sub-entries end up with the same value as their parents π§add_propertymakes sure properties end up with the same value as their entry π
so it just trickles down. main character energy, honestly.
β decoded_value
Gets the value of this property, converted from the encoding specified in its encoding parameter. so to be clear: value gives you back the encoded version, and this one applies the encoding for you. π
and if the encoding isn't specified, or it's just not a recognized one? it just returns the raw value. no drama. we move on π¦
β encode $encoding
This one calls decoded_value to grab the current decoded value, then encodes it in $encoding, sets the value to that, and sets the encoding parameter to $encoding. (and yeah, $encoding gets converted to upper case first, obviously π
)
If $encoding is undef, it deletes the encoding parameter and sets the value to the decoded value. and if the encoding just isn't recognized? it does nothing. literally nothing. it simply does not engage π
β as_string ARGS
Returns the property formatted as a string β including the trailing newline, don't forget it bestie πΈ
Takes named arguments:
foldβ Defaults to true. pass in a false value if you need to generate non-rfc-compliant calendars. (living dangerously, i see π«£)crlfβ Defaults to"\x0d\x0a", per RFC 2445 spec. This option is primarily for backwards compatibility with version of this module prior to 0.16, which used"\x0a". throwback vibes fr fr.
π AUTHOR π
Best Practical Solutions, LLC <modules@bestpractical.com>
π LICENCE AND COPYRIGHT π
Copyright (c) 2005 - 2020, Best Practical Solutions, LLC. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
and that's the whole page bestie, ty for coming to my ted talk π this was generated with perl v5.36.0, dated 2022-10-14, and honestly? it ate. periodt π β¨
π¦ where this page comes from
- ubuntu noble: libdata-ical-perl 0.24+dfsg-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-ical-perl 0.24+dfsg-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-ical-perl 0.24+dfsg-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms