Config::Eggdrop::Userfile - parse userfiles generated by Eggdrop
If you want to read from a file handle, you can use something like this:
use Config::Eggdrop::Userfile; open my $fh, '<', '/path/to/eggdrop/userfile'; my $parsed = Config::Eggdrop::Userfile::parse_file $fh;
Or, provided that you have a userfile read into $content, you can read from a string:
use Config::Eggdrop::Userfile; my $parsed = Config::Eggdrop::Userfile::parse_string $content;
This is a fairly simple regex-based parser module for Eggdrop userfiles. Eggdrop userfiles contain information (including passwords) about eggdrop partyline user accounts.
These functions are in @EXPORT_OK.
@EXPORT_OK
Parses a file from a file handle and returns a hashref with the following layout:
{ 'botnetnick' => 'foo', # eggdrop nickname as mentioned in the comment in line 1 'invites' => { # invites configured in the bot '#foo' => [...], '#bar' => [...], 'global' => [...] }, 'version' => 'v1.6.21', # eggdrop version 'bans' => { # bans configured in the bot '#foo' => [...], '#bar' => [...] }, 'lines' => 25, # number of lines in this user file 'exempts' => { # ban exempts configured in the bot '#foo' => [...], 'global' => [ # global exempts (on all channels) { 'hostmask' => '*!something@something', # exempt hostmask 'creator' => 'someone', # handle of the person who created this exempt 'sticky' => 1, # sticky exempt? 'reason' => 'paranoia', 'last' => 1366930011, 'expire' => 0, 'perm' => 1 # permanent exempt? }, ... ], ... }, 'users' => { 'somebody' => { # eggdrop handle as lowercase 'case' => 'SomeBodY', # correct case of the handle as stored in the user file 'created' => 1356108279, 'hosts' => [ '*!*@example.com', ... ], 'pass' => 'encrypted password', 'channels' => { '#foo' => { 'flags' => 'lo', # channel flags 'laston' => 1367584282 # when were they last on this channel }, ... }, 'flags' => '', # global flags 'laston' => { 'time' => 1367584282, # global laston time 'channel' => '#foo' # on which channel were they seen? } }, } };
Depending on the entries present in the user file, some of these indexes may be undefined.
Does the same, but takes its input from a string
Moritz Wilhelmy <mw@barfooze.de>
Authen::Passphrase::EggdropBlowfish for authenticating against Eggdrop passwords.
Copyright © 2013-2015 by Moritz Wilhelmy
This module may be copied and distributed under the same terms as perl 5 itself.
See the development homepage at https://bitbucket.org/wilhelmy/p5-config-eggdrop-userfile/ for recent changes.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '©'. Assuming UTF-8
To install Config::Eggdrop::Userfile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Eggdrop::Userfile
CPAN shell
perl -MCPAN -e shell install Config::Eggdrop::Userfile
For more information on module installation, please visit the detailed CPAN module installation guide.