David Gilden wrote:
Greetings,
I looked for documentation on 'use constant' but it has eluded it me.....
perldoc constant
my $path = `pwd`;
use constant UPLOAD_DIR => "/home/sites/site123/web/private/_data/";
I want to get the Document Root at runtime and concatenate like such...
my $path = `pwd`;
use constant UPLOAD_DIR => "$path/_data/";
use Cwd; for that, one reason (out of many) is that now UPLOAD_DIR is
actually:
/i/am/here
/_data/
because of the newline in the pwd backtick command
But this fails.....
is this construct from the PERL 4 days?
constant UPLOAD_DIR
Any guidance would be greatly appreciated.
You can also use ReadOnly; and even better is to use File::Spec to join
what Cwd gives you to _data, more portable...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>