All pastes #336158 Raw Edit

Something

public text v1 · immutable
·published 2007-02-01 21:07 UTC
rendered paste body
elsif (($input =~ /^:(.*)$/) && ($input =~ /\!/) && ($input =~ /\~/)) {
      (my $in_from, my $in_command, my $in_arg, my $in_msg) = split(' ',$input);
      (my $in_nickident, my $in_hostmask) = split('@',$in_from);
      (my $in_nick, my $in_ident) = split('!',$in_nickident);

      if (substr($in_nick,0,1) eq ":") {
        $in_nick=substr($in_nick,1,length($in_nick));
      }

      if (substr($in_ident,0,1) eq "~") {
        $in_ident=substr($in_ident,1,length($in_ident));
      }

      if ($input =~ /^:.+:(.*)$/i) {
        $in_msg=$1;
        #trim off some wierd char at the end
        $in_msg=substr($in_msg,0,length($in_msg)-1);
      }

      my %message = (
        nick  => $in_nick,
        ident => $in_ident,
        hostmask => $in_hostmask,
        command => $in_command,
        arg => $in_arg,
        message => $in_msg
      );