CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI: Re: [brosskgm] Perl MySQL help with code.: Edit Log



FishMonger
Veteran / Moderator

Feb 27, 2013, 1:46 PM


Views: 4224
Re: [brosskgm] Perl MySQL help with code.

That's part of the reason I said that you shouldn't be comparing those 2 vars. Just check $username.


Code
if ( $username )


An undefined var checked in scalar context like this returns true or false.

If you want it more verbose, you could write it as:

Code
if ( defined $username )


EDIT:
The db code I reference a few posts back was not the one I actually wanted. I just scrolled to the wrong post when searching for the version I meant to refer to..


(This post was edited by FishMonger on Feb 27, 2013, 1:55 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Feb 27, 2013, 1:47 PM
Post edited by FishMonger (Veteran) on Feb 27, 2013, 1:55 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives