I
ivowel
Dear perl experts: Is there a module to attach a variable to another
variable, and retrieve it later?
my $fh;
open($fh, "filename");
attach($fh, "filename");
(PS: why is the open syntax not '$fh=open("filename")' ?)
far, far, away, in one of many distant subroutines:
my $fname= attached($fh);
close($fh);
system("mv $fname .$fname");
I do understand that I can pass $fname around with $fh, or even put the
two into an array and pass around the array.
It's almost like "bless" semantics, where I want to attach something
else to a variable, but in my case, it is not necessarily a class name.
regards,
/ivo
variable, and retrieve it later?
my $fh;
open($fh, "filename");
attach($fh, "filename");
(PS: why is the open syntax not '$fh=open("filename")' ?)
far, far, away, in one of many distant subroutines:
my $fname= attached($fh);
close($fh);
system("mv $fname .$fname");
I do understand that I can pass $fname around with $fh, or even put the
two into an array and pass around the array.
It's almost like "bless" semantics, where I want to attach something
else to a variable, but in my case, it is not necessarily a class name.
regards,
/ivo