
{"id":16982,"date":"2018-03-15T17:29:15","date_gmt":"2018-03-15T17:29:15","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=16982"},"modified":"2018-03-15T17:29:15","modified_gmt":"2018-03-15T17:29:15","slug":"fold-wrap-input-lines-to-fit-in-specified-width","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2018\/03\/15\/fold-wrap-input-lines-to-fit-in-specified-width\/","title":{"rendered":"fold: Wrap input lines to fit in specified width"},"content":{"rendered":"<pre>\n$cat test.pl\nuse strict;\nuse File::Rename ();\nuse Pod::Usage;\n\nmain() unless caller;\n\nsub main {\n    my $options = File::Rename::Options::GetOptions\n        or pod2usage;\n\n    mod_version() if $options-&gt;{show_version};\n    pod2usage( -verbose =&gt; 2 ) if $options-&gt;{show_manual};\n    pod2usage( -exitval =&gt; 1 ) if $options-&gt;{show_help};\n\n    @ARGV = map {glob} @ARGV if $^O =~ m{Win}msx;\n\n    File::Rename::rename(\\@ARGV, $options);\n}\n\nsub mod_version {\n    print __FILE__ .\n\t' using File::Rename version '.\n        $File::Rename::VERSION .\"\\n\\n\";\n    exit 0\n}   \n\n1;\n\n__END__\n\n$\n<\/pre>\n<pre>\n$fold  -w 10 -b  test.pl &gt; part1.txt\n$fold  -w 10   test.pl &gt; part2.txt\n$diff -u part1.txt part2.txt \n--- part1.txt\t2018-03-15 22:50:38.084905051 +0530\n+++ part2.txt\t2018-03-15 22:50:48.768963638 +0530\n@@ -55,10 +55,10 @@\n rsion {\n     print \n __FILE__ .\n-\t' using F\n-ile::Renam\n-e version \n-'.\n+\t' \n+using File\n+::Rename v\n+ersion '.\n         $F\n ile::Renam\n e::VERSION\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>$cat test.pl use strict; use File::Rename (); use Pod::Usage; main() unless caller; sub main { my $options = File::Rename::Options::GetOptions or pod2usage; mod_version() if $options-&gt;{show_version}; pod2usage( -verbose =&gt; 2 ) if $options-&gt;{show_manual}; pod2usage( -exitval =&gt; 1 ) if $options-&gt;{show_help}; @ARGV = map {glob} @ARGV if $^O =~ m{Win}msx; File::Rename::rename(\\@ARGV, $options); } sub mod_version { print __FILE__ &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2018\/03\/15\/fold-wrap-input-lines-to-fit-in-specified-width\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;fold: Wrap input lines to fit in specified width&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,24,91],"tags":[779],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16982"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=16982"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16982\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=16982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=16982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=16982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}