#! perl -slw use strict; our $N ||= 16; my $longstring = do{ local $/; }; for my $n ( map{ $_*50 } 4 .. $N ) { my $cutoff1 = 1+rindex $longstring, '<', $n; my $cutoff2 = length $1 if $longstring =~ m[^(.{0,$n}[\.,:;!?])]s; my $cutoff3 = 1+rindex $longstring, ' ', $n; my $cutoff = $cutoff1 > ( $n - 25 ) ? $cutoff1 : $cutoff2 > ( $n - 25 ) ? $cutoff2 : $cutoff3; my $substring = substr $longstring, 0, $cutoff-1; print "\n$n($cutoff)\n'$substring'"; } __DATA__

Welcome to the Perl Monastery. We hope your stay is long and enjoyable. You are probably wondering what PerlMonks is all about. Hopefully this page will answer some of those questions.

What Perl Monks is:

  • Our attempt to make learning Perl as nonintimidating and easy to use as possible
  • A place for you and others to polish, improve, and showcase your Perl skills
  • A community which allows everyone to grow and learn from each other.

    Areas within the monastery: