™.. CPAN::Distroprefs - Online Linux Manual PageSection : 3pm
Updated : 2009-05-26
Source : perl v5.10.1
Note : Perl Programmers Reference Guide

NAMECPAN::Distroprefs −− read and match distroprefs

SYNOPSIS​ use CPAN::Distroprefs; ​ ​ my %info = (... distribution/environment info ...); ​ ​ my $finder = CPAN::Distroprefs−>find($prefs_dir, \%ext_map); ​ ​ while (my $result = $finder−>next) { ​ ​ die $result−>as_string if $result−>is_fatal; ​ ​ warn($result−>as_string), next if $result−>is_warning; ​ ​ for my $pref (@{ $result−>prefs }) { ​ if ($pref−>matches(\%info)) { ​ return $pref; ​ }}}

DESCRIPTIONThis module encapsulates reading Distroprefs and matching them against CPAN distributions.

INTERFACE​ my $finder = CPAN::Distroprefs−>find($dir, \%ext_map); ​ ​ while (my $result = $finder−>next) { ... } Build an iterator which finds distroprefs files in the given directory. %ext_map is a hashref whose keys are file extensions and whose values are modules used to load matching files: { ​ 'yml' => 'YAML::Syck', ​ 'dd' => 'Data::Dumper', ​ ... ​ } Each time \*(C`$finder\->next\*(C'\fR is called, the iterator returns one of two possible values: • a CPAN::Distroprefs::Result object • \*(C`undef\*(C'\fR, indicating that no prefs files remain to be found

RESULTS\*(C`find()\*(C'\fR returns CPAN::Distroprefs::Result objects to indicate success or failure when reading a prefs file.

CommonAll results share some common attributes: type \*(C`success\*(C'\fR, \f(CW\*(C`warning\*(C'\fR, or \f(CW\*(C`fatal\*(C'\fR file the file from which these prefs were read, or to which this error refers (relative filename) ext the file's extension, which determines how to load it dir the directory the file was read from abs the absolute path to the file

ErrorsError results (warning and fatal) contain: msg the error message (usually either $! or a YAML error)

SuccessesSuccess results contain: prefs an arrayref of CPAN::Distroprefs::Pref objects

PREFSCPAN::Distroprefs::Pref objects represent individual distroprefs documents. They are constructed automatically as part of \*(C`success\*(C'\fR results from \f(CW\*(C`find()\*(C'\fR. data the pref information as a hashref, suitable for e.g. passing to Kwalify match_attributes returns a list of the valid match attributes (see the Distroprefs section in CPAN) currently: \*(C`env perl perlconfig distribution module\*(C'\fR has_any_match true if this pref has a 'match' attribute at all has_valid_subkeys true if this pref has a 'match' attribute and at least one valid match attribute matches ​ if ($pref−>matches(\%arg)) { ... } true if this pref matches the passed-in hashref, which must have a value for each of the \*(C`match_attributes\*(C'\fR (above)

LICENSEThis program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
0
Johanes Gumabo
Data Size   :   14,479 byte
man-CPAN::Distroprefs.3pmBuild   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   5 / 257,414
Visitor ID   :     :  
Visitor IP   :   18.119.135.231   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|252|CPAN::Distroprefs.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|CPAN::Distroprefs.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|252|CPAN::Distroprefs.3pm|41|br══─}─══|'br══─}─══ )         (htmlprn|149|CPAN::Distroprefs.3pm|41|'br══─}─══ |'br══─}─══ )         (rof_nr_x|149|CPAN::Distroprefs.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (rof_unit_scale_px|41|CPAN::Distroprefs.3pm|51/52|F|.ie \nF ══─{─══. de IX )         (rof_if|19|CPAN::Distroprefs.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (htmlprn|149|CPAN::Distroprefs.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX )         (rof_escape_sequence|91|CPAN::Distroprefs.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2" )         (parse_manual_page_|252|CPAN::Distroprefs.3pm|57|══─}─══|.══─}─══ )         (htmlprn|149|CPAN::Distroprefs.3pm|57|.══─}─══ |.══─}─══ )         (rof_escape_sequence|91|CPAN::Distroprefs.3pm|180|\*(C`$finder\->next\*(C'\fR is called, the iterator returns one of two |Each time \f(CW\*(C`$finder\->next\*(C'\fR is called, the iterator returns one of two )         (rof_escape_sequence|91|CPAN::Distroprefs.3pm|185|\*(C`undef\*(C'\fR, indicating that no prefs files remain to be found |\&\f(CW\*(C`undef\*(C'\fR, indicating that no prefs files remain to be found )         (rof_escape_sequence|91|CPAN::Distroprefs.3pm|188|\*(C`find()\*(C'\fR returns CPAN::Distroprefs::Result objects to |\&\f(CW\*(C`find()\*(C'\fR returns CPAN::Distroprefs::Result objects to )         (rof_escape_sequence|91|CPAN::Distroprefs.3pm|197|\*(C`success\*(C'\fR, \f(CW\*(C`warning\*(C'\fR, or \f(CW\*(C`fatal\*(C'\fR |\&\f(CW\*(C`success\*(C'\fR, \f(CW\*(C`warning\*(C'\fR, or \f(CW\*(C`fatal\*(C'\fR )         (rof_escape_sequence|91|CPAN::Distroprefs.3pm|237|\*(C`success\*(C'\fR results from \f(CW\*(C`find()\*(C'\fR. |They are constructed automatically as part of \f(CW\*(C`success\*(C'\fR results from \f(CW\*(C`find()\*(C'\fR. )         (rof_escape_sequence|91|CPAN::Distroprefs.3pm|249|\*(C`env perl perlconfig distribution module\*(C'\fR |currently: \f(CW\*(C`env perl perlconfig distribution module\*(C'\fR )         (rof_escape_sequence|91|CPAN::Distroprefs.3pm|269|\*(C`match_attributes\*(C'\fR (above) |each of the \f(CW\*(C`match_attributes\*(C'\fR (above) )