I hate those. I usually end up creating a log file (or stderr in the case of web apps) and just print them out to use them again. Nice debugging, but needless in some cases.
If you figure a good way use the variable more than once without affecting the value, I'd like to hear it. --Chuck > -----Original Message----- > From: Etienne Marcotte [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, November 21, 2001 11:15 AM > To: Bob Showalter > Cc: 'Tomasi, Chuck'; '[EMAIL PROTECTED]' > Subject: Re: Getting past "Use of uninitialized value..." > > > can we do the same for "variable used only once" ?? > because I can't get rid of mine > > or I'll remove -w when going into production > > Etienne > > Bob Showalter wrote: > > > > > -----Original Message----- > > > From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, November 21, 2001 11:20 AM > > > To: '[EMAIL PROTECTED]' > > > Subject: Getting past "Use of uninitialized value..." > > > > > > > > > Perl: 5.6.0 > > > DBI: 1.2.0 > > > DBD::Oracle: 1.12 > > > OS: Solaris 2.7 > > > > > > I'm reading in a list of users from an Oracle database. Some > > > fields are > > > required, some are optional (e.g. Title.) When I get back my > > > populated > > > array of hashes, I have no idea what I got until I print it. > > > Unfortunately, > > > while using strict, I get the dubious message: > > > > > > Use of uninitialized value in concatenation (.) at /path...pl > > > line 1288 > > > > > > every time a record comes up with no title field populated. > > > > > > Is there some way to make this work whether a value was > read from the > > > database or not? > > > > > > print "\t\t<td nowrap>$ulist[$i]{'Title'}</td>\n"; > > > > Actually, "use strict" isn't the culprit; it's -w or "use warnings". > > > > For 5.6 and higher, you can wrap the code in a block like this: > > > > { > > no warnings 'uninitialized'; > > > > ... your code here ... > > } > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > -- > Etienne Marcotte > Specifications Management - Quality Control > Imperial Tobacco Ltd. - Montreal (Qc) Canada > 514.932.6161 x.4001 > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]