Thanks for all your input. I have used one of these methods and it worked well. Problem solved.... :-)
> Anthony (Tony) Esposito > Senior Technical Consultant > Inovis(tm), formerly Harbinger and Extricity > 2425 N. Central Expressway, Suite 900 > Richardson, TX 75080 > (972) 643-3115 > [EMAIL PROTECTED] > -----Original Message----- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 5:02 PM To: [EMAIL PROTECTED] Subject: Re: using constant value in as a command variable Jenda Krynicky wrote: > From: Tony Esposito <[EMAIL PROTECTED]> > > I can resolve a constant in a print statement like so: > > > > use constant QX12_FILE => "q_x12_in.dat"; > > ... > > print STDERR "could not change permissions on file @{[ QX12_FILE ]}: > > $!"; > > > > but how to resolve the constant when being used in a function call, > > like so: > > > > use constant QX12_FILE => "q_x12_in.dat"; > > ... > > rename(@{[ QX12_FILE ]}, "foo.dat"); > > > > The print() works - resolves - ok....the rename() does not. I assume > > it has something to do with the syntax of @{[ QX12_FILE ]}. > > You are doing it unnecessarily complex. > > rename( QX12_FILE, "foo.dat"); > > is enough. Also, if your constant is a simple scalar then you can use this instead: print STDERR "could not change permissions on file ${\QX12_FILE}: $!"; which is a little neater, or print STDERR "could not change permissions on file " . QX12_FILE . ": $!"; which is prhaps tidiest of all. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]