Hello all,
I have a perl question which is somewhat related because I'm trying to
write a mod_perl script but I'm stuck with this.

I need to search a flat file for either a specific user name, or for all
users.  what I want to do is something like this...

...
if ($user_name =~ /all/)
{
  $regexp_string = "^[a-zA-Z]+";
}
else
{
  $regexp_string = $user_name;
}
foreach $key (sort keys %tickets)
{
 print "$key\t$ticket{$key}\n" if ($key =~ /$regexp_string/);
}

I thought I've done this before but I can't find an example of it.  What
am I missing here?  This is really a basic perl question but I need a
quick answer and I don't have anywhere else to turn at the moment.

Thanks & regards,
Ron

Reply via email to