VCI::Util - Types and Utility Functions used by VCI
This contains mostly subtypes used by accessors in various VCI modules.
detaintUsed internally to detaint strings that are only used in safe ways.
Unsafe actions would include:
system or exec callsIPC::Run to call the command.)That is not a complete list. All VCI::VCS implementors are strongly encouraged to read perlsec.
Note that passing a string to IPC::Run is safe, because a shell is never invoked. If you are going to use IPC::Cmd, please see other VCI::VCS implementations for how to make it safe.
taint_failThis handles throwing errors or warnings under taint mode.
If we're in -t mode,
this just throws a warning.
If we're in -T mode,
this will throw an error using the message you pass.
Messages are thrown from the perspective of the caller, so the error is shown up as an error in the caller's code, not an error in VCI.
It takes one argument: the message to warn or die with.
VCI::Type::DateTimeA DateTime object.
If you pass in a number for this argument, it will be interpreted as a Unix epoch (seconds since January 1, 1970) and converted to a DateTime object using "from_epoch" in DateTime.
If you pass in a string that's not just an integer, it will be parsed by DateTime::Format::DateParse. (Note: If you don't specify a time zone in your string, it will be assumed your time is in the local time zone.)
VCI::Type::IntBoolThis is basically an Int that accepts undef and turns it into 0,
and converts a string into 1 if it represents a true value,
0 if it doesn't.
VCI::Type::PathA Path::Abstract object.
If you pass a string for this argument,
it will be converted using "new" in Path::Abstract.
This means that paths are always Unix paths--the path separator is always /.
\path\to\file will not work.
After processing,
the path will never start with / and never end with /.
(In other words,
it will always be a relative path and never end with /.)
If you pass the root path (/) you will get an empty path.