|
NAMEText::Authinfo - read, query and write authinfo filesVERSIONVersion 0.01STATUSThis package should be considered new and untested. Please use at your own risk.CAVEATSUsers should note that authinfo files are without a formal specification. I have referred to resources that claim authority, particularlyhttp://www.gnu.org/software/emacs/manual/html_node/gnus/NNTP.html (see "nntp-authinfo-function") It should be noted that this library supports a subset of files as described here, not arbitrary key/value pairs as hinted at in the description provided by gnu.org. SYNOPSISuse Text::Authinfo; my $a = Text::Authinfo->new(); my $read_success = $a->readauthinfo(); print $a->as_string(); my $pw = $a->getauth('machine.example.com','me@example.com','9999'); my $write_success = $a->writeauthinfo(); PACKAGE VARIABLES$authinfofile - the full path of the authinfo file used by default, which points to ~/.authinfo.OBJECT VARIABLESFILE - the full filename path for the authinfo fileAUTHINFO - the nested hashrefs denoting the authinfo data. This is of the form: $a->{AUTHINFO}->{$machine}->{$port}->{$login} = $password; SUBROUTINES/METHODSnewmy $a1 = Text::Authinfo->new(); my $a2 = Text::Authinfo->new('/home/me/.otherauthinfofile'); The constructor has an optional argument that can be used to stipulate an alternative authinfofile to use. readauthinfomy $read_success = $a->readauthinfo(); Reads the authinfofile data into "$a->{AUTHINFO}". Returns 1 for success, 0 otherwise. as_stringprint $a->as_string(); writeauthinfomy $write_success1 = $a1->writeauthinfo(); my $write_success2 = $a2->writeauthinfo({'nobackup'=>1}); Writes the contents of "$a->{AUTHINFO}" into "$a->{FILE}", while creating a backup file with the same path as "$a->{FILE}", but with '.bak' appended. Passing a hashref with "nobackup" set will prevent this behavior. Note! this function will overwrite your existing authinfo file. This can be dangerous! Keep backups. The file written will have mode 0600 applied. getauthmy $pw = $a->getauth('machine.example.com','me@example.com','9999'); my $pw = $a->getauth('machine.example.com','me@example.com'); This function retrieves your password. The required arguments are determined by the contents of the line for each auth. If a port was mandated, you must pass that in as the third parameter as in the first example above. Otherwise, if the auth line in question did not contain a port, do not pass one in here. This function returns undef if no match is found. AUTHORbrad clawsie, "<bclawsie at cpan.org>"BUGSPlease report any bugs or feature requests to "bug-file-authinfo at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-Authinfo>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.SUPPORTYou can find documentation for this module with the perldoc command.perldoc Text::Authinfo You can also look for information at:
CONTRIBUTINGSee the public git repository at:<https://github.com/xylabs/perl-Text-Authinfo> LICENSE AND COPYRIGHTCopyright 2011 brad clawsie.This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information.
Visit the GSP FreeBSD Man Page Interface. |