<?xml version="1.0" encoding="windows-1252"?>
<node id="143970" title="Re: Always Follow Up on Warnings" created="2002-02-07 15:58:58" updated="2005-07-19 14:08:11">
<type id="11">
note</type>
<author id="83485">
blakem</author>
<data>
<field name="doctext">
I've been known to [id://125749|rant about uninitialized warnings] before... Here is one nice idiom for "cleaning" a series of undefined values.
&lt;code&gt;
$_ = '' for grep !defined, ($x,$y,$z);
&lt;/code&gt; 
Try the following code with and w/o this clensing line:
&lt;code&gt;
#!/usr/bin/perl -wT
use strict;

my ($x,$y,$z) = (undef,'hello',undef);

# undef "clensing" idiom
$_ = '' for grep !defined, ($x,$y,$z);

print "x='$x' y='$y' z='$z'\n";
&lt;/code&gt;
&lt;P&gt;
-Blake

</field>
<field name="root_node">
143961</field>
<field name="parent_node">
143961</field>
</data>
</node>
