[9243] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2838 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 11 11:17:13 1998

Date: Thu, 11 Jun 98 08:00:38 -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           Thu, 11 Jun 1998     Volume: 8 Number: 2838

Today's topics:
    Re: [META] hypersensitivity (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
    Re: [META] hypersensitivity (Greg Bacon)
    Re: ascii to hex (Tad McClellan)
    Re: Certified Perl Programmers jduncan@hawk.igs.net
    Re: Certified Perl Programmers (Chris Nandor)
    Re: CFV: comp.lang.perl.moderated moderated <jdporter@min.net>
    Re: CFV: comp.lang.perl.moderated moderated (Greg Bacon)
    Re: Command line substitution thru subdirectories (David Combs)
    Re: Command line substitution thru subdirectories (David Combs)
    Re: Command line substitution thru subdirectories (David Combs)
    Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
    Re: comp.lang.perl.(n|q) another option? <jdporter@min.net>
    Re: conditional use statement?? <jwilson@ic.ac.uk>
        create RTF file on the fly? <richard@see.my.sig>
    Re: Having problems locating a bug!  Can anyone help? - <jdporter@min.net>
    Re: linker counter (Jouke Visser)
    Re: linker counter (Abigail)
    Re: localtime() and y2k Philip_Heggie@msn.com
    Re: MODERATION: Time to Vote <jdporter@min.net>
    Re: Non-blocking Perl socket calls? <rharold@mail.ford.com>
    Re: NT CGI with $string = `command`; scott@softbase.com
    Re: Number of digits in a string <jdporter@min.net>
    Re: One output stream to two dests <quentin@shaddam.amd.com>
        Passing variables from bourne script to perl script <mferg@hal.ddntl.didata.co.za>
        Perl and Verity <peredina@progress.com>
        PERL syntax rduyme@ireste.fr
    Re: print <<EOT; problems <dsanders@netxchange.com>
    Re: Prob in FAQ: Week of the year <david.richards@alderley.zeneca.com>
        Problem with some s/// code dejajustin@my-dejanews.com
    Re: Problem with some s/// code (Larry Rosler)
        Process (Deva Seetharam)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 11 Jun 1998 16:07:15 +0100
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: [META] hypersensitivity
Message-Id: <lassehp-1106981607150001@ra.imv.aau.dk>

In article
<uk96o5jsh.fsf@JIMBOSNTSERVER.i-have-a-misconfigured-system-so-shoot-me>,
jimbo@soundimages.co.uk wrote:
>Scratchie <upsetter@ziplink.net> writes:
>> Greg Bacon <gbacon@cs.uah.edu> wrote:
>> : : You know, there was a time when I used to auto-select your posts.
>> : It's really disheartening to see such a high population of
>> : hypersensitive crybabies in this newsgroup.  I'll be glad when the first
>> : of July has come and gone.

>Even more disheartening is that Mr. Bacon is a moderator should a
>moderated group become reality.

Although I believe Mr. Bacon's comment above was unjustified, I am
confident that as a moderator he will do his job right. What
comp.lang.perl.moderated will be like remains to be seen.

> I fear that Perl, if left to the likes
>of Mr. Bacon, will become (even more than today) a culture of us vs
>them. The **in the know and are'nt we just the greatest wizards of all
>time** vs **the rest of us who have heard and want to learn and use
>Perl but are considered sub human because we hold an OS license from
>Redmond**.

(Or Cupertino, for that matter.)

Perl (the language) has it's own problems, cross-platform transparency
being perhaps the least.

Perl (the culture) needs to detach more from its Unix-centric roots and be
more open towards other OSes. This means people have to accept and respect
other people's choice of OS, not that they have to like it. What help are
Open Source and Open Software when we don't have Open Minds? Certainly
Unix (any variety) has flaws too. In a perfect world, we'd have "Ray F.
Piodasoll"'s 'Perl machine' described recently in TPJ, but this isn't a
perfect world. In this world people use Unix, DOS, Windows, MacOS, VMS,
MVS, even CP/M, because we have to or like to. Some of us even take pride
in our choices; or use more than one OS and have a hard time whenever
eager proponents of one of our favorite OSes say bad things about the
others.

Perl is a programming language, and I believe one of the finest qualities
of a programming language is it's ability to be adapted to various
dissimilar platforms. Perl certainly has that quality. This may not have
been intentional, but still it is a fact that some people apparently must
learn to live with.

(From "That's all, folks", 29 Apr 1993:)
"Usenet is like a herd of performing elephants with diarrhea --
massive, difficult to redirect, awe-inspiring, entertaining, and a
source of mind-boggling amounts of excrement when you least expect
it."        --spaf (1992)

It seems this herd has been performing in c.l.p.m for quite a while now.
(Calling the elephants by proper names is left as an exercise for the
reader.)

I am tempted to add that in order to throw with large amounts of
excrement, you have to be full of it.

-Lasse


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

Date: 11 Jun 1998 14:29:37 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: [META] hypersensitivity
Message-Id: <6lopkh$ajj$6@info.uah.edu>

jimbo@soundimages.co.uk writes:
: I fear that Perl, if left to the likes
: of Mr. Bacon, will become (even more than today) a culture of us vs
: them. The **in the know and are'nt we just the greatest wizards of all
: time** vs **the rest of us who have heard and want to learn and use
: Perl but are considered sub human because we hold an OS license from
: Redmond**.

Have you stopped beating your wife?

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: Thu, 11 Jun 1998 08:48:26 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: ascii to hex
Message-Id: <a7nol6.lig.ln@localhost>

Jason Oakley (waulok@trust-me.com.SPAMLESS) wrote:
: 	How do i convert eg. "hello21" into it's hex equiv of each
: character?


--------------------------
#!/usr/bin/perl -w
   
$str = 'hello21';

### use split() and concatenation
foreach (split //, $str) {
   $hex .= sprintf "%x", ord($_);
}
print "$hex\n";


### use a regex substitution
$str =~ s/(.)/sprintf "%x", ord($1)/ge;
print "$str\n";
--------------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 11 Jun 1998 13:25:53 GMT
From: jduncan@hawk.igs.net
Subject: Re: Certified Perl Programmers
Message-Id: <6lolt0$coi$1@nnrp1.dejanews.com>

In article <6lk05p$9h3$1@monet.op.net>,
  mjd@op.net (Mark-Jason Dominus) wrote:
>
> I've been thinking that if some people need physical certificates, I
> could print some up and supply them for a nominal fee, maybe $2.  It
> gives me the willies to take any money at all for certifications, but
> it might be for the greater good.  I guess I'll do it if it becomes
> necessary, or maybe I'll give some out for free at the Perl
> Conference.
>
   SASE's would do the trick,  then we could all put the certificate on our
walls,  and be all official. Well, nearly....

Cheers!
James

--
jduncan@hawk.igs.net

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 11 Jun 1998 13:50:44 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Certified Perl Programmers
Message-Id: <pudge-1106980945030001@dynamic174.ply.adelphia.net>

In article <6lolt0$coi$1@nnrp1.dejanews.com>, jduncan@hawk.igs.net wrote:

# In article <6lk05p$9h3$1@monet.op.net>,
#   mjd@op.net (Mark-Jason Dominus) wrote:
# >
# > I've been thinking that if some people need physical certificates, I
# > could print some up and supply them for a nominal fee, maybe $2.  It
# > gives me the willies to take any money at all for certifications, but
# > it might be for the greater good.  I guess I'll do it if it becomes
# > necessary, or maybe I'll give some out for free at the Perl
# > Conference.
# >
#    SASE's would do the trick,  then we could all put the certificate on our
# walls,  and be all official. Well, nearly....

I know ... every attendee to TPC gets a certification certificate in his
registration packet!  :-)

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Thu, 11 Jun 1998 14:33:38 GMT
From: John Porter <jdporter@min.net>
Subject: Re: CFV: comp.lang.perl.moderated moderated
Message-Id: <357FEC3A.50@min.net>

Steffen Beyer wrote:
> 
> In other words, the people frequenting this newsgroup will have *NO*
> democratic means of controlling the moderation panel.
>[snip]

You are free to initiate your own moderated newsgroup.
(USENET is democratic that way!)
If you want moderation, you have to expect some degree of
autocracy from the moderator(s).

I'll be waiting for your RFD.

John Porter


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

Date: 11 Jun 1998 14:23:44 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: CFV: comp.lang.perl.moderated moderated
Message-Id: <6lop9h$ajj$5@info.uah.edu>

In article <6loasp$3ol$2@bsdti6.sdm.de>,
	Steffen Beyer <sb@sdm.de> writes:
: In other words, the people frequenting this newsgroup will have *NO*
: democratic means of controlling the moderation panel.

There will be a public mailing list for people interested in the group's
policies.  Moderators are appointed and removed by a two-thirds majority
vote.  If complaints about policies or moderators were sufficiently loud
and warranted, I should think a vote would come up.

: (E.g., if a person from the moderation panel (or the moderation panel as
: a whole) made arbitrary decisions, people frequenting the newsgroup would
: have no means to remove that person from the panel, for example, or simply
: to elect a different moderation panel.)

How would you make such a process even remotely practical?  There is a
reason representative governments tend to be so successful, you know.

: Who are the (self-appointed, after all) members of the moderation panel,
: anyway?

Greg Bacon, rush chairman, damn fine to meet you. :-)

: I am greatly in favour of a moderated Perl newsgroup (I have been waiting
: for it unpatiently for years), but I cannot vote in favour of it as long
: as there is not the slightest hint of at least some democratic control.

Errr.. what moderated groups have the sort of democratic control for
which you're looking?

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: Thu, 11 Jun 1998 12:43:30 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <dkcombsEuE0oI.39y@netcom.com>

In article <357df582.181121141@152.2.25.74>,
Xuming Wang <xuming@email.unc.edu> wrote:
>abigail@fnx.com (Abigail) wrote:
>
>>Bob Roklan (roklan_r@code80.npt.nuwc.navy.mil) wrote on MDCCXLIII
>>September MCMXCIII in <URL: news:357DA4E9.DA495FD6@code80.npt.nuwc.navy.mil>:
>>++  I am running Perl 5.003 on Windows 95. I would like to specify a
>
>>++ but how can I tell perl to do the same for a specified directory and
>>++ down?
>>
>>$ find . -name '*.htm' | xargs perl -i.old -p -e "s/foo/bar/g"
>
>C:\>find . -name '*.htm' | xargs perl -i.old -p -e "s/foo/bar/g"
>FIND: Parameter format not correct
>Bad command or file name
>
>--
>Xuming Wang


You need a set of unix tools on your pc.

The simplest way is to buy the "MKS TOOLS",
avail from most any pc software vendor.

Will turn your toy into a real computer.
Really.

cheers

(the mks tools is just an application that
works within windows or nt)



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

Date: Thu, 11 Jun 1998 12:54:17 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <dkcombsEuE16H.4F2@netcom.com>

In article <6lm7nr$e1j$1@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, 
>    dsdapc03@DSDAPC03.okladot.state.ok.us (OS2 User) writes:
>:A really _great_ way to attract business to a Perl consultancy. 
>:Maybe you should go into advertising, too. And Human Relations
>:also might be a good choice.
>
>I prefer to be a real person with real opinions who doesn't lie just
>because it suits his pocket book and becomes a money-grubbing pig who
>changes his words into lies to try to get more people to kiss his behind
>and ante up.  I won't do that.  I do Perl because it's fun, not because
>I want to become the next billgatesionaire.  If you can't take the heat,
>get out of the kitchen.
>
>--tom
>-- 
>    "The only reason for being a professional writer is that 
>     you can't help it."
>	--Wilson Mizner



Tom:  A lot of these poor bastards using M$ don't use
it because they WANT to -- their employers FORCE
them to use it.

Simply tell them, maybe, that perl is a unix-oriented
system, and that they MUST have the standard unix "tools"
available, and that they can most easily get them
from MKS tools ($$$), or from gnu.

Maybe there should be a faq (maybe already is) for
"perl on wintel", telling them where to get the tools,
how to download them, how and where to install them.

Anyway, nice to see you back on the newsgroup
(I haven't been reading it for some months, but
back then you had long ago dropped out).



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

Date: Thu, 11 Jun 1998 13:03:27 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <dkcombsEuE1Lr.52A@netcom.com>

In article <6lmehi$k47$2@client3.news.psi.net>,
<snip>
Abigail <abigail@fnx.com> wrote:
>As for canned solutions to emulate Unix tools on an MS platform,
>ask in an MS specific group. Not a Perl group.

COME ON!  GROW UP!  What's wrong with being NICE
to people?

Just tell the poor guy that perl requires unix tools,
and where he can get them.

Keep a prepared file with that info, and just :r it into
your response!

These poor guys using M$ for ANYTHING have a hard enough
time as it is, without you and others bitching at them.

David



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

Date: 11 Jun 1998 13:40:09 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lomnp$4tu$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, dkcombs@netcom.com (David Combs) writes:
:Just tell the poor guy that perl requires unix tools,
:and where he can get them.

This is not accurate.  Perl doesn't require Unix tools.  After all,
it works on many other systems as well.  However, many operations
that people want to do in fact require something other than Perl.
Having small, appropriate tools to do dedicated things is important.
Perl doesn't do everything, although of course it *could*.  But telling
them how to use Perl to compile a C program without recourse to system()
will not be doing them a service.

If someone asked how to use a spreadsheet to typeset a document, fetch a
web document, and also please reboot their computer, should you tell them?
Even if you had figured how to do those things, it doesn't make it right.

What's happening is a culture shock between the monolithic, plug-n-play
mentality and that of the toolsmith mentality.  People are asking the
wrong questions for the wrong reasons.  If we tell them the exact answer
to their literal question, we do them a disservice.  Spreadsheets aren't
the best thing for making toast.  Toasters are.

--tom
-- 
		Don't look back, the lemmings are gaining on you.


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

Date: Thu, 11 Jun 1998 13:15:14 GMT
From: John Porter <jdporter@min.net>
Subject: Re: comp.lang.perl.(n|q) another option?
Message-Id: <357FD9DB.2109@min.net>

Tom Christiansen wrote:
> 
> The pods get [to] be grepped!

Now everyone, grep your pod, and we'll begin...

John Porter


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

Date: 11 Jun 1998 14:41:43 GMT
From: "Jeff Wilson" <jwilson@ic.ac.uk>
Subject: Re: conditional use statement??
Message-Id: <01bd9547$0c7a7310$d53ec69b@leicester>

The values in the %ENV hash can be used. 
-- 
 .

                         Jeff Wilson
                         London - UK

Craig M. Votava <craig@lucent.com> wrote in article
<357F05F7.6231@lucent.com>...
> Folks-
> 
> I want to write a single perl script that will
> detect what OS it is running under, so it can
> use the system call to launch a command
> if on a unix machine, or the Win32::Process
> stuff if on a windows based machine.
> 
> This doesn't work:
> 
> =======================================
> use English;
> 
> if($OSNAME eq "MSWin32") {
>         use Win32;
>         use Win32::Process;
> }
> 
> print "OSTYPE=$OSNAME\n";
> .
> .
> .
> ========================================
> 
> How should I be doing this?
> 
> Thanks
> 
> -Craig
> 


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

Date: Thu, 11 Jun 1998 14:48:32 +0100
From: "Richard G. Coleman" <richard@see.my.sig>
Subject: create RTF file on the fly?
Message-Id: <YDLrwBAwA+f1Ew3r@alchemedia.co.uk>

Hi

Does anyone know of a way (or a program) to create an RTF file or other
readable document from form entries.  It should be able to create tables
in the document.  

Many thanks

Richard
-- 
             Richard G. Coleman  |  richard@alchemedia.co.uk
     Alchemedia Interactive Ltd  |  http://www.alchemedia.co.uk/
                  Multimedia CDROM & Web Site Design
     -----------------------------------------------------------
     These comments represent Richard's views, not Alchemedia's


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

Date: Thu, 11 Jun 1998 14:20:37 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Having problems locating a bug!  Can anyone help? - di.txt (0/1)
Message-Id: <357FE92E.4D88@min.net>

Chris Reynolds wrote:
> 
> I previously posted on needing help with reading a directory and the
> subdirectories and the size of all the files .. well, I worked on it
> and I have almost all of it complete, however, I cannot seem to figure
> out where I went wrong.  I can read each directory in the main
> directory, however, here is the problem,  I can read the first
> sub-directory but if there is more then one subdirectory it skips them
> and goes back to the directory before that and moves along each other
> directories in order .. can anyone see what I am missing or what I did
> wrong?

I don't know exactly "where" you went wrong, but I have a good idea
*when*: very early.

Bug #1: on the first line of sub DoDir, add a "my":
	my($Dname, $indet)= @_;

Here's another tip:  rewrite so as to eliminate ALL global variables
(but not @ARGV, obviously...)
And if you still think the subroutine named 'dir' is essential,
at least rewrite it to take args and return a value, rather than
relying on side-effects.

hth, hand,
John Porter


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

Date: Thu, 11 Jun 1998 12:15:34 GMT
From: jouke@RemoveThisToReplycom-bat.nl (Jouke Visser)
Subject: Re: linker counter
Message-Id: <357fca2e.9894793@news.telecom.ptt.nl>

On 11 Jun 1998 11:41:48 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>
>I begin to understand: we have become alt.sources.wanted
>for CGI, without knowing it.
>
>Time to make new newsgroups? :-)
>

Hear! Hear! I agree! It'll keep this group a lot cleaner!

Jouke.


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

Date: 11 Jun 1998 14:46:16 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: linker counter
Message-Id: <6loqjo$8ir$1@client3.news.psi.net>

Andy Chantrill (support@derby-county.com) wrote on MDCCXLV September
MCMXCIII in <URL: news:357FBB68.320E11F8@derby-county.com>:
++ i need a script to count how many times each unique visitor clicks on a
++ small graphic link to get to my site....i need to be able to see how
++ many times for each member of mu little link program...yoiu knoiw i pay
++ 5c per every click through....i just need a simple script thats all....


There is no such thing as a "unique visitor" in HTTP. Period.

If you want to keep your customers happy, you'll pay 5c for every
"click through".


Oh, and please let your customers contact me. I can write a program
that will generate thousands of click throughs, for only 2c each!



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Addition/s) [0]'


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

Date: Thu, 11 Jun 1998 12:49:40 GMT
From: Philip_Heggie@msn.com
Subject: Re: localtime() and y2k
Message-Id: <6lojp4$9uv$1@nnrp1.dejanews.com>

In article <6lhp63$92m$2@csnews.cs.colorado.edu>,
  tchrist@mox.perl.com (Tom Christiansen) wrote:
>
>  [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, chris@bcadventure.com (Chris) writes:
> :Will give a 2 digit date, several small scripts I have seen in this
newsgroup
> :simply add 1900 to the year and say it is y2k compliant.
> :Am I missing something here?
>
> You may have missed having read the FAQ.
> Or my document at www.perl.com.
>
> :Is there a better way to get the local year in a 4 digit format?

If you can't fix it try
I have devised a cartoon Character called
Millie the Millenium Bug who is copyright free.
Make ads of Millie stamped on computers
and show the computer meltdown in
a paper spew jam smoking burning down your
business in 2000. Millie maybe merchandiced
freely as soft toys or stickers or on T-shirts etc.
iced triple donuts etc. Stick Millie on all non 2000 compliant
software and hardware or on your web page.
Millie can be found on my web page for download right click the
mouse on Millie the Millenium Bug. Click on Millie to get
various sized Graphics and styles of Millie plus window metafile
formats for download.
http://www.geocities.com/Broadway/Stage/6805/





>
> Better then adding 1900 to it?  What would you like to do,
> a Fast Fourier Transform?  Shall we consider its complex roots?
> Whiat do you mean "better"?  What's wrong with adding 1900
> the way you've been told to?
>
> :Do you know of a fix for this?
>
> There's nothing broken to fix.
>
> --tom
> --
> I just hate to be pushed around by some fucking machine. - Ken Thompson, on
the i960
>


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 11 Jun 1998 13:28:24 GMT
From: John Porter <jdporter@min.net>
Subject: Re: MODERATION: Time to Vote
Message-Id: <357FDCF1.2F00@min.net>

Craig Berry wrote:
> 
> John Stanley (stanley@skyking.OCE.ORST.EDU) wrote:
> : The vote is going on USENET wide, and you will find the CFV not only in
> : news.groups, but in comp.lang.perl.misc, comp.lang.perl.announce, and
> : news.announce.newgroups.
> :
> : But before you do what it says, read it very carefully. Almost as
> : important as what it says is what it leaves unsaid.
> 
> Care to explain that?


Aw, Craig, what'd ya have to go and do that for?
John Stanley's eccentric railings have already filled
volumes of clpm, and other ng's as well. No need to
ask for yet more.  DejaNews is our friend.  

John Porter


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

Date: Thu, 11 Jun 1998 08:34:54 -0400
From: Bob Harold <rharold@mail.ford.com>
To: tom@netoutfit.com
Subject: Re: Non-blocking Perl socket calls?
Message-Id: <357FCEEE.B0C1E8B3@mail.ford.com>

I don't know the specific answer, but I would suggest either using 
the DBI and DBD:Oracle modules, or looking inside them to see how
they did it.  Find it on
http://amaunet.cs.uni-dortmund.de/projects/ir/SFgate/CPAN/

Tom O'Neil wrote:
> 
> How do I execute a non-blocking socket call in Perl?  I'm opening a
> socket to an Oracle database, sending an SQL command, and then
> attempting to read the results.  However, the socket read I'm doing
> now will continue to wait for data even when none is coming. How do I
> make this socket read non-blocking so the program will continue
> execution if the database is finished sending data (or has none to
> send). I have the following code:
> 
> #!/usr/local/bin/perl
> use Socket;
> use FileHandle;
> 
> $HOST = 'xxx.xxx.xx.xxx';
> $PORT = '8888';
> 
> socket (SOCKET,PF_INET,SOCK_STREAM, (getprotobyname('tcp'))[2]);
> 
> connect(SOCKET,pack('Sna4x8',AF_INET,$PORT,(gethostbyname($HOST))[4]))
> || die "can't connect to db\n";
> 
> print SOCKET "SELECT MAX(REPORT_ID) FROM SALES_REPORTS\n";
> 
> while (<SOCKET>) { print "$_"; }
> 
> Tom O'Neil
> tom@netoutfit.com

-- 
Bob Harold    Telecommunications Services, Dearborn, MI, USA
313-390-7095  Fairlane Plaza South, suite 600, Ford Motor Co
External: rharold@ford.com   Internal: rharold@mail.ford.com


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

Date: 11 Jun 1998 11:05:20 GMT
From: scott@softbase.com
Subject: Re: NT CGI with $string = `command`;
Message-Id: <6lodlg$7qd$3@mainsrv.main.nc.us>

sam berman (sam.berman@att.com) wrote:
> In a CGI on an NT server running IIS 4.0 I have a script that
> has backquotes in it

> $string = `cd`; ...
> $string = `md abc`;

> Any help would be appreciated.

The general rule of thumb is this: *NEVER* do anything in the shell
which Perl can do internally. Both cd and md shell commands are better
done within Perl. In the case of cd, it is nonsensical to call a shell,
issue a cd, and let it exit, since it has no effect on the Perl process
at all. You can change the Perl process' working directory with chdir.
The md command is better done by a Perl mkdir call.

> The item above does not ...  although it  ...
> when run from the command line.

This is a general symptom of running in a different environment and
as a different user. You don't have the same PATH, environment,
username, or permissions when running as a CGI program.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Thu, 11 Jun 1998 13:44:38 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Number of digits in a string
Message-Id: <357FE0BF.19BF@min.net>

Randal Schwartz wrote:
> 
> >>>>> "John" == John Porter <jdporter@min.net> writes:
> John> What, are you saying Llama doesn't talk about the length() built-in
> John> function?
> 
> Actually, it doesn't!

hoooWOW!
[Shuffling around in a random walk pattern, trying to get the dung
off my shoes...]

But of course:

Vincent M. Probasco wrote:
> I looked in the camal manual and...

So I should have said "camal", not "Llama". :-)

John Porter


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

Date: 11 Jun 1998 08:38:02 -0500
From: Quentin  Fennessy <quentin@shaddam.amd.com>
Subject: Re: One output stream to two dests
Message-Id: <ximvhq8awjp.fsf@shaddam.amd.com>

>>>>> "Josh" == Josh Abrams <josh@vellocet.insync.net> writes:
    Josh> How can I send one output stream to two destinations in
    Josh> PERL?

    Josh> In UNIX Bourne/Born Again:
    Josh> $ cat thisone 2>&1.

    Josh> In this case, I want output to go to a file and to stdout.

Josh, your sh syntax does not do what you think.  2>&1 redirects
stderr to stdout.

You can do this yourself:

	open(OFILE, "/var/tmp/ofile") or die;
	open(PIPE, "cmd|") or die;
	while(<PIPE>) {
		print OFILE $_;
		print;
	}

This reads the output from cmd and prints to OFILE
and stdout.

-- 
Quentin Fennessy			AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals


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

Date: Thu, 11 Jun 1998 16:33:35 -0200
From: Mark Fergusson <mferg@hal.ddntl.didata.co.za>
Subject: Passing variables from bourne script to perl script
Message-Id: <358022FF.559B30AC@hal.ddntl.didata.co.za>

Hello,

I have a boune shell script which contains a number of variables (about
20). Some of these varaiables contain a long sentence. I need to run a
perl script from here and pass these variables to the perl script.

Eg.

#script1
!#/bin/sh
variable1="this is a long sentence which can contain *:()&^% etc"
variable2="test"

#run perl script
 ./script2

when I run ./script1
perl script (script2) needs to set $variable1 and $variable2 as above.

#!/usr/local/bin/perl
# variable1 & variable2 set as in script1
# <help here>
$variable1="this is a long sentence which can contain *:()&^% etc";
$variable2="test";

Any comments will be appreciated.

Thanks.
--
_____________________________________________
Mark Fergusson: mferg@hal.ddntl.didata.co.za
Dimension Data:
PO Box 236, Pavillion, 3611, South Africa
(+27)-31-204-8424 (Work)
(+27)-31-204-8590 (Fax)
082-771-8519 (Cell)




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

Date: Thu, 11 Jun 1998 08:12:21 -0400
From: Peredina <peredina@progress.com>
Subject: Perl and Verity
Message-Id: <357FC9A5.82F6167D@progress.com>

Does anyone know of any PERL modules that might connect to a Verity
collection db, or any information on this subject?

If so, please reply.

Thanks,

CP



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

Date: Thu, 11 Jun 1998 13:54:00 GMT
From: rduyme@ireste.fr
Subject: PERL syntax
Message-Id: <6lonho$ev1$1@nnrp1.dejanews.com>

hello
I just start coding in PERL. I got a script with thoses lines that I
don't understand.

($fname) = $cd =~ /\bfilename="([^"]*)"/i; #"; # filename can be null-str
($fname) = $cd =~ /\bfilename=([^\s:;]+)/i unless defined $fname;

Can someone explain me ?

thanks

reno

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 11 Jun 1998 13:30:18 GMT
From: "David Sanders" <dsanders@netxchange.com>
Subject: Re: print <<EOT; problems
Message-Id: <KZQf1.3248$Aj.7293879@iagnews.iagnet.net>


Jim Bowlin wrote in message <357C4032.F744F365@sirius.com>...
>Get rid of all whitespace before "EOT".
>
>    print <<EOT;
>        testing
>EOT


Works great now.  Thanks to everyone who helped me with their replies!

Sincerely,
Dave Sanders




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

Date: 11 Jun 1998 14:02:44 GMT
From: "David Richards" <david.richards@alderley.zeneca.com>
Subject: Re: Prob in FAQ: Week of the year
Message-Id: <01bd9541$9bfcf0e0$55a0479c@UKMCPHISFW051.ukmcph.zeneca.com>

search for 

+iso +week

on AltaVista  for ISO information.

David


greene@gucc.org wrote in article <6lnvmq$h9t$1@nnrp1.dejanews.com>...
> A side question, along this thread -
> 
> is there an 'official' rule for determining week 1 of a year? When does
week
> 53 end, and week 1 begin? Is there an ISO standard for this?



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

Date: Thu, 11 Jun 1998 12:31:48 GMT
From: dejajustin@my-dejanews.com
Subject: Problem with some s/// code
Message-Id: <6loink$8p4$1@nnrp1.dejanews.com>

Does anyone see anything wrong with this line of code?
$outline=~s/\((\d)\) /\($1\)\[nb\]/g;  #replace "(digit) " with "(digit)[nb]"

it needs to turn any space follwing a single digit in parens into "[nb]"..

any suggestions would be much appreciated..

-Justin

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 11 Jun 1998 07:08:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Problem with some s/// code
Message-Id: <MPG.fe984cbc58b4a409896b7@nntp.hpl.hp.com>

In article <6loink$8p4$1@nnrp1.dejanews.com>, dejajustin@my-dejanews.com 
says...
> Does anyone see anything wrong with this line of code?
> $outline=~s/\((\d)\) /\($1\)\[nb\]/g;  #replace "(digit) " with "(digit)[nb]"
> 
> it needs to turn any space follwing a single digit in parens into "[nb]"..

Do you see anything wrong with it?  Did you try it?  It works as written 
for me.

> any suggestions would be much appreciated..

This is a bit cleaner, but essentially identical:

$outline =~ s/(\(\d\)) /$1[nb]/g;  #replace "(digit) " with "(digit)[nb]"

-- 
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com


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

Date: 11 Jun 1998 09:40:23 -0500
From: psdspss@earth.execpc.com (Deva Seetharam)
Subject: Process
Message-Id: <6loq8p$aqo@newsops.execpc.com>

I have a cgi shell script like this :
perl setId.pl
 ./loadData 

I want to use file locking mechanism.
So, I use to flock to achieve file lock.

I want the file lock  to exist till loadData completes
executing.
So, I tried to invoke loadData from perl script setId.pl
by using exec/system functions.

But, when I do this, I get SERVER ERROR.
I have a feeling that either STDIN/STDOUT does not
get set properly.

Any help would be greatly appreciated.

Deva 



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". 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 2838
**************************************

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