Parse:...rorItem(3pm)

πŸ“¦
version 0.27 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

Parse::ErrorString::Perl::ErrorItem β€” it's literally a Perl error item object, bestie. You're in the Parse:...rorItem(3pm) manual page, and yes, that name is giving cryptic but we move. πŸ’…


✨ DESCRIPTION ✨

okay so picture this: every one of these objects is a little backpack stuffed with accessors, and each accessor is one fact about one error. πŸŽ’

real talk though β€” only message, file, and line are guaranteed to be present for every error. The rest of these? They show up when they feel like it. So vibe-check before you use them, no cap.
  • type β€” normally hands you a single letter telling you what kind of error this is. The possible options are "W", "D", "S", "F", "P", "X", and "A". Sometimes an error can be of either of two types, and in that case you get a string like "S|F" back in scalar context, and a list of the two letters in list context. If type is empty, you can assume the error was not emitted by perl itself, but by the user or by a third-party module. πŸ‘€
  • type_description β€” a description of the error type. The possible options are:
W => warning
D => deprecation
S => severe warning
F => fatal error
P => internal error
X => very fatal error
A => alien error message

If the error can be of either of two types, the two types are concatenated with " or ". And heads up: this description is always returned in English, regardless of the lang option. periodt. 🌍

  • message β€” the error message. Just the message. The moment itself. πŸ’¬
  • file β€” the path to the file where the error happened, possibly truncated. If the error occurred in a script, the parser will attempt to return only the filename; if the error occurred in a module, the parser will attempt to return the path to the module relative to the directory in @INC in which it resides. Fancy, right? 🌸
  • file_abspath β€” absolute path to the file in which the error occurred. No truncation, no games. πŸ“
  • file_msgpath β€” the file path as displayed in which the error message. 🫢
  • line β€” line in which the error occurred. Simple. Iconic. ⭐
  • near β€” text near which the error occurred. Note that this often contains newline characters, so don't be surprised when it comes at you multiline. 😭
  • at β€” additional information about where the error occurred (e.g. "at EOF"). πŸ”
  • diagnostics β€” a detailed explanation of the error (from perldiag). If the lang option is specified when constructing the parser, an attempt will be made to return the diagnostics message in the appropriate language. And if an explanation is not found in the localized perldiag, the default perldiag will also be searched. It's returned as raw pod, so you may need to use a pod parser to render it into the format you actually need. Not me getting raw pod and needing a whole other tool to read it πŸ’€
  • stack β€” the callstack for the error. Returns a list of Parse::ErrorString::Perl::StackItem objects. The whole ancestry, the whole family tree, we love a paper trail. πŸ‘‘

# Copyright 2008-2013 The Padre development team as listed in Padre.pm.
# LICENSE
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl 5 itself.

So yeah β€” copyright 2008-2013 belongs to the Padre development team as listed in Padre.pm, and the license says this program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself. 🫑


and that's the whole page, bestie πŸ¦‹ this doc came to you courtesy of the User Contributed Perl Documentation, version perl v5.36.0, dated 2022-12-06 β€” go forth and parse those errors like the main character you are πŸ’–βœ¨

πŸ“¦ where this page comes from