From 9f23aef2d0b998b2371cea86d899108b35371f7c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 14 Feb 2015 04:01:09 -0800 Subject: [PATCH] Random IRC nicks cannot start with a digit --- PBot/PBot.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PBot/PBot.pm b/PBot/PBot.pm index 492c0655..7882f73d 100644 --- a/PBot/PBot.pm +++ b/PBot/PBot.pm @@ -153,8 +153,8 @@ sub initialize { sub random_nick { my @chars = ("A".."Z", "a".."z", "0".."9"); - my $nick; - $nick .= $chars[rand @chars] for 1..10; + my $nick = $chars[rand @chars - 10]; # nicks cannot start with a digit + $nick .= $chars[rand @chars] for 1..9; return $nick; }