NAME
File::Corresponding::File::Profile - The definition of what matches and translates to corresponding files
PROPERTIES
name
Name/description of this file profile.
sprintf
sprintf string to construct a file name. It should contain at least one % command to insert a relative file name.
Only used if defined.
regex : RegexRef
Regex matching a file. The first capture parens are used to extract the local file name.
If coerced from a string, define as qr$regex, i.e. specify the delimiters and any needed flags.
METHODS
matching_file_fragment($file) : ($file_base, $file_fragment) | ()
Return two item list with (the base filename, the captured file name fragment) from matching $file against regex, or () if nothing matched.
The $file_base is the $file, but with the whole matching regex removed, forming the basis for looking up corresponding files.
new_found_if_file_exists($matching_profile, $file_base, $fragment) : File::Found | ()
Return a new File::Corresponding::File::Found object if a file made up of $file_base, this profile, and $fragment exists in the filesystem.
If not, return ().
SUBROUTINES
rex_from_qr($rex_string) : RegexRef
Convert $rex_string to a proper Regex ref, or die with a useful error message.