in reply to RE: Writing files in reverse..and more
in thread Writing files in reverse..and more
Cheat! You just corrected the first problem that I saw (incorrect arguments to rindex).
The other problem is that it runs all of the lines together, you need to print "\n" at the end of each line like this:
print scalar( reverse substr( $_, 0, rindex($_," //") ) ), "\n" while +(<>);
but if we're playing golf then you can save a couple of strokes by using map
--print map { scalar reverse(substr( $_, 0, rindex($_," //") )), "\n" } +<>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: Writing files in reverse..and more
by cwest (Friar) on Jul 28, 2000 at 21:23 UTC |