Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^8: Text::ANSI::Util for wrapping "colorful" text

by ibm1620 (Hermit)
on Aug 06, 2022 at 16:14 UTC ( [id://11145982]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub findwrappoint
      {
    ...
        {
        $3 and $char <= $width and $cut = $+[3];
        $char += $1 ? 0 : $2 ? length $2 : length $3;
    
  2. or download this
        $char > $width and return substr( $string, 0, $cut, ''), $string;
        }
      return $string, '';
      }
    
  3. or download this
    my $string2 = qq{01:11:43:09 [CC] Roger. Go into BLOCK and we'll uplin
    +k a new CSM state vector, and entry target load. 73 hours 00 minutes:
    + stop PTC 0 roll at 73; do a little more about that a little.};
    my $width = 91;
    ...
                   01:11:43:09 [CC] Roger. Go into BLOCK and we'll uplink 
    +a new CSM state
                   vector, and entry target load. 73 hours 00 minutes: sto
    +p PTC 0 roll at 73; do
                   a little more about that a little.
    
  4. or download this
    String=<<EOF;
    05:08:28:30 [LMP] Mike, you get a waste-water dump at GET 30 plus 15 d
    +egrees pitch to 0 degrees pitch to 0 degrees per hour with on the inc
    +rease, and the force of impulsion will depend on the lunar attraction
    +. It is very destructive, and ends by enlarging the bore of the count
    +ry up across north of track. Over.
    ...
    String=<<EOF;
    02:02:40:59 [CC] Apollo 11 has got VHF A Simplex on whenever you are. 
    +We're ready to start PTC at approximately 0 degrees per hour with on 
    +the DSKY. Forward and up; now you are going over Mount Marilyn and th
    +e shock be thereby destroyed. His object now was this with the coordi
    +nates you have a recommended configuration for you. We'll just keep i
    +t bearable. But since entering the cone of shadow these last two hour
    +s, had the shell could not see Tranquility. What were you marking on?
    + Over.
    EOF
    
  5. or download this
    $char += $1 ? 0 : $2 ? length $2 : length $3;
    
  6. or download this
    $char += $1 ? 0 : defined $2 ? length $2 : length $3;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145982]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-24 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found