Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet thread from alt.ascii-art, started 14 Mar 2006.
 _   _                     _        _             _     _           
| | | |___  ___ _ __   ___| |_     / \   _ __ ___| |__ (_)_   _____ 
| | | / __|/ _ \ '_ \ / _ \ __|   / _ \ | '__/ __| '_ \| \ \ / / _ \
| |_| \__ \  __/ | | |  __/ |_   / ___ \| | | (__| | | | |\ V /  __/
 \___/|___/\___|_| |_|\___|\__| /_/   \_\_|  \___|_| |_|_| \_/ \___|
Perl art & block text

Perl art & block text

alt.ascii-art · 2 messages · 14 Mar 2006 - 14 Mar 2006
Simon <use...@no-dns-yet.org.uk> ASCII art 14 Mar 2006 22:05 · permalink · report
Hi all,

This was born out of a discussion on block text on a mailing list and
Faux_Pseudo suggested that people here might appreciate it.  It looks
at a paragraph of text, to make sure that the paragraph is blocktext.

I'm sure Joost will regret writing "furthermore, i will say that i am
of the opinion that you should write your perl code as a block text as
well."  Trust Joost to mess up a perfectly good block text layout! :)

# Is the argument list a correct textblock?
# Thanks to Dr. Kremers for checking ideas.
# The code layout is Joost's fault too. :-)
sub _isblocktext {
    my $paragraph = join("", @_); return if $paragraph =~
    m{(?:(?<![\.!\?])\s{2,}|\s{3,}|([A-Z]{1}|Mr|Mrs|Miss|
    Ms|Dr)\.\s{2,})}ox; my ($sentencedelim) = ($paragraph
    =~ m%[\.!?](\s+)%i); for ($paragraph =~ /[\.!\?](\s+)
    /gx) { return if $_ ne $sentencedelim } my $targetlen
    = length(shift); if (length($_[-1])/$targetlen > 0.9)
    { pop @_ }; for (@_) { return if length != $targetlen
    } return "It seems to resemble the block text style!"
}


Regards,
-- 
    Simon <sim...@no-dns-yet.org.uk> **** GPG: F4A23C69
 "We demand rigidly defined areas of doubt and uncertainty."
                       - Douglas Adams

_.-In alt.ascii-art, Simon wrote the following -._
> This was born out of a discussion on block text on a mailing list and
> Faux_Pseudo suggested that people here might appreciate it.  It looks
> at a paragraph of text, to make sure that the paragraph is blocktext.

I have been thinking about putting some business cards together.
This post makes me ponder that "ASCII advocate" has a ring to it
that might find its way on to those cards.  Then again, it might
just be a little obscure and over-the-top.  However, it might be
me over analyzing the thing.  Just an idea to pass to the group.

-- 
  .-'))       fauxascii.com        ('-.  | It's a damn poor mind that
 ' ..-  .:" )               ( ":.  -.. ' | can only think of one way to
  ((,,_;'.;'   UIN=66618055  ';. ';_,,)) | spell a word.
        ((_.YIM=Faux_Pseudo :._))        | - Andrew Jackson

About this thread. These messages were posted publicly to the newsgroup alt.ascii-art in 2006 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post