std/c/README.md: Add section skeletons and don't indent lists
[sunny256-utils.git] / txtfold
blobedea03d474f1eb56c220458cfa3414f10782f4d2
1 #!/usr/bin/env perl
3 # txtfold
4 # File ID: b984ea3e-5d46-11df-bedb-90e6ba3022ac
5 # Inserts fold marks in perl source before and after stdin.
6 # Select text in visual line mode and filter the block through this script.
8 use strict;
9 use warnings;
11 $| = 1;
13 my $Line = <STDIN>;
14 my ($Indent, $Title) = ("", "");
16 defined($ARGV[0]) && ($Title = join(" ", @ARGV) . " ");
17 $Line =~ /^(\s+)/ && ($Indent = $1);
18 print("$Indent$Title\x7B\x7B\x7B\n$Line");
20 while (<STDIN>) {
21 print($_);
24 print("$Indent\x7D\x7D\x7D\n");