THRAK has asked for the wisdom of the Perl Monks concerning the following question:
This causes the "Use of uninitialized value in concatenation" error. But if you set $sub_dir = ""; it halts the warnings. Just looked kind of odd/ugly, thus why you are reading this now.#!/usr/local/bin/perl -w use strict; my $dir = '/tmp/'; my $sub_dir; my $file = 'foo.txt'; my $path = "${dir}${sub_dir}${file}"; print "$path\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Handling uninitialized values
by Sifmole (Chaplain) on May 23, 2001 at 00:56 UTC | |
by blue_cowdawg (Monsignor) on May 23, 2001 at 01:01 UTC | |
by THRAK (Monk) on May 23, 2001 at 16:12 UTC | |
|
Re: Handling uninitialized values
by blue_cowdawg (Monsignor) on May 23, 2001 at 00:47 UTC | |
|
Re: Handling uninitialized values
by rucker (Scribe) on May 23, 2001 at 00:57 UTC | |
by THRAK (Monk) on May 23, 2001 at 16:14 UTC | |
|
Re: Handling uninitialized values
by bwana147 (Pilgrim) on May 23, 2001 at 16:41 UTC | |
|
Re: Handling uninitialized values
by bwana147 (Pilgrim) on May 23, 2001 at 12:51 UTC | |
by THRAK (Monk) on May 23, 2001 at 16:17 UTC |