[13156] in Perl-Users-Digest
Perl-Users Digest, Issue: 566 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 17 13:07:12 1999
Date: Tue, 17 Aug 1999 10:05:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 17 Aug 1999 Volume: 9 Number: 566
Today's topics:
Re: <== importing hash symbols from one package to anot <khowe@performance-net.com>
Re: Anyone need an INDEPENDENT CONTRACTOR??? (Michel Dalle)
Re: Anyone need an INDEPENDENT CONTRACTOR??? <toby@venice.cas.utk.edu>
Re: Anyone need an INDEPENDENT CONTRACTOR??? <latsharj@my-deja.com>
Automatic htpasswd entries <cpdog@rma.edu>
Re: Automatic htpasswd entries (brian d foy)
Re: cannot write description to eventlog da_minch@my-deja.com
Complex math and FFT <David.Jonsson@Ellemtel.se>
How do you get LPDEST environment variable for remote u (Jeffrey Neblett)
Re: How do you get LPDEST environment variable for remo <gellyfish@gellyfish.com>
Icon in systray on Windows NT <patrick.renaud@transport.alstom.com>
kill (0, $pid) lan_chai@my-deja.com
Re: Killing Processes on NT... <mshenoy@us.oracle.com>
Re: Matching more than one item on a line?? <jbell@nysnet.net>
Modulo of a string tsreyb@my-deja.com
New Users Script? <dbarstis@saintmarys.edu>
Re: Pattern matching on command line tyeung@netscape.net
Pattern Matching <mark@leaf.ee.ufl.edu>
Pattern Matching <mark@leaf.ee.ufl.edu>
Re: Perl Image Processing Help Needed! <c4jgurney@my-deja.com>
Re: Perl Programmers' Web Design "Difficulties" (Chris Fedde)
Perl versus Tcl Update? <smid_scot@hotmail.com>
Re: Perl, SQL, and O'Brain <gellyfish@gellyfish.com>
Re: Personal Start Page With Cookie login system (Bill Moseley)
Q:Two perl programs printing to one txt file danmex@my-deja.com
Re: serial port / ioctl (Bbirthisel)
Sound under Linux with perl <David.Jonsson@Ellemtel.se>
Re: Sound under Linux with perl <gellyfish@gellyfish.com>
Re: Why use Perl when we've got Python?! <cmcurtin@interhack.net>
Write - multiple access <pascal@stnfrance.com>
Re: Write - multiple access <gellyfish@gellyfish.com>
Re: www.perl.org <elaine@chaos.wustl.edu>
Re: www.perl.org (brian d foy)
Re: www.perl.org <elaine@chaos.wustl.edu>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Aug 1999 12:23:41 -0300
From: "Kevin Howe" <khowe@performance-net.com>
Subject: Re: <== importing hash symbols from one package to another ==>
Message-Id: <J1fu3.47417$5r2.98881@tor-nn1.netcom.ca>
This question is just out of curiosity, can you access a hash in another
package via it's object reference? Something similar the following:
package main;
$one = new one;
print $one->%hash{'Color'};
package one;
%hash = (Color=>Red,);
sub new{
my ($class) = shift;
my ($self) = {};
bless ($self, $class);
return $self;
}
Thanks
------------------------------
Date: Tue, 17 Aug 1999 15:08:57 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Anyone need an INDEPENDENT CONTRACTOR???
Message-Id: <7pbu42$fos$2@news.mch.sbs.de>
In article <37B96D96.114C6CA8@ti.com>, Chirayu Shah <c-shah1@ti.com> wrote:
>Please e-mail me at shah_chirayu@hotmail.com if this interests you.
>
Did you mean dependent or despondent ?
* duck *
Michel.
------------------------------
Date: Tue, 17 Aug 1999 11:30:41 -0400
From: toby <toby@venice.cas.utk.edu>
Subject: Re: Anyone need an INDEPENDENT CONTRACTOR???
Message-Id: <37B98020.C4B6049E@venice.cas.utk.edu>
Chirayu Shah wrote:
> Please e-mail me at shah_chirayu@hotmail.com if this interests you.
Yes,I am looking for someone to pour a new concrete floor in my
basement.
Toby
------------------------------
Date: Tue, 17 Aug 1999 15:35:40 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Anyone need an INDEPENDENT CONTRACTOR???
Message-Id: <7pbvga$4i1$1@nnrp1.deja.com>
In article <37B96D96.114C6CA8@ti.com>,
Chirayu Shah <c-shah1@ti.com> wrote:
> Please e-mail me at shah_chirayu@hotmail.com if this interests you.
Sorry. Don't hire folks who can't figure out what's appropriate content
for a message.
--
Regards,
Dick
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 17 Aug 1999 15:51:05 GMT
From: "Tim Clark" <cpdog@rma.edu>
Subject: Automatic htpasswd entries
Message-Id: <Jxfu3.17$ci.2014@news.cwix.com>
I have a big list of usernames/passwords that I want to enter into the
.htpasswd file on my server. At first, I figured that using perl's crypt
function would do the job because it encrypts the same way that htpasswd
does on the server. No dice. For some reason this doesn't work, the only way
that the password works CORRECTLY is if I use the htpasswd utility. Fine,
the only problem is that htpasswd works like so:
htpasswd PASSWDFILE USER
THEN it wants the password for this user
THEN it wants you to re-enter the password
I cannot for the life of me figure out how to get the password output to the
program automatically. I tried this:
open (PS,"|htpasswd PASSFILE USER");
print PS PASSWORD;
print PS PASSWORD;
close(PS);
But this doesn't work, the passwords will not get printed until after
htpasswd has finished (that is, after I manually enter the password).
Suggestions?
-Tim
------------------------------
Date: Tue, 17 Aug 1999 12:25:57 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Automatic htpasswd entries
Message-Id: <brian-ya02408000R1708991225570001@news.panix.com>
In article <Jxfu3.17$ci.2014@news.cwix.com>, "Tim Clark" <cpdog@rma.edu> posted:
> open (PS,"|htpasswd PASSFILE USER");
> print PS PASSWORD;
> print PS PASSWORD;
> close(PS);
i suggest going with one of the auth by database options. it's much
easier to manage and you don't have the external program nonsense.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Tue, 17 Aug 1999 16:15:48 GMT
From: da_minch@my-deja.com
Subject: Re: cannot write description to eventlog
Message-Id: <7pc1r7$6dl$1@nnrp1.deja.com>
In article <MPG.122399e2a428ab6c989c38@news-server>,
elephant@squirrelgroup.com (elephant) wrote:
> I have no idea where you're reading your documentation for this
module
> from .. I couldn't find any in the module itself .. but the
> documentation that you're using is clearly wrong - because your hash
> keys are all screwy .. and you seem to have a warped idea of what the
> first parameter to 'new' is (it's NOT the section of the event log)
>....
thanks. (i didn't have any docs just the module.) i do have some
sorting of my code to do as my hash keys are screwy and i have actually
been writing jibberish to the eventlog and didn't realize it.
entvwr.exe returns an error when trying to view the description of my
manual entries and it wasn't until i pulled the $h{strings} portion of
the hash via a $Event->Read script that i was able to see what i had
been inserting.. it appears that a path to a message file for a given
app must be stored in the registry at:
HKEY_LOCAL_MACHINE
System
CurrentControlSet
Services
EventLog
Application
WhatEverApp
EventLogMessageFile
for eventvwr.exe to display a messsage. (but this is not my concern as
the purpose of what i am doing is to avoid dependency on eventvwr.exe.)
minch
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 17 Aug 1999 16:45:55 +0200
From: "David Jonsson" <David.Jonsson@Ellemtel.se>
Subject: Complex math and FFT
Message-Id: <7pbsfd$1vh4@news1.newsguy.com>
Are there any modules for managing complex numbers and Fourier transforms?
David
------------------------------
Date: Tue, 17 Aug 1999 14:48:26 GMT
From: jenebl.wnt.sas.com (Jeffrey Neblett)
Subject: How do you get LPDEST environment variable for remote user in CGI
Message-Id: <37b975dc.514136228@newshost.unx.sas.com>
I am running a CGI and am a remote user but would like to get the
$ENV{LPDEST} but am getting the value for the ID of the server instead
of the remote user which is what I really want. Thanks for any help.
------------------------------
Date: 17 Aug 1999 16:51:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do you get LPDEST environment variable for remote user in CGI
Message-Id: <37b9850a_1@newsread3.dircon.co.uk>
[followups set]
Jeffrey Neblett <jenebl.wnt.sas.com> wrote:
> I am running a CGI and am a remote user but would like to get the
> $ENV{LPDEST} but am getting the value for the ID of the server instead
> of the remote user which is what I really want. Thanks for any help.
>
The answer would basically be tough-shit whatever language you wrote this
in. There is no reason a remote browser should send this information.
/J\
--
"Over the years I've always had Max Factor in my box" - Tina Earnshaw,
Chief Make-Up Artist, Titanic
------------------------------
Date: Tue, 17 Aug 1999 17:03:34 +0200
From: "Patrick Renaud" <patrick.renaud@transport.alstom.com>
Subject: Icon in systray on Windows NT
Message-Id: <7pbtls$p3p$1@pinot.tes.dtr.gecalsthom.com>
Hello world,
I work on Windows NT 4 and want the icon of a program (of the DOS window of
my program) to go in the systray (near the clock) instead of being displayed
in the taskbar.
How can I do this with my favourite Perl ?
Thanks for your help
------------------------------
Date: Tue, 17 Aug 1999 16:19:19 GMT
From: lan_chai@my-deja.com
Subject: kill (0, $pid)
Message-Id: <7pc21p$6g1$1@nnrp1.deja.com>
Hi everyone. I'm a newbie and I have this problem. I opened a process with
open(PROC, "something arg|"). I time it with a while loop and if it takes
too long, I kill it. The test to see if it's still running is by "kill (0,
$pid)" (I read this in Perl5 Unleashed). This way of doing it doesn't seem
to give me that the process has ended if I did not get the output of the
process yet. Is it true that a process is not really completed if it doesn't
have all the output read yet?
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 17 Aug 1999 11:39:38 -0400
From: Manoj Shenoy <mshenoy@us.oracle.com>
Subject: Re: Killing Processes on NT...
Message-Id: <37B98239.E70CA60F@us.oracle.com>
Thanks to all that responded! Only reason I included the full code was, I
didnt know if there was something I was missing in it that would enable things
to work...Manoj
Harlan Carvey, CISSP wrote:
> > Hi All, I seem to be facing a bit of a dillemma. I am trying to kill
> > a PERL process on NT using the %SIG signal handler hash. In this SIG
> > hash are many keys, some of the relevant ones include QUIT, BREAK, STOP,
>
> As elephant so eloquantly points out, signals on NT are a no-go. I'll add
> as well,
> so is forking...at least, with the ActiveState version of Perl. If you get
> the core
> version and compile it yourself, you can get fork()...
>
> So you want to kill a process, eh? Okay. Have you looked at
> Win32::Process?
> Or Win32::iProc? Another thing you can try is using Named Pipes via Dave
> Roth's Win32::Pipe module...you could have kill.pl send a pseudo-signal to
> loop.pl...but you'd have to have some sort of event-driven coding so that
> loop.pl
> will detect the signal and stop what it was doing...
>
> Remember, there are other ways around what you are trying to do. Don't let
> someone else's narrow-minded "read the FAQ" responses deter you...you may
> just need a different perspective.
------------------------------
Date: Tue, 17 Aug 1999 16:27:59 GMT
From: "Jim A. Bell" <jbell@nysnet.net>
Subject: Re: Matching more than one item on a line??
Message-Id: <j4gu3.66$_k3.1966234@dca1-nnrp1.news.digex.net>
Fantastic! Your pointers were really helpful, and I appreciate you taking
the time and effort to explain them so clearly. One simple script done; lots
more learning to do...
(How's that for terse <grin>!)
Thanks again - Jim
------------------------------
Date: Tue, 17 Aug 1999 15:07:47 GMT
From: tsreyb@my-deja.com
Subject: Modulo of a string
Message-Id: <7pbtrp$35b$1@nnrp1.deja.com>
According to the camel book, the "% [modulo] operator
will convert its operands to integers before finding
the remainder according to integer devision"
What I was hoping to do is reduce arbitrary strings
to a number between 0 & N-1, where N is the modulo
value.
For example, if N is 7, I can process a different
segment of an array each day of the week. After
7 days, all of the elements will have been processed
once & only once. [Eventually in this code I won't
have the names in an array .. so doing a modulo on
the array index won't work]
I tried this:
#---start----
@x[0] = "a" % 7;
@x[1] = "b" % 7;
@x[2] = "c" % 7;
@x[3] = "d" % 7;
@x[4] = "Joe" % 7;
@x[5] = "Sally" % 7;
for ( $i=0 ; $i<=5 ; ++$i ) {
print "x[$i]: @x[$i]\n";
}
#---end----
and got this output:
x[0]: 0
x[1]: 0
x[2]: 0
x[3]: 0
x[4]: 0
x[5]: 0
Any & all suggestions appreciated!
-TR
Boston, MA
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 17 Aug 1999 11:33:32 -0500
From: "David R. Barstis" <dbarstis@saintmarys.edu>
Subject: New Users Script?
Message-Id: <Pine.GSO.4.05.9908171125370.11152-100000@hal.saintmarys.edu>
Does anyone have a script to read a file of names, create a new user
account, generate a password and output a file? This is for a Solaris 2.6
machine. I'd hate to re-invent the wheel if someone is already creating
accounts in batch.
Any and all help would be greatly appreciated.
Dave Barstis
Saint Mary's College
--
------------------------------------------------------------------------------
David R. Barstis E-mail: dbarstis@saintmarys.edu
Dept. of Information Technologies Voice: (219) 284-5318
Saint Mary's College Fax: (219) 284-4716
Notre Dame IN 46556 URL: http://www.saintmarys.edu/~dbarstis
The word "listen" contains the same letters as the word "silent".
------------------------------------------------------------------------------
------------------------------
Date: Tue, 17 Aug 1999 15:47:47 GMT
From: tyeung@netscape.net
Subject: Re: Pattern matching on command line
Message-Id: <7pc06u$51v$1@nnrp1.deja.com>
I am new to Perl so can you tell me exactly where perldoc and perldata
is? or do u mean the manpage for perldoc?
And just trying to make it clear..
I am trying to throw the "m/word/i" into the if condition
so the $string will do a pattern matching with it..
in the command line I can change the modifier if I want it to
like "s/^word\b/g" something like that..
Thanks in advance.
Tom
In article <1dwnkoq.cffko98r311fN@p183.tc2.state.ma.tiac.com>,
rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:
> <tyeung@netscape.net> wrote:
>
> > on the command line:
> > perl program m/word/i < inputfile
> >
> > in the program:
> > if ($string =~ @ARGV)
> >
> > instead of
> >
> > on the command line:
> > perl program word < inputfile
> >
> > in the program:
> > if ($string =~ m/@ARGV/i)
> >
>
> No, you cannot do that, unless you use eval. However, you can do this
> instead:
>
> perl program '(?i)word' < inputfile
>
> which will have the desired effect. Refer to perlre for more info.
>
> --
> #!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
> perl -se'print sort grep/(?imsx)\s/, keys%main::
> ' -- -is -' Just' -' another ' -'Perl ' -'hacker
> ' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 17 Aug 1999 12:00:56 -0700
From: "Mark Hammer" <mark@leaf.ee.ufl.edu>
Subject: Pattern Matching
Message-Id: <7pc0pv$2oe6$1@spnode25.nerdc.ufl.edu>
Has anyone done this (made a general code):
e.g. replace n(x+y) with nx+ny (n,x,y can be more than one char)
e.g. replace NOT(A AND B) with NOT A OR NOT B (ditto)
e.g. replace A AND A with A (ditto)
etc.
--
Mark Hammer
mark@leaf.ee.ufl.edu
http://free.prohosting.com/~maqua/
------------------------------
Date: Tue, 17 Aug 1999 12:00:56 -0700
From: "Mark Hammer" <mark@leaf.ee.ufl.edu>
Subject: Pattern Matching
Message-Id: <7pc0qf$7dea$1@spnode25.nerdc.ufl.edu>
Has anyone done this (made a general code):
e.g. replace n(x+y) with nx+ny (n,x,y can be more than one char)
e.g. replace NOT(A AND B) with NOT A OR NOT B (ditto)
e.g. replace A AND A with A (ditto)
etc.
--
Mark Hammer
mark@leaf.ee.ufl.edu
http://free.prohosting.com/~maqua/
------------------------------
Date: Tue, 17 Aug 1999 15:09:05 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: Perl Image Processing Help Needed!
Message-Id: <7pbtu6$36b$1@nnrp1.deja.com>
In article <37B95C31.7879F2E@razorprices.wcq.com.au>,
David Rugendyke <webmaster@razorprices.wcq.com.au> wrote:
> Hi,
>
> I recently acquired a search engine which ranks the results in % eg.
> 99%..45% etc. I have been trying to find a way for ages to display a
> small image of a bar graph underneath each % showing its score through
> an image.
You don't need to do any manipulation of the image in perl at all, you
just need is a single pixel image and vary the size options in the
html to make it look bigger.
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 17 Aug 1999 16:27:42 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Perl Programmers' Web Design "Difficulties"
Message-Id: <24gu3.5459$Pt1.2267@wormhole.dimensional.com>
In article <7p9dt7$d44$1@frogstar.tc.fluke.com>,
Warren Jones <wjones@tc.fluke.COM> wrote:
>merlyn@stonehenge.com (Randal L. Schwartz) writes:
>
>> And contrary to what was said, I think the new www.perl.com looks
>> HORRIBLE. The characters are far too small on my browser, and
>> changing the settings doesn't seem to change the size.
>
>Yes, the new www.perl.com is certainly sub-optimal. However,
>I configured Netscape to "Use my default fonts, overriding document
>specified font", and it looks much better.
>
I too disliked the new format. So much in fact that I sent a note
to the "producers" of the site. I did receive a reply in which
the respondent made comments that indicate he had at least read my
message. Still he said that the positive responses to the new
format far outweighed the negative ones. He appeard to be quoting
directly from the self congratulating press noise that was posted
as news in the banner section of their page. The response bordered
on calling me a crumudgen.
My own informal straw poll indicates that among those who use perl
regularly this site is much worse than the previous. And is still
sub-optimal from almost all angles except the ego boost it gives the
designers.
I'm curious if there can be a middle ground here. That is to say
can we meet he needs of all minorities while still appealing to
the masses? I was experimenting with an audio browser the other
day and pointed it at several pages. Most were completely unusable
to my untrained ear. Is this the norm? If this is the case then
we minority rights movement on the web!
chris
------------------------------
Date: Tue, 17 Aug 1999 15:49:25 GMT
From: Smid <smid_scot@hotmail.com>
Subject: Perl versus Tcl Update?
Message-Id: <7pc0a0$52r$1@nnrp1.deja.com>
Well, I've trawled dejanews a bit to look for any clues, but the only
Perl vs Tcl advocacy documents I can find are the ones at:
http://language.perl.com/versus/index.html
And when I've handed them to the local Tcl programmers, they took
great glee at mentioning that they were out of date.
Hmmmn.
Well, my problem is this. It appears we need a dynamic language to do
a fair bit of text parsing from files and messages, and I'd like to
go down the toolset route. Now, I'm a Perl 5 programmer with some
experience, but a consultant. The others are Tcl and permanent
employees. I'd really have to give them a reason to implement in Perl
(and indeed myself too).
Tom Christiansen's piece at the above reference seemed enough to
convince myself, but if this has changed, then how many points are
still valid?
The main concerns are efficiency, really.
Or should I do the old consultant trick of rolling over, playing
dead, and adding another language to my CV?
Smid
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 17 Aug 1999 16:07:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl, SQL, and O'Brain
Message-Id: <37b97aac_1@newsread3.dircon.co.uk>
kayec <delete.the.nospam.kayec@gov.ns.ca> wrote:
> Malcolm Ray wrote in message ...
>>Do 'perldoc DBI' and take a look at the 'quote' method. Given a string
>>in $name, the following line:
>>
>>my $quoted_name = $dbh->quote($name);
>>
>>will give you a correctly-quoted equivalent in $quoted_name, which you
>>can plug into an insert.
>
>
> WHERE OH WHERE can i find this DBI module.?? ActiveState?
>
On closer examination I can see that you are using the Win32::ODBC module
you will need to get DBD::ODBC from Activestate - you can install like
C:\>ppm install DBD-ODBC
/J\
--
"Michael Ancram, you haven't got a hope in hell of winning the next
election" - Huw Edwards, BBC News
------------------------------
Date: Tue, 17 Aug 1999 08:43:09 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Personal Start Page With Cookie login system
Message-Id: <MPG.122322eba548ef189896bd@nntp1.ba.best.com>
twafa@earthlink.net (twafa@earthlink.net) seems to say...
> ..store information on a user, (ie email
> address, survey info, name, address, etc..) I wanted to integrate this
> with a cookie such that the user won't have to ksyeep logging in over
> and over.
Extracting personal information can be a challenge. I find it often
takes more than an offer of a cookie to get this info. Cash works
better.
> I am having trouble figuring out how to implement this
> registration system, especially writing the registration information to
> a file on the server end, while at the same time sending a cookie to
> the users machine.
Getting a computer to do something at the same time is a tough job.
Threads, perhaps?
> If anyone is experienced at all with these registration type systems,
> please contact me. Any open source code regarding a similar setup
> would be greatly appreciated, as I am more into tweaking then actually
> coding.
There's a module called CGI.pm. It's kind of a secret, but a lot of
people have luck with it. It will handle your cookies for you almost at
the same time that you are writing information to a local file. I
haven't bothered to read it, but I've been told the documentation has
actual working examples.
There's also a newsgroup with 'CGI' in its name. There seems to be a
lot of talk about cookies there. Might check it out.
Did you try emailing Yahoo and taking a look at their scrips?
Best of luck,
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Tue, 17 Aug 1999 14:56:23 GMT
From: danmex@my-deja.com
Subject: Q:Two perl programs printing to one txt file
Message-Id: <7pbt6h$2kl$1@nnrp1.deja.com>
Hi,
I have a problem: there are two perl programs that append to the same
TXT file, but when both of them try to do it at the same time the TXT
file end all messed up.
Is there any way for the programs to "take turns" or to know that the
other program is not finished and wait until its done?
Could you point me to a script that has some example code?
Thank's
Dan
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 17 Aug 1999 16:06:17 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: serial port / ioctl
Message-Id: <19990817120617.05311.00000137@ng-fe1.aol.com>
Hi Feite:
> I need to do some serial port programming and therefore need to use
> ioctl.
That does not necessarily follow. It is possible to do quite a bit of
serial port programming without needing ioctl. But you do need it for
a few operations.
> I have a RedHat 5.2 Linux machine, with standard perl 5.004.. installed.
> Now when I execute a perl-script containing a piece of example code from
> the O'Reilly book I get an error.
>
> require "ioctl.ph";
> $getp = &TIOCGETP or die "....";
> ...
Looks like the "ioctl" example from the Camel. Of course, the
example includes numerous disclaimers about its portability.
> The second line generates the error:
> Undefined subroutine &main::TIOCGETP called at ./xxx.pl line 18
>
> What to do about this ?
Reread the paragraph ahead of the example. To save the hassle of
"rolling your own", the most likely choice on Redhat 5.2 (and other
linux AFAIK) is: require "asm/termios.ph";
This, in the right order, also requires "asm/ioctl.ph", "asm/ioctls.ph",
and "asm/termbits.ph". But the rest of that Camel example will need
tinkering to function on linux - consider it a SYNTAX example only.
> A find /usr -name "ioctl.ph" -print delivers:
"locate ioctl.ph" is noticeably quicker on linux ;-)
> Any suggestions ?
Check out the Device::SerialPort module on CPAN. It already knows how
to do most of what you'll need. And if you need something added, I can
handle that as well.
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Tue, 17 Aug 1999 16:52:28 +0200
From: "David Jonsson" <David.Jonsson@Ellemtel.se>
Subject: Sound under Linux with perl
Message-Id: <7pbsrh$1vq2@news1.newsguy.com>
I have successfully packed my data with print(pack"S", .....)) to make it
raw 16 bit unsigned sound. This can be piped like
perl sound.pl | play -t raw -r 48000 -w -u -
but I have to finish the perl program before there is any sound. Why? How do
I get around it? I intend to write from an endless loop.
Can I make a system call directly from perl instead? Are there any modules?
David
------------------------------
Date: 17 Aug 1999 16:55:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sound under Linux with perl
Message-Id: <37b98605_2@newsread3.dircon.co.uk>
David Jonsson <David.Jonsson@Ellemtel.se> wrote:
> I have successfully packed my data with print(pack"S", .....)) to make it
> raw 16 bit unsigned sound. This can be piped like
> perl sound.pl | play -t raw -r 48000 -w -u -
> but I have to finish the perl program before there is any sound. Why? How do
> I get around it? I intend to write from an endless loop.
>
> Can I make a system call directly from perl instead? Are there any modules?
>
You read the perlfunc entry for open to find out about piped opens and
also the perlvar manpage for more about the variable $|.
/J\
--
"The only man in the cabinet who supported them was that fucking lunatic
Redwood" - John Major
------------------------------
Date: 17 Aug 1999 11:46:21 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <xlxr9l2xvea.fsf@gold.cis.ohio-state.edu>
>>>>> On Tue, 17 Aug 1999 11:52:02 +0100,
Luis Gonzalo Aller Arias <gonzalo@aller.com> said:
Luis> I love Perl, but I disagree here. That's not fair to
Luis> Esperanto nor to Mac people. I know people that can do
Luis> marvelous things with a Mac (and a lot that can't do anything
Luis> with a PC and linux... or winblows, or...) and people who can
Luis> say marvelous things in esperanto.
I'm sorry that I failed to articulate my point clearly.
The reason I mentioned Esperanto and the Mac is that they are both
beautiful in design. [It's worth noting that I'm no Esperanto expert;
I have looked at it only briefly.] They're concise, regular, and easy
to learn.
These are the opposite of the Perl philosophy, which which is borne of
the ideas that drive English and Unix: there's more than one way to do
it. Especially in the case of the Macintosh, the design philosophy
from the beginning has been provide one way to do it and make it
intuitive. This makes the learning curve very gentle and makes it
very easy for one person to show another how to do something, but it
doesn't allow for variations in the way that different people like to
go about dealing with the same problems.
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Tue, 17 Aug 1999 17:47:35 +0200
From: "Pascal HOARAU" <pascal@stnfrance.com>
Subject: Write - multiple access
Message-Id: <7pc0ca$gds$1@jaydee.iway.fr>
hello
who can give me a valid and profesionnal solution to keep people from
writing in a file that is already opened for writing.
That is for a forum which can be visited 10M times per day ...
(please to avoid telling me about the "lock" file/sleep(1) method)
------------------------------
Date: 17 Aug 1999 16:57:01 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Write - multiple access
Message-Id: <37b9864d_2@newsread3.dircon.co.uk>
Pascal HOARAU <pascal@stnfrance.com> wrote:
> hello
> who can give me a valid and profesionnal solution to keep people from
> writing in a file that is already opened for writing.
> That is for a forum which can be visited 10M times per day ...
>
perldoc -f flock
/J\
--
"I must call a man in - I want to get felt laid down in the loft" -
Graham Norton
------------------------------
Date: Tue, 17 Aug 1999 11:48:53 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: www.perl.org
Message-Id: <37B98454.4AD9EB1D@chaos.wustl.edu>
Jonathan Stowe wrote:
> Secondly brian d foy has posted on this matter already today - the gist of
> which was that the original website of the now defunct Perl Institute has
> been moved to <http://tpi.perl.org> while <http://www.perl.org> has a face
> lift.
Well, we should have put a DNS pointer to tpi for the nonce so this
confusion could be avoided...even a little front page notice with a
redirect would have been nice. And I thought I was the BOFH :)
e.
------------------------------
Date: Tue, 17 Aug 1999 12:23:54 -0400
From: brian@pm.org (brian d foy)
Subject: Re: www.perl.org
Message-Id: <brian-ya02408000R1708991223540001@news.panix.com>
In article <37B98454.4AD9EB1D@chaos.wustl.edu>, elaine@chaos.wustl.edu posted:
> Jonathan Stowe wrote:
>
> > Secondly brian d foy has posted on this matter already today - the gist of
> > which was that the original website of the now defunct Perl Institute has
> > been moved to <http://tpi.perl.org> while <http://www.perl.org> has a face
> > lift.
>
> Well, we should have put a DNS pointer to tpi for the nonce so this
> confusion could be avoided...even a little front page notice with a
> redirect would have been nice. And I thought I was the BOFH :)
that wouldn't have worked for what i needed to accomplish. i have,
however, added a pointer in the realm string so that the new address
shows up (hopefully) in the auth dialog.
i still rever your BOFH-ness, even though it has been an interesting
watching people guessing passwords. lots of people are trying "root"
as a username.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Tue, 17 Aug 1999 12:57:44 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: www.perl.org
Message-Id: <37B99475.3EAD70B5@chaos.wustl.edu>
brian d foy wrote:
> that wouldn't have worked for what i needed to accomplish. i have,
> however, added a pointer in the realm string so that the new address
> shows up (hopefully) in the auth dialog.
Yes, the new address shows up :)
> i still rever your BOFH-ness, even though it has been an interesting
> watching people guessing passwords. lots of people are trying "root"
> as a username.
root? heh.
e.
------------------------------
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 566
*************************************