in reply to Writing files in reverse..and more

while (<>) { s/\W*\/+.*//; print reverse $_ }
Not tested, but should work, no? (Sorry for the .* Ovid :) )

Ciao,
Gryn

Update: Escaped my slashes, opps. :) (Thanks fastolfe).

Replies are listed 'Best First'.
RE: Perhaps, perhaps, perhaps?
by Fastolfe (Vicar) on Jul 28, 2000 at 19:02 UTC
    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"; }
(Ovid) RE: Perhaps, perhaps, perhaps?
by Ovid (Cardinal) on Jul 28, 2000 at 19:58 UTC
    gryng: Actually, I recall mentioning that it's not always possible to avoid the dot star. I should have mentioned that sometimes it's a good choice. You found one of those "sometimes" :)

    Cheers,
    Ovid