Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.27 KB | None | 0 0
  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4.  
  5. my $ls=0;
  6. my $cmd=undef;
  7. while(<>) {
  8.     s/^ {4,8}/\t/;
  9.     s/^[\t\s]+/ / if $ls;
  10.     if (m/^(\/.*)/) {
  11.         $cmd=$1;
  12.         next;
  13.     }
  14.     if (m/\\$/) {
  15.         s/\s*[\\\r\n]+$//;
  16.         $ls=1;
  17.     } else {
  18.         $ls=0;
  19.     }
  20.     print join' ',$cmd,$_;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement