[6599] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 224 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 2 23:17:04 1997

Date: Wed, 2 Apr 97 20:00:27 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 2 Apr 1997     Volume: 8 Number: 224

Today's topics:
     480/100 != 4.8? Help!!!!!!!!! <orange@globalserve.net>
     Re: arrg (David Alan Black)
     Do I need to lock a text file to append a line? Martin Mathis
     Re: Easy way to promote your web site (Alfred Holmwood)
     Re: file parsing (Nathan V. Patwardhan)
     Re: Form post to Sendmail fails (Geoffrey Hebert)
     Getting the contents of a URL. (Fairey Simon)
     Re: Getting the contents of a URL. (Nathan V. Patwardhan)
     RE: Getting the contents of a URL.: Humble apologies (Fairey Simon)
     Help With Perl Script (Louis Alan Robinson)
     HELP! 5.003 install failed on HP-UX 9.07 <lufan@hotmail.com>
     Re: HELP! 5.003 install failed on HP-UX 9.07 <lufan@hotmail.com>
     How to use "read()" <hokp@hpsgns1.sgp.hp.com>
     Interfacing perl with clearcase <girish1@home.com>
     IPC_SysV won't build on RH Linux 4.0 (John L. Daschbach)
     Re: Live Randal Schwartz interview (Colin Yemm)
     Re: Live Randal Schwartz interview (Nathan V. Patwardhan)
     Re: lock file necessary? (Geoffrey Hebert)
     MacPerl and BBedit (David Goldenberg)
     Match ? (Geoffrey Hebert)
     Re: Ousterhout and Tcl lost the plot with latest paper <Chris.Bitmead@alcatel.com.au>
     PERL 5.0 on Windows 95... (Dico Reyers)
     PERLscript with URL redirection <strad@mondenet.com>
     Re: PERLscript with URL redirection (Nathan V. Patwardhan)
     Processing lists. <bmcandre@mc.net>
     Reading data from _DATA_ (C.D. Tobola)
     Running program on a remote machine <bbell@voicenet.com>
     San Diego Sybase Job Opportunities!!! <dglass@swpartners.com>
     Re: The theoretically fastest way to iterate through al < hansm@icgned.nl>
     Re: Tie() function in Windows95/NT (Nathan V. Patwardhan)
     Re: Tie() function in Windows95/NT (Nathan V. Patwardhan)
     Turning output of command into input <bbell@voicenet.com>
     wait for child processes from 'system' to finish (Richard S. Guse)
     Re: Wanted, a currency converter? Automatic file downlo (Nathan V. Patwardhan)
     Re: win32 sendmail <billc@tibinc.com>
     Re: Windose and ease of abuse (WAS: Who makes more.. Wh <vladi_mip@uniserve.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 02 Apr 1997 22:02:53 -0500
From: Angus Lai <orange@globalserve.net>
Subject: 480/100 != 4.8? Help!!!!!!!!!
Message-Id: <33431DDD.1F6E@globalserve.net>

Dear friends,

	I have the following problem in perl 4:
---------------------------------
PROGRAM:
#!perl

print 480/100;
--------------------------------
RESULT:

4.799999999
---------------------------------
	Perl 5 give me correct answer 4.8, but perl 4 (Tested with unix version
and win 95 version) with me 4.7999999.

	For some reasons, I still using perl 4.

	Dear friends, if you know how to fix this problem, get correct answer
in perl 4, please tell me.

	Thank you for answering my question.

Sincerely,
	Angus Lai


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

Date: 3 Apr 1997 00:20:11 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: arrg
Message-Id: <5hut3r$cfv@pirate.shu.edu>

Brian Lorraine <lorraine@ait.nrl.navy.mil> writes:

>argggg... I'm writing a guestbook program right now in perl. I was just

I haven't come across argggg yet - must be something in 5.005 :-)

>@eachrec = split(/##/, @wholething[0];

>and it said something like some kind of syntax error on this line like

>next 2 tokens "];"

You haven't closed your parenthesis.

David Black
dblack@icarus.shu.edu


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

Date: 2 Apr 1997 19:00:05 -0700
From: Martin Mathis
Subject: Do I need to lock a text file to append a line?
Message-Id: <33430c7e.144798557@news.primenet.com>

Hi all,

I am new to this ng. I read the FAQ but it didn't answer my concern:

I'm buildiing various forms where the submitted data is going to be
appended to delimited ASCII files, one line per entry.
Do I need to be concerned that two users might try to write at the
very same moment thus overwriting each other? Or does Perl4/UNIX
somehow serialize those writes? The write is a simple open
HANDLE/print HANDLE/close HANDLE. I tried some simple tests by
starting several dozen instances of the script simultaneously but
everything looked fine. Or was I just lucky?
Would flock work to make sure, just in case? Just a flock after the
open, then the close will automatically unflock?

TIA and best,




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

Date: Thu, 03 Apr 1997 00:42:29 GMT
From: frankham@dial.pipex.com (Alfred Holmwood)
Subject: Re: Easy way to promote your web site
Message-Id: <3342eca6.23966128@news.dial.pipex.com>


Yawn.

Or alternately visit any of the several sites which will do it for
free.

Holmwood.


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

Date: 3 Apr 1997 03:02:00 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: file parsing
Message-Id: <5hv6j8$5gg@fridge-nf0.shore.net>

Melissa Butler (mbutler@es.com) wrote:
: -- I am trying to extract data from a flat file by using the substr()
: command, but it is not reading the right characters. Is there any
: suggestions? I am trying to find a command that works similiar to the
: cut command in shell script.

I'll venture a guess that each line ends with a carriage return?

If so:

while ( chop($varrec=<INPUT>) ){
   $compa = substr($varrec,20,25); 
}

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Thu, 03 Apr 1997 01:11:32 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: Form post to Sendmail fails
Message-Id: <5huv5f$otk$2@news3.microserve.net>

I do it all the time.  See your system adminsitrator.
This is not a perl question.  try some other group like
    comp.unix.questions

Jonathan.J.Forster@lloydsoflondon.co.uk (Jonny Golden Bollocks) wrote:

>I've got a simple form that posts data to a perl script which in turn
>sends the data to a user via Sendmail.

>The problem is: running the script from a command line as root works fine
>but submitting data via a web page fails (the Web server is not running as 
>root). I realise that Sendmail is fussy about it's trusted users.

>Other than running the webserver as root, is there any way of getting around
>this problem?

>Cheers





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

Date: Wed, 2 Apr 1997 09:10:00 +0100
From: SFAIREY@dsl.uk.ibm.com (Fairey Simon)
Subject: Getting the contents of a URL.
Message-Id: <cGBapDataScienceslDATASCIEXCH0100072BDD@farnnt15.datasci.co.uk>

Hi,

In my efforts to convert a friend to Perl ( he is a bit obsessed with
Java )
I am trying to find out how to do something. Having never used the
HTML/WWW part of Perl I am not sure where to begin.

What he wants to do is have a script that when supplied with a URL will
return the contents of the page in text format.

I am going to try and look into the HTML/WWW side of Perl but if any one
has any suggestions I would appreciate it, even if it is only to tell me
it is
not really very easy to do.

Simon



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

Date: 3 Apr 1997 02:37:20 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Getting the contents of a URL.
Message-Id: <5hv550$5gg@fridge-nf0.shore.net>

Fairey Simon (SFAIREY@dsl.uk.ibm.com) wrote:

: What he wants to do is have a script that when supplied with a URL will
: return the contents of the page in text format.

Ultra-easy.  Get libwww5 from a CPAN near you, or try:
http://www.perl.com/CPAN/modules/by-module/LWP/

You'll have to read the excellent docs to get the most out of LWP.  :-)

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Wed, 2 Apr 1997 10:00:00 +0100
From: SFAIREY@dsl.uk.ibm.com (Fairey Simon)
Subject: RE: Getting the contents of a URL.: Humble apologies
Message-Id: <cGBapDataScienceslDATASCIEXCH0100072BEE@farnnt15.datasci.co.uk>

Ooops

Well suffice to say Perl has not surprised me AGAIN!!
I should have known that the WWW module would come with a very nice GET
script.
*sigh*
Sometimes I think Perl almost makes life too easy... ;)

Apologies if anyone wasted 5mins typing a RTFM or FAQ response, I
guess I was just a bit too eager to impress my mate with the wonders of
Perl.

Simon
 ----------
From: Fairey Simon
To: 'Perl Users'
Subject: Getting the contents of a URL.
Date: 02 April 1997 09:10

Hi,

In my efforts to convert a friend to Perl ( he is a bit obsessed with
Java )
I am trying to find out how to do something. Having never used the
HTML/WWW part of Perl I am not sure where to begin.

What he wants to do is have a script that when supplied with a URL will
return the contents of the page in text format.

I am going to try and look into the HTML/WWW side of Perl but if any one
has any suggestions I would appreciate it, even if it is only to tell me
it is
not really very easy to do.

Simon



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

Date: 3 Apr 1997 01:54:50 GMT
From: larjr@wam.umd.edu (Louis Alan Robinson)
Subject: Help With Perl Script
Message-Id: <5hv2la$45a@dailyplanet.wam.umd.edu>


Help...

I keept getting errors when trying to run this perl
script.. I have the proper settings on the files
but I keep getting errors...

the file is

http://village.globaldrum.com/mwods/adduser.html

Please e-mail if you can help..


Thanks

Mallory Woods
larjr@wam.umd.edu



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

Date: Thu, 3 Apr 1997 15:36:06 GMT
From: Maverick <lufan@hotmail.com>
Subject: HELP! 5.003 install failed on HP-UX 9.07
Message-Id: <3343CE66.B9F@hotmail.com>

hi all

I met problem while install 5.003 on HP-UX 9.07
using make, the error msg likes below:

toke.c: 113: too much defining - use -H option
toke.c: 119: too much defining - use -H option
toke.c: 422: too much defining - use -H option

what can I do?
besides, I want to write perl to query INFORMIX database,
any useful module suggested, I MEAN  it must be easy 
to handle , must powerful. thanks


robert


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

Date: Thu, 3 Apr 1997 15:54:59 GMT
From: Maverick <lufan@hotmail.com>
Subject: Re: HELP! 5.003 install failed on HP-UX 9.07
Message-Id: <3343D2D3.273E@hotmail.com>

Maverick wrote:
> 
> hi all
> 
> I met problem while install 5.003 on HP-UX 9.07
> using make, the error msg likes below:
> 
> toke.c: 113: too much defining - use -H option
> toke.c: 119: too much defining - use -H option
> toke.c: 422: too much defining - use -H option
> 
> what can I do?
> besides, I want to write perl to query INFORMIX database,
> any useful module suggested, I MEAN  it must be easy
> to handle , must powerful. thanks
> 
> robert
after this failure, 5.002 installed ok!


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

Date: Tue, 1 Apr 1997 09:10:20 GMT
From: Ho Kee Ping <hokp@hpsgns1.sgp.hp.com>
Subject: How to use "read()"
Message-Id: <3340D0FC.7038@hpsgns1.sgp.hp.com>

Hi,
  I am having trouble understanding how to use the read() function.
The book I have states that :

  read(FILEHANDLE, BUFFER, LENGTH, [OFFSET])

  What I want to know is what does [OFFSET] do?

Thanks,
Ho Kee Ping
Singapore


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

Date: Wed, 02 Apr 1997 17:57:26 -0800
From: "Girish M. Joshi" <girish1@home.com>
Subject: Interfacing perl with clearcase
Message-Id: <33430E86.5952@home.com>

I am using Atria's clearcase for source control. This question is
related to the cleartool.  

The script that I am writing needs to interface with my cleartool view. 

In my perl program I have :

	$viewName = "myview";
	system("cleartool setview $viewName" ); 

This works fine. After this, I want to start some commands in this view.
Say for example, once I use myview I want to do a "catcs" or "lsco". 

My question is : How do I do this from within my perl script ? 

There is a series of commands that I need to run in the view and take
some action based on the return value of these commands. Once all the
commands have been executed, the control needs to return to the main
program for some further processing. 

Thanks !


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

Date: 02 Apr 1997 18:34:30 -0800
From: d3h486@wd19518.pnl.gov (John L. Daschbach)
Subject: IPC_SysV won't build on RH Linux 4.0
Message-Id: <m3hghog7gp.fsf@wd19518.pnl.gov>


In my continuing efforts to get some form of ipc working between Perl
and C I got the IPC_SysV package from CPAN.  However it will not build
on RH Linux with Perl 5.003.  The reasons are multiple, but the ipc
functions built with this distribution have different prototypes than
in the supplied IPC_SysV package.  

It's not clear that since ipc works partially without this module that
fixing the code to build it would be the best thing anyway.

It appears however that the ipc with the original distribution either does
not work entirely, or my calls to it are incorrect.

I can wait on a semaphore and send and recieve messages IF the ipc
resource is created first by a C program.  Also, IPC_NOWAIT fails.
All this suggests that at least one argument to the various ipc
functions is incorrect.  I have tried using straight perl variables
(as it appears is called for in the manual, e.g.
semget($key, $numsem, $flags), or packing them.  Clearly since I get
the correct semaphore identifier and can wait on it (or get and
recieve messages) the call is working partially.  However neither
IPC_CREAT or IPC_NOWAIT has any effect on the respective calls.

Does someone have this working?  Do you need to pack the entries to
semget() and msgget()?  (I know about packing semctl).

Any help is apprecieated.

-John


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

Date: Thu, 03 Apr 1997 00:49:48 GMT
From: yemm@ucf.edu (Colin Yemm)
Subject: Re: Live Randal Schwartz interview
Message-Id: <3342fe28.9324057@www.cohpa.ucf.edu>

On Mon, 31 Mar 1997 18:12:50 -0500, "J. Trudel" <jdt@insight.att.com>
wrote:

>For some reason, I saw this and wondered what a Dead Randal
>Schwartz interview would be like.

"He's not dead! He's only sleeping!"

Couldn't resist, compaints to /dev/null


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

Date: 3 Apr 1997 02:34:43 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Live Randal Schwartz interview
Message-Id: <5hv503$5gg@fridge-nf0.shore.net>

Colin Yemm (yemm@ucf.edu) wrote:

: "He's not dead! He's only sleeping!"

Shame on you for quoting _Ishtar_.  :-)

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Thu, 03 Apr 1997 01:08:22 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: lock file necessary?
Message-Id: <5huuvh$otk$1@news3.microserve.net>

I like to ask the question "What are the consequences?"

Yes, to protect a file that multiple users can update you, must do a
file lock.  But what are the consequences of not doing so?  What are
the odds of two users hitting this situation?  

For years I have worked with edit tools that clobber anothers file
when two people save/replace (last one wins).  No problem everyone
knows and the frequency of problem seems to be about once or twice per
year.

Now, for your financial banking application - of course, you must use
it.

In your real case, the backup file is for some use (like emergency
restore, or undo).  What are the consequences of a user trying to use
the backup file and finding it was replaced by another?

If your answer is no big deal, then you do not need it.

However, if you begin to hyper-venilate just thinking about it, then
use a lock.   The lock you need here needs to prevent the file from
being overlayed before it is needed this is a design consideration.
I do not believe that any operating system will allow two simultaneous
opened files to shuffle data.  You do not need lock to prevent this,
open prevents this.  If someone else has the file open you will not be
able to open it.

Hope this helps.


carelf@demon.nl wrote:

>Hi everyone,

>Several people are using a simple script of mine simultaneously on
>SunOS 4.1.4 

>The script writes to a backup file.
>Something like this:

>open(BACKUPF,">>$backup_file")||die "Could not open backup file: $!.\n";
>$time=scalar localtime;
>print BACKUPF "Firstvalue: $value0\nSecondvalue: $value1\nDate: $time\n\n"
>close(BACKUPF);

>Will I need a lockfile for this?

>Cheers,

>Carel.





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

Date: Wed, 02 Apr 1997 19:04:12 -0500
From: goldenberg@bioscience.utah.edu (David Goldenberg)
Subject: MacPerl and BBedit
Message-Id: <goldenberg-0204971904130001@p8.ts18.metro.ma.tiac.com>

   I would like to use BBedit to write Perl scripts on the Macintosh, and
then run them with MacPerl.  Is there a way to make BBedit and MacPerl
interact so that it is easy to try out new versions of the script?  As
things stand, I have to save the script and open it in MacPerl.  Since the
script utilizes a file specified by @ARGV[], I also have to save the
script as a dropplet and then execute it from the finder.  This is
starting to feel a lot like compiling a C or Fortran program and then
executing it!
   I suspect that there is a way to use AppleScript to make all of this
much easier, but I don't have any experience with AppleScript.  
   Also, is there a way to direct a file to STDIN with MacPerl?

   Any suggestions would be greatly appreciated.

-- 
David P. Goldenberg                  
Department of Biology          
University of Utah
Salt Lake City, UT

Temporary address:
Department of Biological Chemistry and Molecular Pharmacology
Harvard Medical School
Boston, MA


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

Date: Thu, 03 Apr 1997 02:18:02 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Match ?
Message-Id: <5hv324$q8k$1@news3.microserve.net>

O.K. I should be able to read one of the books on perl and understand
matching, but I can't figure this one out.  The scripted was copied
and works.  

I would like some help to break it apart and explain it.
It checks a URL for the format http://www.my.com/mydir/my.file
and it works.

# Let's check the URL's format
/http:\/\/([^\/]*)\/*([^ ]*)/;
$site=$1;
if (!$site) {die("invalid URL format")}

#      
# http://   first part we got it is matching for http://
#         ([^\/]*)    one or more /nnnnnn sets
    Why would I not have to include .*
     like [^\/.*]*

Because I can not thoroughly understand this, the remaining
just appears to be magic.

([^ ]*)   What is this doing?  

Thanks








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

Date: 03 Apr 1997 10:21:26 +1000
From: Chris Bitmead <Chris.Bitmead@alcatel.com.au>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <s6yybb1klbt.fsf@aalh02.alcatel.com.au>


Jon Leech <jon@cs.unc.edu> wrote:

>In article <s6y208um0ey.fsf_-_@aalh02.alcatel.com.au> you write:
>>output to do calculations. "Which directory entries are older than
>>12/Feb/1997?"  VERY difficult to do with Unix shell. Trivial in a scsh
>>or CLOS style language. One can imagine writing something like (map
>>(lambda (d) (< (file-time d) "12/Feb/1997")) (ls))
>
>    One-liner with the shell, either assuming the existence of a file-time
>comparison program like the file-time predicate you assume, or just using
>'find'.

Ok, someone just pointed out that you can do this in the shell with
the following code....

touch -t 9702120000 /tmp/.zoot$$ 
find . -maxdepth 1 -a \! -newer /tmp/.zoot$$ -print
rm /tmp/.zoot$$

Like I said. Difficult!!

And even assuming you can remember the date layout of the touch
command, the obscure syntax of the find command and remember to remove
the temporary file, how can you store the result in a variable?? You
can stored all the resulting entries in one big shell variable perhaps
for later processing, but then you are subject to the vagaries of
IFS. Point proved as far as I'm concerned.

>>NOW LOOK AT TK!!!! It's object oriented!!!!!!! It's based on all the
>>principles that Ousterhout is deriding. I must say this makes him look
>>like a fool.
>
>    Um, Tk has no inheritance mechanism.

Tk has no properly designed inheritance mechanism. But it does all the
same things, albeit in a horrible disorganised way.

My criteria for object oriented was that (1) different objects react
to the same message in the same way. Clearly different Tk widgets do
this. And (2), Different classes can share common code.

Admittedly Tk does poorly here, but it does have re-use, mostly
because common stuff is split off into utility functions. No, Tk
doesn't support _further_ inheritance without re-organising the code,
but the re-use is there through splitting off common stuff.

So Tk is a good example of how not to do OO. How much cleaner it would
be if it did OO properly.

Now look at Stk. They have put a layer on top making Tk appear to
fully support inheritance, and you can inherit and make
specialisations of widgets and everything. Infinitely more powerful
than Tcl/Tk can ever be.



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

Date: Thu, 03 Apr 1997 01:40:16 GMT
From: dico@peionline.com (Dico Reyers)
Subject: PERL 5.0 on Windows 95...
Message-Id: <334309eb.1851461@news1.pei.sympatico.ca>

Hello...	

I have been online testing my perl scrpts on a unix system.  Every
time I want to test a script for a web page I log on upload the file
and test it out. 

Where can I get PERL 5.0 for win95?  Is it easy to install? 

Any help would be greatly appreciated.

Dico Reyers

dico@peionline.com


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

Date: Wed, 02 Apr 1997 14:31:16 -0500
From: Anthony John Doyle <strad@mondenet.com>
Subject: PERLscript with URL redirection
Message-Id: <3342B403.58CE@mondenet.com>

not sure if this is the best place to ask the question - but
  here goes.
  
  i am working on a PERL script and i would like to be able to
  test various conditions from a web based form which a client
  uses to submit various information and then automatically have
  the user redirected to the appropriate web page
  
  i have tried some various ways with codes 300, 301, and 302
  for the redirection but keep getting a server error - i suspect
  i am missing something in the equation here - can someone
  point me in the right direction?
  
  thank you


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

Date: 3 Apr 1997 02:44:29 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: PERLscript with URL redirection
Message-Id: <5hv5id$5gg@fridge-nf0.shore.net>

Anthony John Doyle (strad@mondenet.com) wrote:
: not sure if this is the best place to ask the question - but
:   here goes.

Yes, this is definitely the wrong place.  :-)  Please refer all CGI
questions to comp.infosystems.www.authoring.cgi.  Perl doesn't understand
a 302 code.  :-)

Hope this helps!

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Wed, 02 Apr 1997 20:30:53 -0600
From: brian mcandrews <bmcandre@mc.net>
Subject: Processing lists.
Message-Id: <3343165D.7552@mc.net>

I have two lists of strings implemented as arrays. Can anyone help me 
with an efficient way to find which elements of list a are in list b.
Example:
  @a = ("Mary", "Bob", "Sammy");
  @b = ("Mary had a little lamb", "Something Sammy", "Test");

I want the resultant list to be: ("Mary had a little lamb", "Something 
Sammy"

Because "Mary" is pattern matched in list b and the same with "SAMMY".

Thanks in advance,
Brian McAndrews


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

Date: Wed, 02 Apr 1997 21:18:40 -0600
From: ctobola@rrnet.com.spam (C.D. Tobola)
Subject: Reading data from _DATA_
Message-Id: <ctobola-ya023180000204972118400001@news.rrnet.com>

I'm a perl newbie -- hope this question isn't too foolish....

I'm building a simple database program. The data is stored after the
program code using the _DATA_ filehandle.

Can someone tell me how to read the data (one line at a time) into an
array. I know how to use iteration -- just don't know how to access this
data.

Thanks!  -Cloy
============================================= 
           Some people never see the light,
          Til it shines through bullet holes.
                        -Bruce Cockburn

For more 80s trivia, visit my New Wave 80s Page
at    http://rrnet.com/~ctobola/newwave.html
=============================================


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

Date: 3 Apr 1997 03:34:10 GMT
From: "Bob Bell" <bbell@voicenet.com>
Subject: Running program on a remote machine
Message-Id: <01bc3fdf$2e8bc4e0$7d8a67cf@bbell.voicenet.com>

	I'm a fairly experienced programmer, but I'm new to Perl, so I appreciate
your patience.  I am interested in using a Perl program where part of it
would require running a program on a remote server.  For instance, if you
were doing it manually, you could telnet to the machine, log in, and run
the program.  Is there a way to do this in Perl code?  I haven't really
messed around with Perl modules yet, so it there some prebuilt code I
should be looking for?  Thanks, it is appreciated.  E-mail replies would
probably be best, and URLs to sites with the info I need would be excellent
(save you time and let me learn more in the process).

			- Bob Bell
			bbell@voicenet.com



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

Date: Wed, 02 Apr 1997 15:48:00 -0800
From: Daniel Glassman <dglass@swpartners.com>
Subject: San Diego Sybase Job Opportunities!!!
Message-Id: <3342F030.6BC1@swpartners.com>

Sybase Engineers Wanted!!!

Software Partners is a solutions oriented consulting company serving the 
southern California area. We specialize in developing  custom
client/server 
applications, such as data-driven intranets and Internet web sites. We
are 
also an authorized reseller of Sybase and PowerBuilder products. We 
provide quality service to our customers and have an excellent track of 
achieving total customer satisfaction.

Software Partners currently has several job openings for Sybase
engineers 
who will be assigned to work with one of our key customers in the
financial 
services industry.  Job assignment areas include Sybase Reporting,
Sybase
Data Integrity, Sybase/Forte Application Development, Sybase/Visual
Basic
Application Development, Sybase Data Import, Sybase/Perl Development,
and Sybase DBA.

The successful candidate will have a Bachelors or Masters degree in
Computer
Science or related discipline, will have at least one year of  Sybase
experience, 
will have strong Unix skills (except for the Sybase/Visual Basic
assignment), and will enjoy working in customer environments.  The Forte
assignment also requires one year of Forte experience, and the
Sybase/Perl assignment requires one year of Perl experience.

If this sounds good to you, mail, fax, or e-mail your resume to:

Human Resources			
Software Partners
Box 230229				
Encinitas, CA  92023-0229   		
Fax:	(619) 350-0372
email:	dglass@swpartners.com


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

Date: 3 Apr 1997 00:40:36 GMT
From: Hans Mulder< hansm@icgned.nl>
Subject: Re: The theoretically fastest way to iterate through all bytes in a string...?
Message-Id: <5huua4$c5g@news.euro.net>

Eryq <eryq@enteract.com> wrote:
> Let's say I have a long string, and I want to perform a
> mathematical operation on each byte in the string (regarded
> as a 0-255 value)... no modification involved, just an update
> of a running total (no it's not a checksum, but something like
> that.)  What, in theory, is the fastest way to do this? 

> 	* a "for" loop with substr()? or unpack()? 
> 	* a while (m/./s)?
> 	* others?

If you want a 0..255 value, consider using vec($your_string,$i,8)

-- 
Hope this helps,

HansM


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

Date: 3 Apr 1997 02:58:21 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Tie() function in Windows95/NT
Message-Id: <5hv6cd$5gg@fridge-nf0.shore.net>

Larry Quantz (larryq@tuttle.com) wrote:

:        We're trying to use the tie() function to do a little DBM
: manipulation on our Windows95/NT machines here, possibly to be used down
: the road on our Internet Information Server in some way.  The only thing
: is, we can't seem to get it to do much of anything. Here's a sample:

You might also check your error returns - *always* use die()!

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 3 Apr 1997 02:55:36 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Tie() function in Windows95/NT
Message-Id: <5hv678$5gg@fridge-nf0.shore.net>

Larry Quantz (larryq@tuttle.com) wrote:

: I know that dbmopen() and dbmclose() aren't supported under Windows95/NT, 
: but what about tie()?  Or are we missing something really simple here. 

Actually, I just tried dbmopen() and dbmclose() on the Activeware port
(5.003_07) from http://www.activeware.com and they seemed to work.

Here's the script I used:

#!perl

$db = '/scripts/testdb/foo';
$mode = 0664;

dbmopen(%NVP, $db, $mode) || die("db error: $!");
$NVP{'foo'} = 'bar';
dbmclose(%NVP);

dbmopen(%nvp, $db, $mode) || die("db read error: $!");
foreach $key (keys %nvp) {
  print("Key: ",$key," -> ",$nvp{$key},"\n");
}
dbmclose(%nvp);

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 3 Apr 1997 03:37:45 GMT
From: "Bob Bell" <bbell@voicenet.com>
Subject: Turning output of command into input
Message-Id: <01bc3fdf$af124bc0$7d8a67cf@bbell.voicenet.com>

	I'm a fairly experienced programmer, but I'm new to Perl, so I appreciate
your patience.  I am looking to use Perl to run an external program.  I
know this can be done using the system() command.  How can I get to the
output of that command?  Say I wanted the results of a "who".  I know I
could do system("who"), but I need to get to the information.  I know I
could output to a file using ">" or pipe it to another program, but I would
hope that there might be a cleaner way where I could just treat the output
of my system() call like I would <STDIN>.  Thanks for all your help. 
Pointers to sites or FAQs with the info I need as just as good.

			- Bob Bell
			bbell@voicenet.com



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

Date: 2 Apr 1997 23:42:38 GMT
From: fxrsg@camelot (Richard S. Guse)
Subject: wait for child processes from 'system' to finish
Message-Id: <5huqte$tfj@news.alaska.edu>
Keywords: wait system() child processes

here's the bare bones of it:

  #!/usr/local/bin/perl -w
  system("clear");
  open(HOSTS,"</usr/bin/hosts");
  while(<HOSTS>)
   {
    chomp();
    system("rsh $_ rl.remote &");
   }
  wait;

how this works is, the program runs a program on each different machine
simultaneously, and returns the data.  I had this running under sh, but
a few users have problems (the rest have no problems at all!).  Currently,
the remote program only prints '3', which works, but the program doesn't
'wait' for them to finish.  I still haven't been able to trace the problems
in the sh script to anything either obvious or non-obvious, so I'm
developing it in perl to hopefully see what I can see...

I'd like to have it wait until all the child system's are returned before 
exiting, but that's just not happening.  I'm still going through all the
man pages and help information, hopefully I'll find out one way or another.

--
Physicist by Choice,         #define SYSOP GOD       Power corrupts.  Absolute
Mathematician by Accident,   #define REALITY NULL       power is kind of neat.
CS student by Mistake,       #include "universe.h"
Brilliant by act of God,
Poor by act of Congress...        e-mail:     fxrsg@Camelot.acf-lab.alaska.edu


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

Date: 3 Apr 1997 02:42:42 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Wanted, a currency converter? Automatic file download?
Message-Id: <5hv5f2$5gg@fridge-nf0.shore.net>

Robert (robert@chalmers.com.au) wrote:

: Does anyone have any currency converter code?

Yes.  Give me five dollars, and I'll shake your hand.  These two are
interchangeable in at least five third world nations ... and the
exchange rate is always the same  :-)

: Also, I need a perl script to automatically download a text file every
: night?

Money?  Download files every night?  Are you part of a cartel?  :-)

Actually, if you're using ftp to do this, I'd strongly suggest that you
look into Net::FTP, which is available from:
http://www.perl.com/CPAN/modules/by-module/Net

Net::FTP is well-documented, so you shouldn't have any problems with
getting it working in no time.  If you're using Unix, just put this 
script in cron, and you'll be golden.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Wed, 02 Apr 1997 21:38:57 -0500
From: Bill Cowan <billc@tibinc.com>
To: Vincent Koser <vkoser@biggun.com>
Subject: Re: win32 sendmail
Message-Id: <33431841.6BBF@tibinc.com>

Vincent Koser wrote:
> 
> I have many scripts from unix that I am openeing a file to sendmail
> like so.
> 
> open(SENDMAIL, "|/usr/sbin/sendmail $email")|| die "Can't use
> sendmail!\n";
> 
> is there a way to accomplish this functionality in win32?  I guess if
> there were an smtp mail module or something that would do it.
> 
> any help is greatly appreciated.
> thanks, please cc email on reply if you can.
> vince

I think your question is discussed in:

  Evangelo's Frequently Asked Questions (FAQ):
    http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: Wed, 02 Apr 1997 16:56:52 -0800
From: Da Borg <vladi_mip@uniserve.com>
Subject: Re: Windose and ease of abuse (WAS: Who makes more.. Who cares?)
Message-Id: <33430054.1FE48E12@uniserve.com>

Gavin Tabor wrote:
> Terry Reedy wrote:
[.........]
> > In article <33414A13.4D45@absyss.fr>, seay@absyss.fr says...
> > > But remember that
> > >everytime someone does some form of freeware (GNU,
> > >Perl, Linux, whatever), this is a bit of socialism.
> >
> > NO!  freeware is voluntary activity (free enterprise) with no guns or
> > g-men in sight.  It is the opposite of socialism.
> 
> NO! freeware is communism - the theoretical version, not the
> practical version - you do it because you want to do it, not
> for any profit beyond what you need to live on.

Not always. There are companies that survive quite well by
developing freely-distributable software and/or taking
existing freely-distributable software and selling it and/or
mixing both their proprietary software and free software. Some
examples: FSF, BSD groups, CyGnus, X-consortium, XFree86,
RedHat, Caldera, Infomagic.. Some are commercial, some
are based on donations. Of course, when I say "free" I mean not
"free binaries" like most of so-called "free software" for Windose
that you obtain from ToCows crappy type of places but *real*
free applications that come with both binaries and source code.

Regards,
Da Borg

-- 
When sending private email, please remove underscores in "vladi_mip".
#include <disclaimer.h>  |     *Good pings come in small packets*
vladimip AT uniserve.com |  Ceterum censeo Microsoftam delendam esse
Vancouver, B.C.          | SIGSIG -- signature too long (core dumped)


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

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 224
*************************************

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