in reply to Perhaps, perhaps, perhaps?
in thread Writing files in reverse..and more

I would do the regexp like this: s~\s*//.*~~; Using a delimiter other than / keeps you from having to escape the slashes, otherwise it'd be like s/\s*\/\/.*//, which is kinda confusing. But yah the rest is just that simple. Except you aren't considering newlines:

while (<>) { chomp; s~\s*//.*~~; print reverse $_; print "\n"; }