Previous Thread
Next Thread
Print Thread
Rate Thread
#104919 11/03/2003 11:23 AM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
hmm... seems fine to me, however I have some suggestions:

Code
   my $pm_user_exists = 0;
foreach $psn (@thegoodguys) {
if ($psn eq $pm_command[1]) {
$pm_user_exists = 1;
}
}
if ($pm_user_exists ne '1') {
$mymsg = &html(qq~<b>$pm_command[1]</b> is not a registered Member of TPMBot.~);
goto PMNOUSERNAME;
}
can be

Code
   my $pm_user_exists = 0;
foreach $psn (@thegoodguys) {
if ($psn eq $pm_command[1]) {
$pm_user_exists = 1;
last; # so that if we have a match at the beginnig,
# we dont waste our time with an unnecessary loop
}
}
if ($pm_user_exists != 1) {# for numbers, always use numerical operators...
$mymsg = &html(qq~<b>$pm_command[1]</b> is not a registered Member of TPMBot.~);
goto PMNOUSERNAME;
}
Code
   PMNOUSERNAME: $nothing = '1';
can be (must be!)

Code
   PMNOUSERNAME: $nothing = 1;

Sponsored Links
Entire Thread
Subject Posted By Posted
[Perl] File IO CTM 11/02/2003 5:41 PM
Re: [Perl] File IO Burak 11/03/2003 6:23 PM
Re: [Perl] File IO CTM 11/04/2003 2:27 AM
Re: [Perl] File IO Mark Badolato 11/05/2003 8:20 AM
Re: [Perl] File IO CTM 11/05/2003 8:08 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)