[27837] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9201 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 25 14:05:51 2006

Date: Tue, 25 Apr 2006 11:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 25 Apr 2006     Volume: 10 Number: 9201

Today's topics:
        Line wrapping non-printable characters <chatterbox@doctorwhowebguide.net>
    Re: Line wrapping non-printable characters <1usa@llenroc.ude.invalid>
    Re: Line wrapping non-printable characters <chatterbox@doctorwhowebguide.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 25 Apr 2006 15:11:53 +0100
From: "Paul Harman" <chatterbox@doctorwhowebguide.net>
Subject: Line wrapping non-printable characters
Message-Id: <4b6p7eFv4s4sU1@individual.net>

I need to take a block of text and introduce line-wrapping at 78 chars. A 
familiar requirement, one would think  };*)

Having used format before, I started there. However I wanted to capture the 
data into a variable rather than write a file. I couldn't get the formline 
trick to work, so instead I used the
    open F, ">", \$destvariable;
 ...trick instead which works wonderfully.

Unfortuantely my source material has non-printable characters, which format 
and/or write seem to be stripping. My google-fu is not strong enough to find 
a solution to this.

Can anyone help me out? I'm starting to resign myself to writing a regular 
expression loop...

    Paul 




------------------------------

Date: Tue, 25 Apr 2006 14:19:28 +0000 (UTC)
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Line wrapping non-printable characters
Message-Id: <Xns97B0690759525asu1cornelledu@132.236.56.8>

"Paul Harman" <chatterbox@doctorwhowebguide.net> wrote in
news:4b6p7eFv4s4sU1@individual.net: 

> I need to take a block of text and introduce line-wrapping at 78
> chars. A familiar requirement, one would think  };*)
> 
> Having used format before, I started there. However I wanted to
> capture the data into a variable rather than write a file. I couldn't
> get the formline trick to work, so instead I used the
>     open F, ">", \$destvariable;
> ...trick instead which works wonderfully.
> 
> Unfortuantely my source material has non-printable characters, which
> format and/or write seem to be stripping. My google-fu is not strong
> enough to find a solution to this.
> 
> Can anyone help me out? I'm starting to resign myself to writing a
> regular expression loop...


CPAN is your friend:

http://search.cpan.org/~muir/Text-Tabs+Wrap-2005.0824/lib/Text/Wrap.pm

Sinan


------------------------------

Date: Tue, 25 Apr 2006 16:27:32 +0100
From: "Paul Harman" <chatterbox@doctorwhowebguide.net>
Subject: Re: Line wrapping non-printable characters
Message-Id: <4b6tisF1080veU1@individual.net>

"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message 
news:Xns97B0690759525asu1cornelledu@132.236.56.8...
> http://search.cpan.org/~muir/Text-Tabs+Wrap-2005.0824/lib/Text/Wrap.pm


I guess I should have thought of that.

<tries>

However the version of it I have it seems utterly broken. I've played with 
several of the settings but I can't stop it destroying the existing newlines 
I have, and it seems to occasionally and randomly wrap text at something 
other than the column value I told it to use.

    Paul 




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9201
***************************************


home help back first fref pref prev next nref lref last post