Hello Monks

I feel like I had an effective day at least in part because of a physical list I printed up by means of a perl script to set my priorities. I'd like to add some bells and whistles to it and maybe write it up as a meditation, but it lacks a meditation.

I start shopping around on the net for quotes, affirmations, and it turns out, you'd have a harder time generating an affirmation using perl than I thought. Most seem not to know the lexical meanings of the words they employ. I found one that didn't offend my sensibilities, so I submit it as a guinea pig. The idea here is that a person is gonna create his/her own list for the little bit of reading that many of us like to do right when we get up to start the day with mindfulness and gratitude.

The site is http://motivationgrid.com/50-inspirational-quotes-to-live-by/ What I would like this utility to do is get this page and give me a random quote. I've got a pretty good start, but I'm really stuck with how to write the regex that's gonna deal with cutting off what *isn't* the list. I've been reading the treatment of regexes in _Intermediate Perl_ and hope to mirror that syntax and style in a variety of ways in this list-building endeavor. Here's my starter code when I want to ask something from the internet:

#! /usr/bin/perl use warnings; use strict; use 5.010; use WWW::Mechanize::GZip; use HTML::TableExtract qw(tree); use open ':std', OUT => ':utf8'; use Prompt::Timeout; use constant TIMEOUT => 3; use constant MAXTRIES => 25; my $site = 'http://motivationgrid.com/50-inspirational-quotes-to-live- +by/'; my $mech = 'WWW::Mechanize::GZip'->new; $mech->get($site);

Thanks for your comment,


In reply to regex to get random quote by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.