Unfortunately, comment wrap is available only for C, C++, C#, Java, and Slick-C® - see comment wrap in the help. This means that reflow won't work for perl. From looking at the slick C code below, comment wrap works for more than what the help file says. The help file could document this better and the reflow comment menu option should be grayed out for a non supported language, just as the comment wrap menu option is. For C/C++, comment wrap is great.
It's probably not hard to write a slick C macro to reflow at least perl line comments. You could even record a macro that swaps # for //, switch to C mode temporarily, invoke reflow, switch // back to # (except it doesn't work, I just tried).
boolean commentwrap_isSupportedLanguage2(_str lang = CW_p_LangId) {
if (_LanguageInheritsFrom('c', lang) ||
//_LanguageInheritsFrom('xml', lang) ||
file_eq('xml', lang) ||
file_eq('html', lang) ||
('phpscript' == lang) ||
//file_eq('xsd', lang) ||
//file_eq('xhtml', lang) ||
_LanguageInheritsFrom('java', lang) ||
_LanguageInheritsFrom('e', lang) ||
_LanguageInheritsFrom('js', lang) ||
//_LanguageInheritsFrom('fundamental', lang) ||
_LanguageInheritsFrom('cs', lang)) {
return (true);
}
return (false);
}
This didn't work.
_macro('R',1);
replace_buffer_text('#','I?M*','//','1','0','0','0','0','0');
_SetEditorLanguage('c');
deselect();
_select_char('','E');
cursor_down(2);
select_it('CHAR','','E');
_begin_select('',false,false);
_deselect();
cursor_up();
cursor_down();
execute('gui-reflow-comment');