Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
#!/usr/bin/env perl eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; # not running under some shell # $Author$ Last modified: 14 Dec 2003 15:30:18 # Suggested name: "pmnodecomp-blockquoter" - shorten if wished. # Or better yet make a symlink or alias. use strict; BEGIN { use vars qw! $plugin !; $plugin = (eval { # Place your own home-brewed filter module below. # This is only a suggestive example / default. require PMntextFilter; # import PMnTextFilter "quazzle wrench bangbar"; }) ? 'extern' : 'intern'; } use warnings; use vars qw! $DeBug $acq $outfm $rcnt $pictstr !, qw! $amps $ltgt $sqbr !; use subs qw! bbegin bendin newblk filtermeta !; $DeBug = 0; use constant rCNT => 66; # arbitrary length for output lines. format EBLK = </blockquote> . format BBLK = <blockquote> . format NBLK = <br><br> . if ($plugin eq 'extern') { $amps = sub { PMntextFilter::amps(@_) }; $ltgt = sub { PMntextFilter::ltgt(@_) }; $sqbr = sub { PMntextFilter::sqbr(@_) }; } else { $amps = sub { my $amper = '&amp;'; my $para = shift; $para =~ s% \& %$amper%oxgm; return $para; }; $ltgt = sub { my ($lt,$gt) = ( '&lt;','&gt;' ); my $para = shift; $para =~ s% \< %$lt%oxgm; $para =~ s% \> %$gt%oxgm; print STDERR "\n$acq\n" if $DeBug; return $para; }; $sqbr = sub { my ($sqbro,$sqbrc) = ( '&#91;','&#93;' ); my $para = shift; $para =~ s% \[ %$sqbro%oxgm; $para =~ s% \] %$sqbrc%oxgm; print STDERR "\n$acq\n" if $DeBug; return $para; }; } $pictstr = q[^] . q[<] x rCNT; $outfm = qq[format STDOUT = ] .qq[\n $pictstr\n] . q[$acq] . qq[\n.\n]; eval $outfm; die "Bad perl format!: $@" if $@; my $splurt = sub { local $/ = qq[]; $acq = <STDIN> }; my $pc = 0; bbegin; while (&$splurt and $pc++ < 10000) { filtermeta $acq; write while $acq; newblk unless eof(STDIN); } bendin; exit 0; sub filtermeta { # Do what you want to here. Given is a minimal default. $acq=&$amps($acq); $acq=&$ltgt($acq); $acq=&$sqbr($acq); } sub newblk { local $~ = "NBLK"; write; } sub bbegin { local $~ = "BBLK"; write; } sub bendin { local $~ = "EBLK"; write; }

In reply to Simple tool for making HTML blockquotes from text selections by Intrepid

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (4)
    As of 2020-10-20 09:37 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My favourite web site is:












      Results (209 votes). Check out past polls.

      Notices?