in reply to remove new lines in flat files

I'm not sure if I understand exactly what you want to do, but you probably want to leave off the

"\n"

from your print statements. Either that or do a

chomp @data;

after the

@data = <FILE>;

which is less efficient in this case.

Update: Also you probably want to rewrite your if statement to look so, since the if part is not needed:

if($name ne "$cat_name_del"){ print FILE "$name|$dir|$dl|$style|\n"; }
@a=split??,'just lose the ego and get involved!';
for(split??,'afqtw{|~'){print $a[ord($_)-97]}