in reply to Context of "if" statements?

The problem IS with the next line. As the split has been skipped, $server, $dir, $type, all three of them are undef, and in the print statement, you are trying to concatenate undef's. This is easy to prove, it will be fine, if you change your print statement to:
print "$server $dir $type\n" if defined($server);
So just put those two lines into one if block.

Replies are listed 'Best First'.
Re: Re: Context of "if" statements?
by ibanix (Hermit) on Nov 24, 2002 at 03:47 UTC
    Thank you sir! I now understand.

    <-> In general, we find that those who disparage a given operating system, language, or philosophy have never had to use it in practice. <->