I am not sure how to state the problem in sentences. Let me give a n instance:
There is one file
abc.pl
it's contents are as follows:
use def;
my $log = $def::logs;
my $text = "this is the text to be searched with value123";
my $var = "value123";
my $findstring = $log->{'search'};
&find("$text","findstring ");
Now file def.pm, which is used in above file:
package def;
our $logs = {
'search' => "text to be searched with $var"
};
in this file how should I give $var so that it is interpolated in file abc.pl and not in the same file?
sprintf.