Hello Ekta,
I'm not sure if this is the correct way to do it, but you can implement a
singleton like this::
package Singleton;
eval {
my $instance = {};
$instance->{TIME} = time();
$instance->{NAME} = "MyName";
bless ($instance, __PACKAGE__);
}
sub instance {
return
Roman,
You don't need to do the substitute the second time. The first match will
populate the $1 & $2 variables as intended and you can then manipulate them
then as you wish in the subsequent expression:
if ($k_7 =~ /^(www\.(\S+|$))/i)
{
$k_7 = "" .
subtr($2, 0, 40) . "<\/A>";
}
Joe
HI kabana,
This is something I do a lot so I wrote a little "utils" package to contain
this and other common actions.
Here is the subroutine.
Pass it the name of the config file, a hash reference and an optinal
delimeter. You will get back a hash populated with the details of the
config file