Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • %!sort -- sorts all of the lines in the file

    I've rarely found that useful...more often it's:

    ma -- mark line as line "a" now go down to another line
    mb -- mark line as line "b"
    :'a,'b!sort -- sort lines "a" through "b"
    • In vim, I use a visual selection for the job. Shift-v in normal mode takes you to visual line mode; select the line range you want to manipulate, then type :!sort. Note that vim will automatically type '<,'> for you when you go from visual mode to command mode, so the command actually executed is '<,'>!sort, which filters the selected lines through sort.

      Very handy. Also nice for selectively perltidying code and such.