Rebrand Perl plugin to HexChat,

Add /pl and plugin_pref

Add help messages
This commit is contained in:
Farow
2013-10-02 17:47:56 +03:00
committed by Eustachy Kapusta
parent aafbb6374b
commit 075cc61c94
10 changed files with 792 additions and 652 deletions

View File

@ -0,0 +1,33 @@
package HexChat::List::Network;
use strict;
use warnings;
use Storable qw(dclone);
my $last_modified;
my @servers;
sub get {
my $server_file = HexChat::get_info( "configdir" ) . "/servlist.conf";
# recreate the list only if the server list file has changed
if( -f $server_file &&
(!defined $last_modified || $last_modified != -M $server_file ) ) {
$last_modified = -M _;
@servers = ();
if( open my $fh, "<", $server_file ) {
local $/ = "\n\n";
while( my $record = <$fh> ) {
chomp $record;
next if $record =~ /^v=/; # skip the version line
push @servers, HexChat::List::Network::Entry::parse( $record );
}
} else {
warn "Unable to open '$server_file': $!";
}
}
my $clone = dclone( \@servers );
return @$clone;
}
1