in reply to Handling uninitialized values

Well this isn't going to make it any prettier (in fact, it is uglier), but if you have potentially undefined variables and you want to suppress the warnings, you should check to see if they're defined and then use them or not. Here's one example... obviously there are other ways to do it.
my $path = defined($dir) ? $dir : '' . defined($sub_dir) ? $sub_dir : +'' . defined($file) ? $file : '';

Replies are listed 'Best First'.
Re: Re: Handling uninitialized values
by THRAK (Monk) on May 23, 2001 at 16:14 UTC
    I've seen this sort of thing and would agree that is is uglier. I guess in a more complex application this might be good approach.

    -THRAK
    www.polarlava.com