in reply to Interpreting the code

You want us to fix a program that can't possibly run and w/o telling what it is supposed to do?

There are a bunch of logical ( where does $_ come from ?) and syntax problems (foreach loop,...?) and I don't know where to start!

And sorry, no motivation to spend time on a Rorschach test.

UPDATE

With some archaeological fantasy:

It seems someone wanted to filter %profile according to a regex constructed from the commandline arguments. But what was the input?

Either this program never worked or someone started widely experimenting around with c&p-code from the inet and w/o testing what he does.

My recommendation is to delete this junk, nobody will miss it!

Cheers Rolf

( addicted to the Perl Programming Language)