[13375] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 785 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 13 23:07:27 1999

Date: Mon, 13 Sep 1999 20:05:13 -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           Mon, 13 Sep 1999     Volume: 9 Number: 785

Today's topics:
    Re: another RE problem (Abigail)
    Re: another RE problem (Abigail)
    Re: ATTN: Who would like to write a perl IDE for linux (Abigail)
    Re: baffle about flock() please help! (Martien Verbruggen)
    Re: CGI from CGI without modules... <jeffp@crusoe.net>
    Re: CGI from CGI without modules... (Kragen Sitaker)
    Re: Deleting spaces in a string (Abigail)
    Re: Design Advice needed on Sending Data to Client (Abigail)
    Re: Exact matching? <dcr@canville.net>
    Re: Exact matching? (Kragen Sitaker)
    Re: Exact matching? <laurensmith@sprynet.com>
    Re: file renaming or copying (Charles DeRykus)
    Re: Good way to learn PERL (Abigail)
    Re: How to determine a file or folder on winNT (Larry Rosler)
    Re: how to mkdir on NT with Perl (Martien Verbruggen)
    Re: Is anyone capable of explaining this?? (Kragen Sitaker)
    Re: is it perl BUG !? (Larry Rosler)
    Re: Is perl Safe? (Kragen Sitaker)
    Re: Looking for tools. (DF)
    Re: output of backticks (Abigail)
    Re: output of backticks (Kragen Sitaker)
    Re: output of backticks <uri@sysarch.com>
    Re: parsing a record at specific columns (Abigail)
    Re: perl screen saver for UNIX terminals (Kragen Sitaker)
        perlcc won't compile Socket calls <aj_pahl@ameritech.net>
        Print and SendMail Syntax <preble@ipass.net>
    Re: Print and SendMail Syntax (Kragen Sitaker)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 13 Sep 1999 20:34:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: another RE problem
Message-Id: <slrn7tr9lp.f00.abigail@alexandra.delanet.com>

Michael Scheferhoff (m.scheferhoff@gmx.de) wrote on MMCCIV September
MCMXCIII in <URL:news:37DCF019.D877995D@gmx.de>:
<> 
<> is there a possibility to find out, how often a string matched?


Welllllllllll, you could try:

    {my $i = 0;
     $i ++ while $string =~ /match/;
     print $i}


But that would be kind of silly.

Could you define what you mean by "how often a string matched"?

If my regex is "aa", and my string is "aaaa", does that have 2 or 3
matches? What if the regex is "a+", and the string is "aaaa"? 4 matches?
1 match? 10 matches? They are all plausable, but it's unclear what
you mean.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Sep 1999 20:37:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: another RE problem
Message-Id: <slrn7tr9s4.f00.abigail@alexandra.delanet.com>

Jeff Pinyan (jeffp@crusoe.net) wrote on MMCCIV September MCMXCIII in
<URL:news:Pine.GSO.4.10.9909130840580.19013-100000@crusoe.crusoe.net>:
<> > is there a possibility to find out, how often a string matched?
<> 
<> Yes, there are many ways.
<> 
<> Here are two.  My favorite is the bottom one, although some say it's a
<> little ugly because it creates a temporary list.
<> 
<>   $count++ while /match/g;
<> 
<>   $count = () = /match/g;


But both of them count non-overlapping matches, sometimes gobbling up
more than necessary. I can see 2 "foofoo"s in "foofoofoo", but both of
your approaches count only 1.

And if the regex is "o+", you would count only one match for "oooooo",
but if you stick 3 f's in it to get "foofoofoo", your count is suddenly
3. That doesn't seem logical at all to me.


Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Sep 1999 20:09:37 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: ATTN: Who would like to write a perl IDE for linux
Message-Id: <slrn7tr87j.f00.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCCIV September
MCMXCIII in <URL:news:37dd1c76@cs.colorado.edu>:
``      [courtesy cc of this posting mailed to cited author]
`` 
`` In comp.lang.perl.misc, 
``     nathan@bigfreakinserver.com writes:
`` :I plan to develop a IDE for perl.
`` 
`` In short, Unix types are seldom interested in a new "IDE".


Well, he said "Linux". And while Linux in most, if not all, respects is
a Unix, it has large flocks of users that certainly aren't Unix types.
There are way too many "I like Windoze, but I don't like Microsoft, so
I use Linux, but still complain it doesn't look and feel like Windoze"
type people in the Linux world.



Abigail, on a GUI-free Linux.
-- 
perl -e 'for (s??4a75737420616e6f74686572205065726c204861636b65720as?;??;??) 
             {s?(..)s\??qq \?print chr 0x$1 and q ss\??excess}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 14 Sep 1999 02:50:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: baffle about flock() please help!
Message-Id: <xJiD3.121$Wz1.8975@nsw.nnrp.telstra.net>

In article <MPG.12461d25f93601bb989741@nntp1.ba.best.com>,
	moseley@best.com (Bill Moseley) writes:
> Martien Verbruggen (mgjv@comdyn.com.au) seems to say...

>> And, in fact, explicitly breaking the lock before closing (or at least
>> flushing) the file can be harmful. At least on some platforms.
> 
> perldoc -f flock
>           To avoid the possibility of miscoordination, Perl now
>           flushes FILEHANDLE before locking or unlocking it.
> 
> Might as well just close() if you can, but that bit of the docs makes it 
> sound like what you are talking about may not apply anymore?

Probably :)

In general it still holds, but it looks like perl has made it a less
dangerous operation. I probably still will not ever explicitly unlock
a file though :)

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | In the fight between you and the world,
Commercial Dynamics Pty. Ltd.       | back the world - Franz Kafka
NSW, Australia                      | 


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

Date: Mon, 13 Sep 1999 22:26:43 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: CGI from CGI without modules...
Message-Id: <Pine.GSO.4.10.9909132224540.19013-100000@crusoe.crusoe.net>

[posted & mailed]

On Sep 13, John J. Straumann blah blah blah:

> CGI, but is there a way to do this without having to get all those
> modules? 
> 
> If my initial observations of these moduels are correct, I need to
> install a bunch of stuff on my server, is this true? If so, I can't do
> this, I need to have this script be protable and self-contained.

"All those modules"?

All I'd need to do it is CGI.pm, which is in the standard distribution.
Your program will be portable.  If you're scared, package the latest
version of CGI.pm with it, and notify the client of the importance of
upgrading the Perl module(s) associated with the program.

-- 
jeff pinyan    japhy@pobox.com
perl stuff     japhy+perl@pobox.com
CPAN ID: PINYAN            http://www.perl.com/CPAN/authors/id/P/PI/PINYAN



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

Date: Tue, 14 Sep 1999 02:47:49 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: CGI from CGI without modules...
Message-Id: <pHiD3.9371$N77.717958@typ11.nn.bcandid.com>

In article <Pine.GSO.4.10.9909132224540.19013-100000@crusoe.crusoe.net>,
Jeff Pinyan  <japhy@pobox.com> wrote:
>"All those modules"?
>
>All I'd need to do it is CGI.pm, which is in the standard distribution.

People were advising that he use libwww-perl, which is a reasonable
thing to advise.

The answer is that (a) it's easy to install libwww-perl (aka LWP) as a
module in your own directory (I think; I haven't installed it, although
I've installed other modules, and they were easy); (b) it's relatively
easy to do brain-dead HTTP requests by hand (just read the HTTP spec).

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 13 Sep 1999 20:40:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Deleting spaces in a string
Message-Id: <slrn7tra1t.f00.abigail@alexandra.delanet.com>

Jeff Pinyan (jeffp@crusoe.net) wrote on MMCCIV September MCMXCIII in
<URL:news:Pine.GSO.4.10.9909130730000.19013-100000@crusoe.crusoe.net>:
() [posted & mailed]
() 
() On Sep 13, Vincent BEZARD blah blah blah:
() 
() > I have a string witch looks like "23 6659 478", and I want to del all the
() > spaces, in order to get a interger like "236659478". I tried =~ s/\s+//, but
() 
() Such a popular question, it's in the FAQ.
() 
() from perlfaq4:
() 
()      How do I strip blank space from the beginning/end of a
()      string?


Now, how many spaces are there in the beginning and end of "23 6659 478"?
I don't count one.

The quoted FAQ doesn't lead in an obvious way to the answer of Vincents
question. However, the section about tr/// in the perlop manpage does.




Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Sep 1999 20:45:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Design Advice needed on Sending Data to Client
Message-Id: <slrn7traat.f00.abigail@alexandra.delanet.com>

Alan Curry (pacman@defiant.cqc.com) wrote on MMCCIV September MCMXCIII in
<URL:news:FDbD3.8333$N77.652041@typ11.nn.bcandid.com>:
** 
** RFC2616 obsoletes 2068 (and no I don't know what the differences are, I just
** happen to have 2616 nearby)


I guess you have to read section 19.6.3, "Changes from RFC 2068" then. ;-)



Abigail, having almost all RFCs nearby.
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 13 Sep 1999 22:02:19 +0000
From: "Dan C. Rinnert" <dcr@canville.net>
Subject: Re: Exact matching?
Message-Id: <37DD7462.623B@canville.net>

I don't know what happened to the text of my original message, but what
I was trying to ask is how can I do an exact match in Perl?  I haven't
found anything in the FAQ or the books I have to do that.

For example, if a user enters "a" I want the script to do (a), and if
the user enters "b" I want the script to do (b), and if the user enters
"ab" I want the script to do (c).  The way it's been working in the
different ways I've tried, entering "ab" results in the script doing
(a), not (c).

Now, if I try to match "ab" first, then "a" and "b" that will work, but
that's not a real solution, because I'll have more possibilities than
just "a", "b" or "ab", and there's got to be an easier way to match that
up exactly.  Plus, if the user enters "abc", I don't want the script to
recognize the "ab" and run (c), I want it to reject the submission and
ask the user again for a correct entry.

Any ideas?

Thanks,
Dan


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

Date: Tue, 14 Sep 1999 02:27:34 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Exact matching?
Message-Id: <qoiD3.9335$N77.714687@typ11.nn.bcandid.com>

In article <37DD7462.623B@canville.net>,
Dan C. Rinnert <writersU06@canville.com> wrote:
>I don't know what happened to the text of my original message, but what
>I was trying to ask is how can I do an exact match in Perl?  

eq and hash indexing
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Mon, 13 Sep 1999 19:31:32 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: Exact matching?
Message-Id: <7rkc28$qjl$1@brokaw.wa.com>


Dan C. Rinnert wrote in message <37DD7462.623B@canville.net>...
>For example, if a user enters "a" I want the script to do (a), and if
>the user enters "b" I want the script to do (b), and if the user enters
>"ab" I want the script to do (c).  The way it's been working in the
>different ways I've tried, entering "ab" results in the script doing
>(a), not (c).
>
>Now, if I try to match "ab" first, then "a" and "b" that will work, but
>that's not a real solution, because I'll have more possibilities than
>just "a", "b" or "ab", and there's got to be an easier way to match
that
>up exactly.  Plus, if the user enters "abc", I don't want the script to
>recognize the "ab" and run (c), I want it to reject the submission and
>ask the user again for a correct entry.

perlfaq7 "How do I create a switch or case statement?"

and then read up on the 'eq' operator.

Lauren




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

Date: Tue, 14 Sep 1999 01:07:13 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: file renaming or copying
Message-Id: <FI0z41.Kyo@news.boeing.com>

In article <7rjf08$s9$1@nnrp1.deja.com>,  <dave_pomeroy4266@my-deja.com> wrote:
>I am trying to either rename a file or copy it.  When I attempt to
>rename it the status returns false.  When I copy it the status returns
>true but the new file is empty.  Anyone have any ideas?  I am in win32.

Are you using File::Copy ?  Were there any errors ?

e.g,

use File::Copy;

move("c:/temp/foo","c:/temp/bar") 
    or warn "move failed: $!";

Rgds,
--
Charles DeRykus


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

Date: 13 Sep 1999 20:46:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Good way to learn PERL
Message-Id: <slrn7tradk.f00.abigail@alexandra.delanet.com>

Scratchie (AgitatorsBand@yahoo.com) wrote on MMCCIV September MCMXCIII in
<URL:news:In7D3.350$n82.59595@news.shore.net>:
`` 
`` Step 3: I wouldn't try to learn perl by reading the man pages.

Damn. That must be while all my Perl programs don't work!



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 13 Sep 1999 18:37:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to determine a file or folder on winNT
Message-Id: <MPG.124746d05ed9169d989f5c@nntp.hpl.hp.com>

In article <MPG.124831d74e82782c989cc5@news-server> on Tue, 14 Sep 1999 
11:20:42 +1000, elephant <elephant@squirrelgroup.com> says...
> Jon writes ..
> >Is there a way to determin whether an object is a file or a folder without
> >using the -d $filename. This does not seem to work on winNT.
> 
> the -d function works fine on all Win32 platforms .. review your logic

In particular, make sure you are using absolute paths for the filenames 
in the '-d' test.  The 'current directory' relative to the program may 
not be the same on different platforms. 

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 14 Sep 1999 02:44:20 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how to mkdir on NT with Perl
Message-Id: <8EiD3.119$Wz1.8975@nsw.nnrp.telstra.net>

In article <37d8ac10.92012574@news.dowco.com>,
	randys@dowco.com (Randy) writes:
> I would like to know if there is a way i could create 

# perldoc -f mkdir

>                                                       or edit
> directories in NT with Perl?

open the directory in the hex editor of your choice and go for it. I
don't really know whether NT allows this... Maybe you should work on
the raw disk blocks.

Other, less direct methods include creating, removing, or altering the
sizes of files in that directory. Even modifying the file without
changing its size will change your directory.

What exactly do you mean by 'editing' a directory?

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.       | make up 3/4 of the population.
NSW, Australia                      | 


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

Date: Tue, 14 Sep 1999 03:03:15 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Is anyone capable of explaining this??
Message-Id: <TViD3.9395$N77.720972@typ11.nn.bcandid.com>

>> Sent via Deja.com http://www.deja.com/
>> Share what you know. Learn what you don't.
>
>We can't hold you responsible for that absurdity, except for your poor 
>choice of ISP.

I'm wondering about this.  Isn't it reasonable to hold people
responsible for their poor choice of ISP?  The first few times I saw
people flamed from posting from somewhere that appended such
advertisements, I was sympathetic with the flamee; but now I am
sympathetic with the flamer.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Mon, 13 Sep 1999 18:04:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: is it perl BUG !?
Message-Id: <MPG.12473ee185119e6c989f5a@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7recvs$l1c$1@taliesin.netcom.net.uk> on Sat, 11 Sep 1999 
21:12:45 +0100, nntp.netcom.net.uk <clint@drtech.co.uk> says...
> Modulus as it is implemented in Perl is predisposed to problems with large
> numbers.

Any implementation of modulus is predisposed to problems with large 
numbers.  When the numbers are large enough so that they cannot be 
represented exactly as integers using double-precision floating-point 
representation, loss of precision will occur, down to 0 bits if the 
numbers are large enough.

> It seems to calculate the modulus with this formula : (for $foo % $bar)
> modulus = int($foo/$bar) * $bar

  ($foo, $bar) = (5, 3);

  $foo/$bar is 1.6666666666...

  int($foo/$bar) is 1

  1 * $bar is 3

But $foo % $bar is 2.  What do you really mean to say?

> A different formula would be more accurate :
> modulus = $foo/bar - int ($foo/bar)

  1.6666666666... - 1 is 0.6666666666...

What do you really mean to say?

The modulus operator is defined as

  $a - int($a/$b) * $b

Where $b is not 0.  See perlop for further details.  Note the 
subtraction, which is where the loss of precision can occur.  If you 
have a better way, please publish it.  Perhaps you will win the Fields 
Medal.
 
<SNIP> of reposting of entire very long post with lots of irrelevant 
data, but copied without comment

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 14 Sep 1999 02:10:08 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Is perl Safe?
Message-Id: <48iD3.9283$N77.712255@typ11.nn.bcandid.com>

In article <37DD7F37.C79E4AE8@mail.cor.epa.gov>,
David Cassell  <cassell@mail.cor.epa.gov> wrote:
>Tom Christiansen wrote:
>[7 quoted lines]
>
>Why do I visualize Bill Clinton when I read this?
>
>[6 quoted lines, including a .sig]
>
>David    
>"Stop Dave.  Please Dave, don't do this..."
>-- 
>David Cassell, OAO                     cassell@mail.cor.epa.gov
>Senior computing specialist
>mathematical statistician

I think I'll modify the news-scanning software to include a bottom 100
OCR posts.  The post I'm quoting has one line of content, 13 lines of
quotes, one line of attribution, four lines of normal cutlined
 .signature, 2 lines of something else that looks like a
 .signature, and three other blank lines.  Rough OCR: 1 line of content 
out of 23 nonblank lines, so 0.043.  Spectacular.

I also think I should have it send email to people who post such things
notifying them of the prize they have won.  Maybe I could include a
virus.

Nah, I won't do that.  I'm just bitter.  I just visited a newsgroup
that was one of my favorites four years ago.  It has thousands of
messages in it.  All of them are porn spam.  Then I visited
alt.unix.wizards, which was originally a newsgroup for discussion of
wizardly Unix matters, by the kinds of people who would be confident
modifying their running kernels with adb.  It was full of people who
wanted advice on getting vt100 emulation working correctly and
partitioning their hard disk.

I am sad and angry.  I want to hurt the people who have done this to
Usenet, the place I used to come to learn so many things, the place
where there was once a set of communities.  I know I would never do
such a thing, of course; violence never solves problems, but only
displaces them.  I'll just nurse my sadness and try to create something
better in the future.

Not all is bad.  I've seen dozens of people get hard questions answered
within hours on comp.lang.perl.misc in the last week or so I've been
posting.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 14 Sep 1999 01:09:17 GMT
From: deviantfreak@yahoo.com (DF)
Subject: Re: Looking for tools.
Message-Id: <37dd9fe3.10932581@nntp.ix.netcom.com>

"Sidney Orret" <orret@wmn.net> wrote:

>What are the best enviroment and tools for PERL's programming?

I'm personnally having a rather passionate love affair with Edit Plus,
which you can search for at www.tucows.com. I use it for HTML, Perl,
Java, and C++. Absolutely love it.

-DF


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

Date: 13 Sep 1999 20:52:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: output of backticks
Message-Id: <slrn7trao8.f00.abigail@alexandra.delanet.com>

David Cassell (cassell@mail.cor.epa.gov) wrote on MMCCIV September
MCMXCIII in <URL:news:37DD86B9.3C58666B@mail.cor.epa.gov>:
// 
// This is a cute trick I learned by studying the nefarious works
// of Abigail.  Note that I *should* have learned it by studying
// the Perl internals, but...


Since my knowledge of Perl internals is less than my knowledge of
the sexlive of antartic sparrows, there are other ways to get the
knowledge to do such tricks.

TPJ comes in mind.



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 14 Sep 1999 02:24:13 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: output of backticks
Message-Id: <hliD3.9326$N77.714459@typ11.nn.bcandid.com>

In article <37DD86B9.3C58666B@mail.cor.epa.gov>,
David Cassell  <cassell@mail.cor.epa.gov> wrote:
>perl -lne '$x++ if !/^\s*$/;}{print $x' netlog.txt

That *is* a cute trick; I was intrigued the first time I saw it in
Abigail's .signature.  IMHO, though, it's much too tricky to appear
outside a .signature.  :)

You are, of course, welcome to argue.  Welcome back from vacation!  :)

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 13 Sep 1999 22:43:54 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: output of backticks
Message-Id: <x7906akyab.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> Since my knowledge of Perl internals is less than my knowledge of
  A> the sexlive of antartic sparrows, there are other ways to get the
  A> knowledge to do such tricks.

so what is the mean carrying weight for a horny antarctic sparrow?

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 13 Sep 1999 20:51:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: parsing a record at specific columns
Message-Id: <slrn7tral7.f00.abigail@alexandra.delanet.com>

Paul Leduc (pleduc@your_finger.home.com) wrote on MMCCIV September
MCMXCIII in <URL:news:37DCEBB5.BC656964@your_finger.home.com>:
^^ 
^^ The question is: how do I parse a record at specific columns?


substr


Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 14 Sep 1999 02:42:22 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: perl screen saver for UNIX terminals
Message-Id: <iCiD3.9362$N77.717203@typ11.nn.bcandid.com>

In article <7rk1rk$fel$1@nnrp1.deja.com>,  <mizpoon@my-deja.com> wrote:
>I want to exit the loop if someone presses a key. This code works fine,
>but you may need to wait until the end of the sleep command, for the
>loop to exit. Does anyone have any ideas on how to exit the loop as
>*soon* as there is a keystroke?

Select for read on stdin.  perldoc -f select.  The four-argument form,
not the one-argument select FILEHANDLE.

This won't quite work unless you make sure your input is in cbreak or
raw mode; otherwise it won't be readable until the user hits return.

Also, I'm not sure whether you'll get suspended if you try this while
you're not in the foreground, and I'm too damn lazy to check.

Oh, damn, I can't really post something that says that, can I?  OK.

#!/usr/bin/perl -w
use strict;
my $rin = '';
vec($rin,fileno(STDIN),1)=1;
my $rout;
for(;;) {
	if (select($rout=$rin,undef,undef,2)) {
		warn "select returned true\n";
		if (vec($rout,fileno(STDIN),1)) {
			my $x;
			sysread(STDIN, $x, 1024);
			warn "got $x";
		}
	} else {
		warn "select returned false\n";
	}
	if (vec($rout,fileno(STDIN),1)) {
		warn "x\n";
	} else {
		warn "y\n";
	}
	sleep 1;
}

What I find out on Solaris:
- select only returns true when there's something to read -- i.e. I've typed
	something and hit return.
- it returns false when it times out.
- vec($rout,0,1) is true when there's something to read.
- it runs fine in the background without being suspended (running from tcsh)

>I had one idea, which is to implement my own version of sleep, which
>would wake up every second, and poll for a keystroke. This works well,
>but if I use ReadKey, it slurps in anything in STDIN. I'd rather
>*check* to see if there is anything in the STDIN buffer, rather than
>reading it. if that is possible.

Yes.  But the fact that you want to do this makes me think that you
will be doing this as a background process, something substantially
similar to the script I have above.  Such a process can certainly clear
the screen, but it cannot redraw the screen when a keystroke is
pressed.

>please help me if you can. This kind of thing is easy with windows
>event-driven libraries, but I can't figure out how to implement it on
>UNIX

select() is the royal road to Unix event handling.  Unfortunately.
(But it's still better than WaitForMultipleEvents().)

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Mon, 13 Sep 1999 22:33:28 -0400
From: "AJ Pahl" <aj_pahl@ameritech.net>
Subject: perlcc won't compile Socket calls
Message-Id: <cpiD3.4227$aS.905@nntp0.chicago.il.ameritech.net>

I've been able to compile a perl -> c program without problems.
But when in introduce something like 'use Socket;'  perlcc
takes a dump and says;

No definition for sub Socket::PF_UNIX
No definition for sub Socket::PF_UNIX (unable to autoload)

 ...it does this for AF_INET, SOCK_STREAM..and so on and
so forth...

I've tried fixing it by modifiying Config.pm and Autoload.pm,
but nothing seems to work

It's a Sparc Solaris 7 environment using Perl 5.00503.
Any clues?





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

Date: Mon, 13 Sep 1999 21:56:54 -0400
From: "E. Preble" <preble@ipass.net>
Subject: Print and SendMail Syntax
Message-Id: <7UhD3.47$A3.117@news.ipass.net>

I am using sendmail to send an email from perl, and am using
the print command to dump output to the email itself.  I've
got a syntax that looks like this for dumping a hash into
sendmail, but ti's not working so I'd like more information
on related syntaxes to see if I can tweek it.

$top->print(\*MAIL);

where top contains mime entities (email headers, body and
attachments). MAIL is defined by:
open MAIL, "|$mailprog -t -i" or die "open: $!";

How do these commands work (syntaxes)?

Thanks Ahead

Edward Preble

--
Datatrend Software
http://www.datatrendsoftware.com
mailto:info@datatrendsoftware.com

Grab It! digitizer for MS Excel
Double Check It Products
Automail scripts for website automation
----------------------------------------------------



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

Date: Tue, 14 Sep 1999 02:26:26 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Print and SendMail Syntax
Message-Id: <mniD3.9333$N77.712324@typ11.nn.bcandid.com>

In article <7UhD3.47$A3.117@news.ipass.net>,
E. Preble <preble@ipass.net> wrote:
>I am using sendmail to send an email from perl, and am using
>the print command to dump output to the email itself.  I've
>got a syntax that looks like this for dumping a hash into
>sendmail, but ti's not working so I'd like more information
>on related syntaxes to see if I can tweek it.
>
>$top->print(\*MAIL);

What is $top?  If it's some kind of object that has a print method that
takes a filehandle arg, this should work.  But if it's a string, you
want print MAIL $top;

perldoc -f print explains this "indirect object" syntax.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 785
*************************************


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