Flash detect with perl

I found this statement to detect flash on a site here and wanted to know of a way to use it, but my page is called thru a print statement with perl, heres what I have;

Code here

Any ideas?