Hey, I posted a while ago on a thread marked "More regex reguired!", the
solution gave there did part of the job I asked. I need something more out
of that regex though..
1) this.is.a.string.to.match.with
2) this.is.another.string.to.match.with
3) this.is.a.totally.with.different.string
What I want to be able to do, along with what's already been said, is to do
a search for *.with and it return only strings 1 and 2 (since they end in
.with). String 3 contains with, but at the moment, this code returns that
one as well.
I have this:
$mask =~ s/\*//g;
foreach $key (keys %online) {
if ($spewcount == 50) { # is there more than 50 results?
# yes!
$ended = 1;
last;
} elsif ($online{$key}->{host} =~ /$mask/) {
# no!
print "User with matching host: $key
($key!$online{$key}->{ident}\@$online{$key}->{host}\n";
$spewcount++;
}
}
What's the alternative solution so a search of *.with returns only strings 1
& 2?
Secondly, threads now, I have a thread running beside my program which runs
a timeout sub every second, and checks to see if a variable has a timestamp
in the past. If it does, it removes the information from the hash. But, at
the moment, if I set another key on the hash, that information doesn't get
passed to the sub, and it never checks them. How do I get the new
information in the hash over to the sub so it can check for timeouts on the
new information?
Many thanks.
Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]