commit f17992d3c59761bfcb1fe2798552ca6595a0222e from: Izzy Blacklock date: Fri Aug 04 23:26:39 2023 UTC Moved creating arrays from strings to IRCNOW::IO::IRC::new() commit - 6be16d90c2213d61bf83fc1306d62ea0917d5845 commit + f17992d3c59761bfcb1fe2798552ca6595a0222e blob - 37959c6e810c6e626b717ec160ca5eac51091798 blob + 6999701c24c420fe883abffc3ff8a6ec8b61555f --- lib/IRCNOW/IO/IRC.pm +++ lib/IRCNOW/IO/IRC.pm @@ -35,17 +35,23 @@ sub new { networks => \@networks, }; # verify we have all required params - my @required = qw(networks localnet nick host port pass); + my @required = qw(networks stafflocalnet nick host port pass expires chans teamchans); for my $param (@required) { die "Required param '$param' missing in IRCNOW::IO::IRC::new()" unless exists $options->{$param}; $self->{$param} = $options->{$param}; } - my @optional = qw{stafflist}; - for my $param (@optional) { - $self->{$param} = $options->{$param}; + # Turn strings into arrays + # {staff} needs to remain a string; {stafflist} is the array version + $self->{stafflist} = $self->{staff}; + for my $param (qw(networks stafflist chans teamchans)) { + $self->{$param} = [split(/[,\s]+/m, $self->{$param}] +print Dumper($self->{$param}); } + # Set global for non-oop calls + $localnet = $self->{localnet}; + bless $self, $class; # Create the sockets @@ -507,3 +513,4 @@ sub run { 1; +