in reply to Re^2: if condition within module
in thread if condition within module

I'm unfamiliar with Data::Table, a quick scan of the documentation shows examples of the various matching methods, match_pattern,match_string and so on, which you could use. The documentation also links to a PDF cookbook. I suggest you learn to use the tools you've chose, on in this case, that you've decoded to used based upon someone else giving you this code.