[9744] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3338 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 4 07:05:47 1998

Date: Tue, 4 Aug 98 04:00:20 -0700
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, 4 Aug 1998     Volume: 8 Number: 3338

Today's topics:
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
    Re: comp.lang.perl.announce redux <quednauf@nortel.co.uk>
    Re: Different IPC::open2 problems (M.J.T. Guy)
    Re: Extracting ASCII text form PDF file <sneaker@sneex.fccj.org>
    Re: Has anyone used the POP3 module ? <alan@find-it.furryferret.uk.com>
    Re: Has anyone used the POP3 module ? <alan@find-it.furryferret.uk.com>
    Re: hiding user input <sp@m.block>
    Re: hiding user input <rra@stanford.edu>
    Re: hiding user input <rra@stanford.edu>
    Re: hiding user input <rra@stanford.edu>
    Re: hiding user input <rra@stanford.edu>
    Re: Installing ActivePerl on Win95 system (Louie)
    Re: Interesting Question needs Quick Answer <rra@stanford.edu>
    Re: Interesting Question needs Quick Answer <rra@stanford.edu>
    Re: Interesting Question needs Quick Answer (Ilya Zakharevich)
    Re: luser is spelt L-O-S-E-R was Re: hiding user input <rra@stanford.edu>
    Re: MacPerl fully compatible? (directory problems) <neeri@iis.ee.ethz.ch>
    Re: Newbie questions...help! <alan@find-it.furryferret.uk.com>
    Re: Newbie questions...help! <alan@find-it.furryferret.uk.com>
    Re: Perl 5 bug list <rra@stanford.edu>
        Putting \r\n at end of lines using format and write <stefan@consilia.aland.fi>
    Re: Putting \r\n at end of lines using format and write <rra@stanford.edu>
        redirection of script output <Derek.Chaloner@securepay.co.uk>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 04 Aug 1998 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage902226241.13071@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 18 May 1998

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Spring of
1997; of course, ongoing updates are made as needed. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://cpan.perl.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://cpan.perl.org/
    http://www.perl.com/CPAN/
    http://cpan.perl.org/doc/FAQs/FAQ/html/perlfaq.html
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq.html

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:

    setdir usenet-by-group/news.announce.newusers
    send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: Tue, 04 Aug 1998 09:41:27 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: comp.lang.perl.announce redux
Message-Id: <35C6C937.20CCEB68@nortel.co.uk>

birgitt@my-dejanews.com wrote:

> Is there no way to accept and get decent translations into English ?

Someone earlier one pointed out that translations could be provided in
the rare event of a posting in a different language. I would volunteer
for providing translations German - English, and if no one else comes
up, Spanish - English. I honestly believe that it can't be that much (is
this the naivity of the innocent youth ..?)

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: 4 Aug 1998 10:49:52 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Different IPC::open2 problems
Message-Id: <6q6p0g$eui$1@pegasus.csx.cam.ac.uk>

Tramm Hudson <tbhudso@panther.cs.sandia.gov> wrote:
>I've reviewed the perlipc faq on open2 and am using a copy of the
>code contained in its example.  The open2 works as expected, but
>I experience anomalous behavior if I redirect stdout to a file.

IPC::Open2 uses fork internally.   And perldoc -f fork says

=item fork

Does a fork(2) system call.  Returns the child pid to the parent process,
C<0> to the child process, or C<undef> if the fork is unsuccessful.

Note: unflushed buffers remain unflushed in both processes, which means
you may need to set C<$|> ($AUTOFLUSH in English) or call the C<autoflush()>
method of C<IO::Handle> to avoid duplicate output.


which explains what you see.


Mike Guy


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

Date: Tue, 04 Aug 1998 06:04:38 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
To: Juergen Vollmer <vollmer@cocolab.de>
Subject: Re: Extracting ASCII text form PDF file
Message-Id: <35C6DCB6.E10BE1F5@sneex.fccj.org>

Juergen Vollmer wrote:
> 
> Dear Bill,
> 
> > Yes.  Look via DejaNews for a PDF module that reads them, etc...
> 
> please could you be a little mpre precice. Do you know the name of the module?
> (I haven't found one in the CPAN's module list)

I don't think it's a module per se.
Try these links, found via DejaNEws:

http://x11.dejanews.com/jump/http://www.perl.com/CPAN-local/authors/Antonio_Rosella/

http://x13.dejanews.com/jump/http://www.geocities.com/CapeCanaveral/Hangar/4794/

HTH, 
-Sneex-  :] 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | Life is a 'Do it yourself' thing...
             http://webmaster.fccj.org/cgi/mail?webmaster


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

Date: Tue, 4 Aug 1998 11:42:13 +0100
From: Alan Silver <alan@find-it.furryferret.uk.com>
Subject: Re: Has anyone used the POP3 module ?
Message-Id: <kESgeTAFWux1EwA8@find-it.uk.com>

In article <6q4b5p$kuq$1@news.gns.getronics.nl>, Jonkers
<snif@xs4all.nonono.nl> writes
>Here's sample script that works OK for me (with Dutch words):

Thank you. That is very clear and simple (even with the words in
Dutch!!). I haven't tried it yet, but it's so simple that even I should
be able to sort it out.

Thanx again.

-- 
Alan Silver
Please remove the furryferret when replying by e-mail


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

Date: Tue, 4 Aug 1998 11:21:21 +0100
From: Alan Silver <alan@find-it.furryferret.uk.com>
Subject: Re: Has anyone used the POP3 module ?
Message-Id: <2E7kOJAhCux1EwDa@find-it.uk.com>

In article <35c607db.78749411@news2.cais.com>, root. noharvest. <?@?.?>
writes
>I think you are making it more difficult than necessary.  First, you
>could probably use a .forward file that points to a simple perl script
>to handle this, or even more simple is to just set up the aliases file
>so that ferret is aliased to gerbil@second.domain.co.uk, that way
>anytime the mail server recieves mail for ferret, it just relays it to
>second.domain.uk.  

The problem is that my ISP won't do this. He says that a .forward file
wouldn't work (don't know if this is true or an excuse) and that I would
have to have virtual mailboxes set up. These (naturally) cost money. As
far as the aliases files goes, I think that is a system file, as opposed
to a personal file for me, so again he probably wouldn't agree to
changing it for me.

>
>There's so much you can do once you've told sendmail to pipe the
>message to an executable - you can set up "auto-reply" or send the
>message to anyone, anywhere, or write it to another file, or whatever.
>

I'm not sure I understand this bit. Please could you explain it a bit
more. Remember I am talking about incoming mail, so where does sendmail
come into it ?

thanx for your comments,

Alan

-- 
Alan Silver
Please remove the furryferret when replying by e-mail


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

Date: Tue, 04 Aug 1998 18:28:58 +0900
From: "B. Oiledanimalbyproducts" <sp@m.block>
Subject: Re: hiding user input
Message-Id: <35C6D46B.7AEE33B2@m.block>

Steve Linberg wrote:
 
> A quick check to this group will show everyone that Abigail's knowledge of
> programming and Perl exceeds that of 99% of the other posters here
> COMBINED.  That's all I'm interested in.

Being knowledgeable doesn't give you the right to forget common courtesy,
perhaps good ol' Abbi should spend less time with her comp and get out into
the real world


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

Date: 04 Aug 1998 02:22:48 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: hiding user input
Message-Id: <m3vho914pj.fsf@windlord.Stanford.EDU>

John Porter <jdporter@min.net> writes:
> Gary L. Burnore wrote:

>> I'll be sure to Call both Stanford and Dartmouth on Monday and let the
>> admins there know exactly what I think of your actions.

> If any of those admins have half a clue, they'll check the clpm
> archives, and will become quite clear to them that you are the one with
> the problem.  And there are plenty of us who will be glad to field
> emails or phone calls to affirm the same.

In the case of Stanford, there really won't be a need, as the person who
handles complaints of AUP violations related to Usenet by Stanford users
is me, and I'm not exactly unfamiliar with this thread.  But speaking for
a moment as one of the people who *does* have to deal with these sorts of
things when people start complaining to administrators, I'd really
appreciate it if you'd all collectively drop this thread, 'cause honestly
anyone behind an abuse or postmaster address is going to find the entire
thing ridiculously petty and a waste of time.

If Gary doesn't want to receive e-mail, don't send him e-mail.  It can't
be that hard.  It certainly isn't worth yelling about in newsgroups for
several dozen posts.  I've had a few aside comments in response to his
posts that I've wanted to make to him from time to time that would have
been off-topic for the newsgroup, mostly because they were about subjects
that weren't of general interest, but being aware of his desire not to
receive e-mail replies to newsgroup postings, I just didn't send them.
That wasn't much hardship for me.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 04 Aug 1998 02:27:14 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: hiding user input
Message-Id: <m3sojd14i5.fsf@windlord.Stanford.EDU>

Greg Bacon <gbacon@cs.uah.edu> writes:
> gburnore@databasix.com (Gary L. Burnore) writes:

>> Uh, I did: Reply-To: whatpartofdontemailme@dontyouunderstand so they
>> just use the From: line.  I won't forge that for them.  But I am going
>> to set up a nice little procmail filter that works specifically for
>> this group since it's in this group that the "experts" seem to think
>> it's ok to post and followup and those same said experts can't take
>> leave my email alone for an answer.

> Why do you maintain this position in the face of documents that claim
> otherwise?

You do realize that Gary isn't the only person who doesn't appreciate
courtesy copies in e-mail, don't you?  I had a big flamewar with a few
people in other groups a year or two ago on this subject myself, as I
don't particularly like them either.  Over time, I've gotten less
hard-nosed on the subject, and in fact sometimes will send courtesy e-mail
copies myself if I have some reason to believe that it *is* a courtesy
that the person to whom I am responding would appreciate, but I have a
well-connected news server and no real need of extra e-mail traffic.

The only thing that's *really* annoying, though, as opposed to simply a
minor waste of time hitting the delete key, is when the e-mail copy
doesn't say at the top that it's an e-mail copy of a post.  But I think
most people here agree on that.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 04 Aug 1998 02:34:27 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: hiding user input
Message-Id: <m3pveh1464.fsf@windlord.Stanford.EDU>

John Call <johnc@interactive.ibm.com> writes:

> I assumed (incorrectly) that when the .moderated group came along that
> all of the the "insults" would stop.

That honestly would have been nice.

I agree with what a number of other people have said on this subject:  If
it's gotten to the point where seeing FAQs on this group makes you
actively angry, it's time to take a break and do something else for a
while.  If you want to talk about Perl, there's a new moderated group that
will not (as best as fallible humans can manage it) have FAQs on it to
ruin your reading.

("You" in the above paragraph is generally addressed, not aimed at anyone
in particular.)

It's Usenet.  People don't always read what they should have, or respect
the things that you think should be respected.  There isn't much one can
do about it other than try to educate each person individually, and
yelling at them doesn't accomplish that.  FAQs are frequently asked, by
definition, and always will be.

I've seen other groups I enjoy made considerably less enjoyable by too
aggressive application of "netcopping," and while I generally agree with
the opinions of others here on what does and does not belong in this
group, to the degree that I use a modified version of Tom's killfile, I'd
also rather not see the atmosphere hurt by insults or posts that will be
read as insults, regardless of whether they're warranted.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 04 Aug 1998 02:46:54 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: hiding user input
Message-Id: <m3n29l13ld.fsf@windlord.Stanford.EDU>

Daniel Grisinger <dgris@rand.dimensional.com> writes:

> Well, that's okay, lots of people who don't post to clpm have done
> things for perl.  Let's take a look at CPAN

> cpan> a /(?i:burnore)/    
> No objects of type Author found for argument /(?i:burnore)/

> Oh, but there are people without CPAN id's that have contributed to
> perl.  Let's take a look at all your great work on p5p.

> Never mind, the p5p archives have never heard of you.  Guess you haven't
> contributed anything there.

> But maybe you're in the habit of mailing patches directly to
> the pumpking rather than dealing with p5p.  Let's see.
> $ cd /usr/src/perl
> $ grep -i burnore Changes*
> $

> Hmmmm... apparently you've never contributed anything to perl other than
> bullshit, flames, and hard feelings.  I'd say that you are undoubtedly a
> troll.

I hate it when this argument comes up.

Look, I understand and even respect the role that reputation plays on-line
and in free software communities, but I'd much rather see that play a
*positive* role rather than a *negative* role.  Every time someone makes
this argument, namely "you haven't contributed anything of value, so
obviously your opinion isn't worth anything," it makes the community that
much more insular and makes it that much harder for someone new who *does*
have something to offer to get in the front door.

Just because you've never heard of someone today doesn't mean they won't
be of valuable assistance tomorrow.  And there are a *lot* of people who
have given a lot of valuable work to the Perl community who *are* abrasive
or occasionally insulting.  I'm of the opinion that while I'd rather
everyone be polite and treat other people with respect, I'm not going to
slam the door in someone's face just because they have a hard time with
that.  Maybe they'll learn.  I know I certainly have learned a lot since
the time when I first got on Usenet.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Tue, 04 Aug 1998 10:17:43 GMT
From: louie@visca.com (Louie)
Subject: Re: Installing ActivePerl on Win95 system
Message-Id: <35c6dfa9.6566389@news.jet.es>

"Jeremy Deats" <jeremy@pdq.net> wrote:

>
>I've been trying to install Perl and get it working with Personal Web
>Server for a few days now 
<snip>
I have a tutorial on running cgi scripts on Win95 using the
ActiveState Perl and Omnihttpd ver1.01 at
http://www.visca.com/cgi/cgi-help/cgi-win95.html. If you have any
questions, please send me an e-mail. 



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

Date: 04 Aug 1998 02:05:48 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Interesting Question needs Quick Answer
Message-Id: <m31zqx2k2b.fsf@windlord.Stanford.EDU>

I J Garlick <ijg@csc.liv.ac.uk> writes:

> Now could you explain it? (I have only been learning Perl since April
> and Patrick started last Tuesday)

I keep meaning to write up an explanation of how this works and put it on
a web page somewhere.  :)  It's actually not very complicated (probably
not complicated enough to really warrant entry into an Obfuscated Perl
Contest or the like).

#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print

The first thing to notice is that it actually begins with a variable
assignment, and quite a bit of the rest is a quoted string (starting with
q) that uses ; as the quote character.  So this is a single assignment:

$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;

I'm just using an odd quoting delimiter (;) to make it *look* like I'm
doing something else entirely.  The actual function of the $^ special
variable in Perl is irrelevant here; I'm just using it as a convenient
variable to store a string into.  Using special variables for that lets me
get away with not declaring them and still have the sig pass use strict
(which it does, as well as -w under both Perl 5 and Perl 4).

Then we do this:

$0=q,$,

which just assigns '$' to $0.  Now....

($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d

makes a copy of the first string that we assigned to $^, puts it in $_
(the default variable for the print we're going to do later), and then
does a y/// on it (same as a tr///).  I use , as the delimiter for y///.
This is the part that decodes the string.  The mapping is:

$/ C-~><@=   ...maps to...
-~$:-u/ #y

Note that there's a range in there; the range C-~ maps to :-u.  You need
an ASCII chart to see precisely what that does, but you can apply that
transform to the string and get something that looks much more familiar
(it includes the string "#!/usr/bin/perl -- Russ Allbery"..., for example.

It also deletes \r and \n characters, to strip off the line endings.

s,(\$.),$1,gee

is a substitute on the decoded string.  $ followed by a single character
is replaced by that string evaluated twice (/ee) globally (/g).  This
causes $0 to turn into $ (so we can escape $'s in the string as $0) and
more importantly replaces $^ with the original quoted string.  That's the
magic that allows the whole thing to be self-printing; the trick to
writing self-printing programs is to find a way to use the same string
twice in the output.  The quoted string that we put in $^ becomes the text
at the beginning and end of the sig after it was decoded, and then the
original encoded string is embedded in the middle again to get the
original sig back.  Note that $/ is also present in the decoded string and
becomes \n to preserve the original line endings.

Finally:

print

just prints out $_, which at this point contains the entire sig.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 04 Aug 1998 02:07:38 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Interesting Question needs Quick Answer
Message-Id: <m3yat515et.fsf@windlord.Stanford.EDU>

F Quednau <quednauf@nortel.co.uk> writes:

> #!/usr/bin/perl
> $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD

[...]

> #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
> $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD

[...]

> Now, that's not the same, is it ? :)

Nope.  :)

Short of doing things that I would consider cheating, like reading from
the DATA file handle or reopening $0, there's no way for the script to
actually *know* what's on the shebang line.  So instead the contents of
what's *supposed* to be on the shebang line are embedded in the script
itself, in an encoded form.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 4 Aug 1998 09:39:44 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Interesting Question needs Quick Answer
Message-Id: <6q6kt0$i66$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Russ Allbery 
<rra@stanford.edu>],
who wrote in article <m3yat515et.fsf@windlord.Stanford.EDU>:
> Short of doing things that I would consider cheating, like reading from
> the DATA file handle or reopening $0, there's no way for the script to
> actually *know* what's on the shebang line.

I consider this a bug.  It is this restriction which makes `R'estart
command of debugger so restrictred.

Still waiting for tuits,
Ilya


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

Date: 04 Aug 1998 02:59:46 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: luser is spelt L-O-S-E-R was Re: hiding user input
Message-Id: <m3k94p12zx.fsf@windlord.Stanford.EDU>

Warning:  No actual Perl content contained herein.

Steve Linberg <linberg@literacy.upenn.edu> writes:

> In the programming environment I came of age in (way back in the early
> 80s), "Luser" became a humorous substitute for "user" in program
> comments.  As in:

>     jsr  _CheckArgs      ; luser?
>     bcs  _DieHorribly    ; luser didn't sign in

:luser: n.  /loo'zr/ A {user}; esp. one who is also a {loser}.  ({luser}
   and {loser} are pronounced identically.)  This word was coined around
   1975 at MIT.  Under ITS, when you first walked up to a terminal at MIT
   and typed Control-Z to get the computer's attention, it printed out
   some status information, including how many people were already using
   the computer; it might print "14 users", for example.  Someone thought
   it would be a great joke to patch the system to print "14 losers"
   instead.  There ensued a great controversy, as some of the users didn't
   particularly want to be called losers to their faces every time they
   used the computer.  For a while several hackers struggled covertly,
   each changing the message behind the back of the others; any time you
   logged into the computer it was even money whether it would say "users"
   or "losers".  Finally, someone tried the compromise "lusers", and it
   stuck.  Later one of the ITS machines supported `luser' as a
   request-for-help command.  ITS died the death in mid-1990, except as a
   museum piece; the usage lives on, however, and the term `luser' is
   often seen in program comments.

From, where else, the Jargon File.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 04 Aug 1998 11:07:36 +0200
From: Matthias Neeracher <neeri@iis.ee.ethz.ch>
Subject: Re: MacPerl fully compatible? (directory problems)
Message-Id: <86btq1ktd3.fsf@gwaihir.ee.ethz.ch>

Victor Eijkhout <eijkhout@prancer.cs.utk.edu> writes:
> It looks like "opendir(HANDLE,path)" does not work, but "opendir HANDLE,path"
> does. I cannot get "readdir" to work at all. It returns a null result
> whatever I do.

What version of MacPerl would that be? I find this hard to believe, as:

 - I use opendir() and readdir() myself a lot.
 - I haven't touched the Perl parser ever since MacPerl 5.0.0, so I should not
   have introduced any syntax errors.

> Is MacPerl fully compatible?

Well, it received a score of 4670 on the last Perl Institute ISO 9001 audit.

Compatible with what?

Matthias

-- 
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
    "Look Bubba's got a new hat, ooh, he's such a cool cat" -- Moe Tucker


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

Date: Tue, 4 Aug 1998 11:46:29 +0100
From: Alan Silver <alan@find-it.furryferret.uk.com>
Subject: Re: Newbie questions...help!
Message-Id: <pECjeXAFaux1EwBa@find-it.uk.com>

In article <MPG.102f67d647c721969897af@nntp.hpl.hp.com>, Larry Rosler
<lr@hpl.hp.com> writes
<snip>
>> then it would do the same thing, but put each line (in ASCII terms) of
>> the file into an element in the array (as opposed to sticking them all
>> together like the previous example).
>
>You have this very wrong.  Unless the value of the input record sparator 
>$/ has been explicitly undefined, the first snippet copies the contents 
>of the file up to that value into $line.  By default, the value of $/ is 
>"\n", so it copies exactly one line, not the contents of the file.

Well, *very* wrong is perhaps overstating it. Thank you for correcting
my mistake. I usually use @file = <FILE>; which copies the whole file
into an array and I brainlessly wrote down that $file = <FILE>; would
put the whole file (as opposed to just the first line) into a salar.

>> By the way, I don't think the brackets around your example are needed.
>> As far as I know, $line = <FILE>; would work the same.
>
>This doesn't need an AFAIK, AFAIK.  The only purpose of these parentheses 
>is to specify the precedence of operator evaluation in an expression.  As 
>there is only one operator in that expression, the parentheses are 
>superfluous.

I put "AFAIK" as I recognise that I am not 100% error-free (as shown
above). Had I put 

        "$line = <FILE>; definitely works the same"

and then been wrong, I would have had my knuckles wrapped for it.

Alan

-- 
Alan Silver
Please remove the furryferret when replying by e-mail


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

Date: Tue, 4 Aug 1998 11:47:25 +0100
From: Alan Silver <alan@find-it.furryferret.uk.com>
Subject: Re: Newbie questions...help!
Message-Id: <qE8j+YA9aux1EwAe@find-it.uk.com>

In article <35C5CE00.F636292E@shaw.wave.ca>, Rick Delaney
<rick.delaney@shaw.wave.ca> writes
>Uh, no.  This sets the contents of the variable $line to the next record
>of the file opened with the handle FILE.  The record terminator is
>whatever $/ is set to, newline by default.

You're right, my mistake. This supports my final comments about not
posting replies by e-mail.

Alan

-- 
Alan Silver
Please remove the furryferret when replying by e-mail


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

Date: 04 Aug 1998 03:01:39 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl 5 bug list
Message-Id: <m3hfzt12ws.fsf@windlord.Stanford.EDU>

Alex McLintock <alex.mclintock@removethisbit.earthling.net> writes:

> The www.perl.com web site seems to suggest that there was an official
> bug list database which is no longer current.

> Is there one?

Unfortunately, no.  There is no current bug list because no one has had
the time and energy to set up and maintain one, a decidedly nontrivial
task.  There are occasional attempts, and some discussion of what software
to use, but most of them seem to die out.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Tue, 4 Aug 1998 07:04:14 -0200
From: <stefan@consilia.aland.fi>
Subject: Putting \r\n at end of lines using format and write
Message-Id: <Pine.SOL.3.95.980804065751.4773A-100000@lucas>

Hi all!

I have written a module that parses a textfile and format printfiles.
The problem is that I'm running it under linux but the actual printing is
done on a printer that needs \r\n (eg DOS-format) at end of each line,
otherways the printouts are all messed up.

Now I tried using $\ without any luck. I write everything to STDOUT.

Does anyone know how to tell format that it should put \r\n at end of each
line??

I tried search Dejanews and FAQ but I haven't found any solution.

If you have the answer please also CC to this address:
stefan@consilia.aland.fi

Best regards, 

S Linden



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

Date: 04 Aug 1998 03:11:04 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Putting \r\n at end of lines using format and write
Message-Id: <m3emux12h3.fsf@windlord.Stanford.EDU>

stefan@consilia.aland.fi writes:

> I have written a module that parses a textfile and format printfiles.
> The problem is that I'm running it under linux but the actual printing
> is done on a printer that needs \r\n (eg DOS-format) at end of each
> line, otherways the printouts are all messed up.

> Now I tried using $\ without any luck. I write everything to STDOUT.

> Does anyone know how to tell format that it should put \r\n at end of
> each line??

There may be better ways, but one option would be to embed the ^M in your
formats at the end of each line.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Tue, 4 Aug 1998 09:56:52 +0100
From: "Derek Chaloner" <Derek.Chaloner@securepay.co.uk>
Subject: redirection of script output
Message-Id: <35c6cca1.0@nnrp1.news.uk.psi.net>

Sirs,
I am having trouble with redirection and piping with my perl scripts using
NT4SP3.  Using the PATHEXT environment variable to execute a script without
having to preceed it with the perl executable works but I cannot redirect
the output.

(perl configuration shown at the end of this post)

I believe it is a NT problem and this was originally posted to to an NT news
group. Unfortunately the NT gurus have not been able to respond so I am
posting here as I think it is of general interest.

As you can see below I have associated the file type .pl with perlfile and
also given the filetype perlfile a command to execute.

The NT command output is shown below.
C:\TEST>assoc .pl
 .pl=Perlfile

C:\TEST>ftype perlfile
perlfile=perl.exe "%1" %*

The PATHEXT environment is set as below:-
PATHEXT=.COM;.EXE;.BAT;.CMD;.PL

Now here's the problem:-

(perl.exe is in a directory on the PATH)

The command
    perl perlver.pl >out.txt
results in out.txt containing the expected output but

    perlver >out.txt
results in an empty file being created.

The command
    perlver
results in the expected output on the screen.

Can anyone see the problem?.

Thanks in advance for your collected perls of wisdom.

Derek Chaloner


---------------------------------------------------------
c:\test>perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 01) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86
    uname=''
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cl.exe', optimize='-Od -MD -DNDEBUG', gccversion=
    cppflags='-DWIN32'
    ccflags ='-Od -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT   '
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release -machine:x86'
    libpth=\lib
    libs= oldnames.lib kernel32.lib user32.lib gdi32.lib  winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib  oleaut32.l
ib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ',
lddlflags='-dll -nologo -nodefaultlib -release -machine:x86'


Characteristics of this binary (from libperl):
  Built under MSWin32
  Compiled at Jul 29 1998 10:52:24
  %ENV:
    PERLSCRIPT="g:\perl"
  @INC:
    C:\perl\5.00501\lib/MSWin32-x86
    C:\perl\5.00501\lib
    C:\perl\site\5.00501\lib/MSWin32-x86
    C:\perl\site\5.00501\lib
    C:\perl\site\lib
    .







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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3338
**************************************

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