[27838] in Perl-Users-Digest
Perl-Users Digest, Issue: 9202 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 25 18:05:40 2006
Date: Tue, 25 Apr 2006 15:05:09 -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: 9202
Today's topics:
Re: "our" from XS and some other questions <nospam-abuse@ilyaz.org>
Re: Line wrapping non-printable characters (Anno Siegel)
Re: Term::ReadKey on Win? 5.005 vs 5.8.8? <nospam-abuse@ilyaz.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 25 Apr 2006 18:53:04 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: "our" from XS and some other questions
Message-Id: <e2lr6f$2u34$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Ferry Bolhar
<bol@adv.magwien.gv.at>], who wrote in article <1145954382.239722@proxy.dienste.wien.at>:
> Yes, when replacing the '$c' with '*c'. Otherwise, I can't see that
> and still get the '...used only once' message.
Well, I checked MY version of Perl; it might differ from yours.
> Well, what's the meaning of the GV_ADDMULTI flag in get_sv?
The proof of the source is in the reading.
> BTW: why the reference operator in the 'Dump' arguments?
One does not want to ever use "bare" globs. Too much magic.
Hope this helps,
Ilya
------------------------------
Date: 25 Apr 2006 19:39:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Line wrapping non-printable characters
Message-Id: <4b7c8aFvs1hoU1@news.dfncis.de>
Paul Harman <chatterbox@doctorwhowebguide.net> wrote in comp.lang.perl.misc:
> 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.
I don't know about format, I'll assume your diagnosis is correct.
> Can anyone help me out? I'm starting to resign myself to writing a regular
> expression loop...
Like this?
my $lines = join "\n", $block =~ /(.{0,78})/sg;
Doesn't look so bad to me. The one tricky part is to allow an empty match
({0,78}, not {1,78}). That supplies an empty string after all other matches,
which makes join() add a final line-feed.
Or do you have "original" line feeds to consider? Then split the block
on line-feed first, treat each part as above, and join them.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Tue, 25 Apr 2006 19:05:06 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Term::ReadKey on Win? 5.005 vs 5.8.8?
Message-Id: <e2lrt2$2udn$1@agate.berkeley.edu>
[A complimentary Cc of this posting was NOT [per weedlist] sent to
Dr.Ruud
<rvtol+news@isolution.nl>], who wrote in article <e2kkis.104.1@news.isolution.nl>:
> > On a "correctly set up" read() from "DOS console", pressing `Left'
> > should generate two characters, 0 and 75; likewise for other special
> > keys.
> perl was run from a Win2000 CMD.EXE console. I am not aware of anything
> special on this system.
"Special" is the OS+CRTL, how it treats reading from console.
Apprently, your OS+CRTL is not "smart" enough. Pity, this means that
Term::ReadLine::Perl is not going to be useful on Win* soon...
> This produces a burst of three <13>s, once the third Enter is hit. So
> the <13>s get delayed, but none gets eaten.
> With USE_GETC set to 1, I need to hit Enter four times, after which a
> burst of three <13>s is displayed. So one gets eaten.
Aha, this is more clear now. So read() produces different results
than getc(); yet another sigh...
Thanks,
Ilya
------------------------------
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 9202
***************************************