my $log_dir="hello";
my $name=function1(); // $name has value "log_dir"
I want the output as "hello" using the "name" variable. Is that possible?
TIA
Svel
Yes.
Below is a quick hack that I think does what you want to do.
--8<--8<--8<--8<--8<--
#! /usr/bin/perl -w
use strict;
my $log_dir="hello";
sub function1() {
return "$log_dir";
}
my $name = function1();
print "$name\n";
-->8-->8-->8-->8-->8--
Grant. . . .
you've tried those:
print $$name
print ${$name}
they should work both
On 7/24/2009 10:38 AM, Sakthi wrote:
> utput as "hello" u