[10409] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4002 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 18 12:02:18 1998

Date: Sun, 18 Oct 98 09:00:24 -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           Sun, 18 Oct 1998     Volume: 8 Number: 4002

Today's topics:
    Re: Are there no PERL experts out there?? Is there no o (Bart Lateur)
    Re: ARGV and Use of uninitialized value (Bart Lateur)
        Comparing dates in Perl <Sales@the-net.co.uk>
    Re: Comparing dates in Perl <cmcurtin@interhack.net>
        CPAN and Netscape 4.5/Linux (Per Steinar Iversen)
    Re: Documentation on databse manipulation (Honza Pazdziora)
        form submitting <rob@ccsn.com>
    Re: form submitting <Tony.Curtis+usenet@vcpc.univie.ac.at>
        Hashing Speed <cobalt@dircon.co.uk>
    Re: Hashing Speed (Tad McClellan)
    Re: How to write a recursive function <dlucas@removethisgol.com>
    Re: I have a few elementary Perl problems (Ronald J Kimball)
    Re: I have a few elementary Perl problems <garry@america.net>
    Re: I have a few elementary Perl problems (Tad McClellan)
    Re: I'm new, but know what I need (David Alan Black)
    Re: Javascript and perl (David Alan Black)
    Re: Perl, dynamic loading, SCO OS 5 <bill@TechServSys.com>
        problems calling procmail (Nick Halloway)
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi (Joergen W. Lang)
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi (Joergen W. Lang)
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <uri@sysarch.com>
    Re: Reading inary Files :: dbase headers (Honza Pazdziora)
        rsh perl problem <lkl@runge.uni-c.dk>
    Re: Sorry (Nathan V. Patwardhan)
    Re: sub and return <tim.hicks@lineone.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 18 Oct 1998 13:52:31 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <362bf021.6415734@news.ping.be>

Lloyd Zusman wrote:

>If you have a pre-conceived notion that no one ever expresses
>gratitude in c.l.p.misc, then you are likely to overlook the many
>instances of thanks that routinely are given here.

Thank you notes are off-topic.

 :-)

	Bart.


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

Date: Sun, 18 Oct 1998 13:52:33 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: ARGV and Use of uninitialized value
Message-Id: <362df0cf.6589352@news.ping.be>

mike_allen@my-dejanews.com wrote:

>Why does the following:

>$ARGV[0] =~ s/,//;
>if( $ARGV[0] ) {           < error here
>    print "$ARGV[0]\n";
>}

>produce:

>Use of uninitialized value at ./temp.pl line 4
>
>if passed no arguments, but:
>
>if( $ARGV[0] ) {
>    print "$ARGV[0]\n";
>}
>
>does not?

You're barking at the wrong tree. It's the { s/,//; } statement that
produces the error.

To answer your second question: it is safe to use undefined values in an
if statement, without warnings. Traditionally, Perl functions that
return boolean values, use undef for false. See, for example, "open".

	Bart.


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

Date: Sun, 18 Oct 1998 10:31:15 -0700
From: Lawrence Frewin <Sales@the-net.co.uk>
Subject: Comparing dates in Perl
Message-Id: <362A25E2.3308C416@the-net.co.uk>

I want to add a subroutine to a Perl file that looks at the date a
database entry was created, compares it with the current date, then if
the entry is more than one month old it deletes the entry from the
database.

I have worked out how to add the date to each database entry I make, but
relating that to the current date less thirty days isn't as easy as I
though it would be.

The ideal code would contain something simple such as:

1) Look at date of database entry
2) Look at current date
3) If database entry equals current date minus 30 days, delete it.

This sounded like it would be very simple to me, but I can't find
anything in the reference books I have that go into detail about using
dates.

Does anyone know the name and URL of any perl scripts that uses
previously determined dates for comparison against the current date then
performs an action based on the result?

Thanks

Lawrence




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

Date: 18 Oct 1998 09:14:11 -0400
From: Matt Curtin <cmcurtin@interhack.net>
To: Lawrence Frewin <Sales@the-net.co.uk>
Subject: Re: Comparing dates in Perl
Message-Id: <xlxd87qt3ks.fsf@gold.cis.ohio-state.edu>

Lawrence Frewin <Sales@the-net.co.uk> writes:

> Does anyone know the name and URL of any perl scripts that uses
> previously determined dates for comparison against the current date then
> performs an action based on the result?

You can `use Time::Local', which will provide timelocal(),  will
convert input into time (i.e., seconds since epoch):

      $time = timelocal($sec,$min,$hours,$mday,$mon,$year);

See the Time::Local perldoc for details.

-- 
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/


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

Date: 18 Oct 1998 11:15:01 GMT
From: PerSteinar.Iversen@adm.hioslo.no (Per Steinar Iversen)
Subject: CPAN and Netscape 4.5/Linux
Message-Id: <slrn72jjdo.99t.PerSteinar.Iversen@elbonia.p52.hioslo.no>

Does anybody else have this problem with CPAN and
Netscape 4.5/Linux? The HTML pages that CPAN
keeps on ftp-servers are displayed as text,
not as HMTL, not very useful. This applies to
the Linux version of Netscape 4.5, the Windows
version does this OK.

For example, this page is displayed as text
in my Linux netscape:

ftp://sunsite.uio.no/pub/languages/perl/CPAN/README.html

Any ideas how to fix this?

-psi


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

Date: Sun, 18 Oct 1998 15:25:56 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Documentation on databse manipulation
Message-Id: <slrn72k244.4fg.adelton@aisa.fi.muni.cz>

On Sat, 17 Oct 1998 22:10:19 -0800, mterich <filth@san.rr.vom> wrote:
> I'm looking for some detailed documentation on database access with perl.
> I have the camel book and "learning perl on win32" and both mention and
> discuss briefly accessing databases with perl, however neither one goes
> into gory detail.  Is there a book or an online tutorial that goes into it
> with more detail?  A tab delimited spreadsheet would also work.  It would

Start with www.perl.com:

	http://reference.perl.com/query.cgi?database

You will probably be most interested in the DBI module, more info

	http://www.arcana.co.uk/technologia/perl/DBI/

Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Sun, 18 Oct 1998 08:04:36 -0500
From: "Roberto Cerini" <rob@ccsn.com>
Subject: form submitting
Message-Id: <70cp3c$32s@nnrp3.farm.idt.net>

Hello,
does anyone know of a good way to create a from and have sendmail email the
form to whichever address is desired?

Thanks,


--
Roberto Cerini
rob@ccsn.com




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

Date: 18 Oct 1998 16:02:45 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: form submitting
Message-Id: <83k91ydl2y.fsf@vcpc.univie.ac.at>

Re: form submitting, Roberto <rob@ccsn.com> said:

Roberto> Hello, does anyone know of a good way to create a
Roberto> from and have sendmail email the form to whichever
Roberto> address is desired?

Yes.



But what on earth has that got to do with perl?

-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Sun, 18 Oct 1998 15:35:50 -0700
From: "Paul Davies" <cobalt@dircon.co.uk>
Subject: Hashing Speed
Message-Id: <3629fb1d.0@newsread1.dircon.co.uk>

Hi There

I'm building a text file database using perl. Essentially the main queries
will consist of opening a file, loading the data into a %hash and then
scanning the hash for appropriate matches.

e.g.

foreach $key (keys %hash) {
    if($key == val) {
        $result = $hash{$key}
    }
}


Can anyone tell me what is the best way to code these loops in terms of
speed?  I've run comparisons using the above foreach and:

while(($key,$value) = each(%hash)) {
    if($key == val{ ....

but there does not seem to be any difference in speed.

Any tips as to how to make this run as quickly as possilbe would be
appreciated

Thanks

Paul











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

Date: Sun, 18 Oct 1998 10:32:28 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Hashing Speed
Message-Id: <cm1d07.mic.ln@flash.net>

Paul Davies (cobalt@dircon.co.uk) wrote:

: I'm building a text file database using perl. Essentially the main queries
: will consist of opening a file, loading the data into a %hash and then
: scanning the hash for appropriate matches.
           ^^^^^^^^

   Are you looking up the keys? Or the values?


: e.g.
: foreach $key (keys %hash) {
:     if($key == val) {
                 ^^^
                 ^^^ what's that?


:         $result = $hash{$key}
:     }
: }


   Oh. You are looking up the keys.

   Good. That is what hashes were invented for  ;-)


: Can anyone tell me what is the best way to code these loops in terms of
                                                  ^^^^^^^^^^^
: speed?  I've run comparisons using the above foreach and:


   It is likely faster to not _have_ those loops  ;-)



: while(($key,$value) = each(%hash)) {
:     if($key == val{ ....

: but there does not seem to be any difference in speed.

: Any tips as to how to make this run as quickly as possilbe would be
: appreciated


   You can do it all in a single line, assuming $val holds the
   term to search for:

      $result = $hash{$val} if exists $hash{$val};


   You don't say what you want to do if the term is not in the
   hash...



   (you should use Benchmark.pm to compare the relative
    speed of alternative implementations with your real
    data.
   )


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


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

Date: Sun, 18 Oct 1998 13:29:39 GMT
From: Dan Lucas <dlucas@removethisgol.com>
Subject: Re: How to write a recursive function
Message-Id: <VA.00000015.0009becc@dlucas.gol.com>

Thanks to (just another) Larry and Jonathon for your replies; I'm 
printing them for further inspection as I type. :-)

Cheers,
Dan




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

Date: Sun, 18 Oct 1998 09:37:08 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: I have a few elementary Perl problems
Message-Id: <1dh38oe.16lin3ryud4n4N@bos-ip-1-107.ziplink.net>

[posted and mailed]

Ilya <ilya@ns1.foothill.net> wrote:

>  I have the following script. The purpose of the script is to process the
>  MASTER_LIST, which is a file that simply contains a number of fully
>  qualified host names. I want to perform several Unix commands on each host
>  via remsh, and then save the results in its corresponding directory, i.e.,
>  I want to save the ouput from machine1 to the directory
>  /home/ilya/web/sysinfo/machine1/command.out. 
> 
> #!/usr/contrib/bin/perl
> # Open a file in the format:
> # fully_qualified_name1
> # fully_qualified_name2
> # fully_qualified_name3
> 
> open (MASTER_LIST,  "<master_list");   #open master_list for reading 

open (MASTER_LIST,  "<master_list")
  or die "Unable to open master_list: $!\n";

> while (<MASTER_LIST>)        # read until EOF
>  {
> 
>    chop;

use chomp() instead.

>    system ("remsh $_ command > /home/ilya/web/sysinfo/$_/command");
> 
>  }
>  close (MASTER_LIST);
> 
>  
>  However, the problem is that in the example above,
>  /home/ilya/web/sysinfo/$_/command apparently does not expand to
>  /home/ilya/web/sysinfo/machineXX/command file as it should and I am
>  getting an error message:

If the string were not being interpolated properly, you would not be
getting the following errors.
 
>  $ ./build_page.pl
>  sh: /home/ilya/web/sysinfo/machine1: Cannot create the specified file.
>  sh: /home/ilya/web/sysinfo/machine2: Cannot create the specified file.
>  sh: /home/ilya/web/sysinfo/machine3: Cannot create the specified file.
> 
>  Now why would this be? Of course it cannot create
>  /home/ilya/web/sysinfo/machine3 file, because it is a directory. I am
>  trying to create /home/ilya/web/sysinfo/machineXX/command_name, in each
>  directory.

Do the directories already exist?  If not, perhaps the error message
means that the shell cannot even create the directory in which you have
asked it to create the file.

Perhaps the shell does not have the proper permissions to create the
directory.

On the other hand, keep in mind that the shell used to execute system
commands is sh.  You mention later that you usually program in ksh;
perhaps auto-creating the path to a file is something that ksh can do
but sh cannot.

>  Thinking that something must be incorrect with the $_ built-in variable,

That is very unlikely.

> I came up with this:
> 
>  
> while ($input = <MASTER_LIST>)        # read until EOF
> {
> 
>   chop;
>    system ("remsh $input command > /home/ilya/web/sysinfo/$uptime/command");
>    print "Processing $input \n";
> }
> 
>  That does not give me an error. Instead, it logs me in to each machine
>  want to run the command on!!!  I do NOT want to log on each machine. I
>  want to remsh a few command for a few dozen machines and record the
>  output.

That's because you forgot to update the chop; line.  You're still
chopping $_, instead of $input, so your argument to system now looks
like:

remsh machineXX
command > /home/ilya/web/sysinfo/$uptime/command

The shell executes `remsh machine`, logging you into machineXX.
Everything following the newline is most likely ignored.


By the way, that's really not Perl's fault.

>  I am really disappointed. This is my first Perl  script, I usually program
>  in ksh, and it seems that not only Perl does not have advantages over ksh,
>  elementary tasks such as creating a number of files in several directories
>  are difficult   to accomplish. What  is  going on  with  this. I could not
>  figure this out after scanning several Perl books for an hour.

I am sorry to hear that you are disappointed.  Stick with it, and I
think you will be able to figure it out.

I would like to point out that if this is the first Perl script you have
written, then you are not familiar enough with Perl to compare it
meaningfully to ksh.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sun, 18 Oct 1998 13:42:56 GMT
From: "Garry T. Williams" <garry@america.net>
Subject: Re: I have a few elementary Perl problems
Message-Id: <3629F0B0.63AB3689@america.net>

It's hard to say without actual code, but I suspect that you are
fighting a problem with quoting (or not quoting) shell metacharacters. 
It looks like the remote shell is being asked to redirect its stdout to
a file on the remote machine that doesn't exist because of a missing
directory structure.  

If you type, at the ksh prompt, 

	$ rsh machine "ls > path"

it's different than typing 

	$ rsh machine "ls" > path

The former is asking for a redirection on the *remote* host, while the
latter is redirecting the rsh stdout on *this* host.  

If you want the output of the local machine's command to be redirected
to a file on the local machine, then the call to Perl's system function
needs to look something like this: 

	system("rsh machine \"ls\" > path")

If instead, you want the output of the remote command to be redirected
to a file on the remote machine, you need something like this: 

	system("rsh machine \"ls > path\"")

Does that help?  

-Garry Williams

Ilya wrote:
> 
>  I have the following script. The purpose of the script is to process the
>  MASTER_LIST, which is a file that simply contains a number of fully
>  qualified host names. I want to perform several Unix commands on each host
>  via remsh, and then save the results in its corresponding directory, i.e.,
>  I want to save the ouput from machine1 to the directory
>  /home/ilya/web/sysinfo/machine1/command.out.
> 
> #!/usr/contrib/bin/perl
> # Open a file in the format:
> # fully_qualified_name1
> # fully_qualified_name2
> # fully_qualified_name3
> 
> open (MASTER_LIST,  "<master_list");   #open master_list for reading
> 
> while (<MASTER_LIST>)        # read until EOF
>  {
> 
>    chop;
>    system ("remsh $_ command > /home/ilya/web/sysinfo/$_/command");
> 
>  }
>  close (MASTER_LIST);
> 
> 
>  However, the problem is that in the example above,
>  /home/ilya/web/sysinfo/$_/command apparently does not expand to
>  /home/ilya/web/sysinfo/machineXX/command file as it should and I am
>  getting an error message:
> 
>  $ ./build_page.pl
>  sh: /home/ilya/web/sysinfo/machine1: Cannot create the specified file.
>  sh: /home/ilya/web/sysinfo/machine2: Cannot create the specified file.
>  sh: /home/ilya/web/sysinfo/machine3: Cannot create the specified file.
> 
>  Now why would this be? Of course it cannot create
>  /home/ilya/web/sysinfo/machine3 file, because it is a directory. I am
>  trying to create /home/ilya/web/sysinfo/machineXX/command_name, in each
>  directory.
> 
>  Thinking that something must be incorrect with the $_ built-in variable, I
>  came up with this:
> 
> 
> while ($input = <MASTER_LIST>)        # read until EOF
> {
> 
>   chop;
>    system ("remsh $input command > /home/ilya/web/sysinfo/$uptime/command");
>    print "Processing $input \n";
> }
> 
>  That does not give me an error. Instead, it logs me in to each machine
>  want to run the command on!!!  I do NOT want to log on each machine. I
>  want to remsh a few command for a few dozen machines and record the
>  output.
> 
>  I am really disappointed. This is my first Perl  script, I usually program
>  in ksh, and it seems that not only Perl does not have advantages over ksh,
>  elementary tasks such as creating a number of files in several directories
>  are difficult   to accomplish. What  is  going on  with  this. I could not
>  figure this out after scanning several Perl books for an hour.
> 
>  Ilya
> 
> 
> 
>


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

Date: Sun, 18 Oct 1998 10:12:47 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: I have a few elementary Perl problems
Message-Id: <fh0d07.cgc.ln@flash.net>

Ilya (ilya@ns1.foothill.net) wrote:
:  I have the following script. The purpose of the script is to process the
:  MASTER_LIST, which is a file that simply contains a number of fully
:  qualified host names. I want to perform several Unix commands on each host
:  via remsh, and then save the results in its corresponding directory, i.e.,
:  I want to save the ouput from machine1 to the directory
:  /home/ilya/web/sysinfo/machine1/command.out. 

: #!/usr/contrib/bin/perl

   You should always, yes always (ie. on every Perl script), ask
   perl to help you debug your programs by enabling warning messages:

      #!/usr/contrib/bin/perl -w
                              ^^

   Then see the 'perldiag' man page for descriptions of any of
   the messages you get.


: # Open a file in the format:
: # fully_qualified_name1
: # fully_qualified_name2
: # fully_qualified_name3

: open (MASTER_LIST,  "<master_list");   #open master_list for reading 


   You should check to see if the open() succeeded.

   Probably want to just abort if you don't have read permisssion,
   or the file does not exist, for example.

      open(MASTER_LIST, "<master_list") || 
         die "could not open 'master_list' $!";


: while (<MASTER_LIST>)        # read until EOF
:  {

:    chop;

   chomp() is safer here...


:    system ("remsh $_ command > /home/ilya/web/sysinfo/$_/command");


   Probably should check if the system command succeeded too:

   if (system ("remsh $_ command > /home/ilya/web/sysinfo/$_/command")) 
      {print "system() failed!   $!\n"}



:  }
:  close (MASTER_LIST);

:  
:  However, the problem is that in the example above,
:  /home/ilya/web/sysinfo/$_/command apparently does not expand to
                                     ^^^^^^^^^^

   You would need to print() it to see how it appears  ;-)

   It is most surely getting expanded correctly.


:  /home/ilya/web/sysinfo/machineXX/command file as it should and I am
:  getting an error message:

:  $ ./build_page.pl
:  sh: /home/ilya/web/sysinfo/machine1: Cannot create the specified file.
:  sh: /home/ilya/web/sysinfo/machine2: Cannot create the specified file.
:  sh: /home/ilya/web/sysinfo/machine3: Cannot create the specified file.


   As you can see, you are getting an error message from the shell,
   not from perl.


:  Now why would this be? 


   because the machine1/ directory does not exist.


: Of course it cannot create
:  /home/ilya/web/sysinfo/machine3 file, because it is a directory. I am


   Directories in Unix filesystems _are_ files. They are just interpreted
   specially.

   Your OS gives a rather misleading diagnostic though. Mine says:

      "non-existent-dir/foo.out: No such file or directory"

   when I type this at the command line:

      echo foo >non-existent-dir/foo.out


:  trying to create /home/ilya/web/sysinfo/machineXX/command_name, in each
:  directory.


   You need to mkdir("machineXX") before you can put stuff into
   the machineXX directory...


:  I am really disappointed. 


   Excellent!

   You are now even more motivated to ditch the shell and use Perl,
   since the disappointment here is due to the shell and not due to Perl   ;-)

   You would get the same results from an equivalent shell script.


: This is my first Perl  script, I usually program
:  in ksh, 


   Does ksh automatically create directories for you?


: and it seems that not only Perl does not have advantages over ksh,
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   That's kinda silly, now that you see where the problem is, right?


:  elementary tasks such as creating a number of files in several directories
:  are difficult   to accomplish. What  is  going on  with  this. I could not
:  figure this out after scanning several Perl books for an hour.
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^


   Should have been scanning shell books  ;-)


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


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

Date: 18 Oct 1998 07:27:15 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: I'm new, but know what I need
Message-Id: <70cjaj$buu$1@pilot.njin.net>

Hello -

Dominic <forgetit@usadowntheloo.com> writes:
                  ^^^^^^^^^^^^^
                  How friendly of you....


>Hello

>First, sorry if this kind of post has appeared many times before. I'm
>new and not sure of the "status" of this kind of post.

>I'd like some help:

>Sites giving an overview of the perl language instruction set.

>A site showing a "how to" of getting a script to pass the information it
>collects from the form off the Web page and to invoke a .exe
>program.(which uses it)


Perhaps I'm over-reacting, but I always worry when I see phrases like
"*the* form" and "*the* Web page" (emphasis added).  Not to mention 
".exe"...

You do realize, I hope, that the vast majority of programs written in
the Perl programming language have nothing to do with forms or Web
pages.  Actually, I strongly suspect that you do not realize that, and
that in fact you do not "know what [you] need."


>reply
>blueatihugdotcodotnz

Notspacebloodyspacelikelyexclamationpoint


David Black
dblack@pilot.njin.net


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

Date: 18 Oct 1998 07:16:46 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: Javascript and perl
Message-Id: <70cimu$bsm$1@pilot.njin.net>

"Sam Spurling" <spurling@mindspring.com> writes:

>Does anyone know how to fire a perl script off from within a onmouseover
>event.  This is a section of code I am trying.  The first table row is a
>generic script I am trying to envoke.  The second table is a normal
>onmouseover event that works fine.


I have no idea, but I suspect it's the same as "firing off" any other
script, within the confines (one hopes) of a secure environment.

I.e., this isn't a Perl question.  Please take it to a JavaScript-ish
forum.


David Black
dblack@pilot.njin.net


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

Date: Sun, 18 Oct 1998 05:58:48 -0400
From: -bill- <bill@TechServSys.com>
Subject: Re: Perl, dynamic loading, SCO OS 5
Message-Id: <70ce4p$8j@news.voyager.net>

I use all static modules
-- 

-bill-

Technical Service Systems - bill@TechServSys.com


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

Date: 18 Oct 1998 14:43:55 GMT
From: snowe@rain.org (Nick Halloway)
Subject: problems calling procmail
Message-Id: <70curc$ft0$1@news.rain.org>

I'm having problems with the perl version 5.0 code below.
It doesn't seem to know that save-incoming is a .procmailrc file,
it gives errors

:0:: not found
!snowe@rain.org: not found

-- the lines in save-incoming are 
:0:
!snowe@rain.org

but it doesn't die.  


Thanks ...

################################################################## Archiving
# archive
open( COMMAND, "| procmail -f- $MNG_ROOT/etc/procmail/save-incoming" )
|| die "open procmail didnt work";

print COMMAND $Body || die "print to procmail didnt work";

close( COMMAND );

unlink( $TmpFile );







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

Date: Sun, 18 Oct 1998 13:44:22 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <1dh3jiu.gkp4s8ri81qsN@host009-210.seicom.net>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:

> Matt Pryor wrote:
> 
> > > That'd be *father*-of-perl, no? Unless there's something Larry hasn't
> > > told us...
> > 
> > Hmmm... I always did think that big handlebar moustache was a bit
> > suspicious.
> 
> Well, giving birth is usually considered in the feminine sense of
> 'motherhood'. Unless there has been a miracle and men can now share the
> experience. ;) Larry is the mother of this Perl. 
> 
> e.

That must be the virgin Lary, then.
So I will consider the question I asked in the "is he that Larry
Wall?"-thread as answered.

Joergen
-- 
  To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
   "Everything is possible - even sometimes the impossible"
             HOELDERLIN EXPRESS - "Touch the void"


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

Date: Sun, 18 Oct 1998 13:44:24 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <1dh3jp0.8v72k81ekf3swN@host009-210.seicom.net>

Daniel Grisinger <dgris@perrin.dimensional.com> wrote:

> Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
> 
> > Joergen W. Lang wrote:
> > 
> > > And the menu is written in Perl, of course.
> > 
> > Of course, with a translated version for the non-geeks. :)
> 
> No, non-geeks are expected to RTFM if they are
> hungry :-).
> 
> dgris

Which means you are expected to know how to use a fork().
(RTFM = "read the forking manual" ?)

Joergen
--
  To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
   "Everything is possible - even sometimes the impossible"
             HOELDERLIN EXPRESS - "Touch the void"


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

Date: 18 Oct 1998 10:51:24 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <x7yaqdsz2r.fsf@sysarch.com>

>>>>> "JWL" == Joergen W Lang <jwl@_munged_worldmusic.de> writes:

  JWL> Daniel Grisinger <dgris@perrin.dimensional.com> wrote:
  >> Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
  >> 
  >> > Joergen W. Lang wrote:
  >> > 
  >> > > And the menu is written in Perl, of course.
  >> > 
  >> > Of course, with a translated version for the non-geeks. :)
  >> 
  >> No, non-geeks are expected to RTFM if they are
  >> hungry :-).
  >> 
  >> dgris

  JWL> Which means you are expected to know how to use a fork().
  JWL> (RTFM = "read the forking manual" ?)

else they can only order finger food (no forks)

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Sun, 18 Oct 1998 15:22:16 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Reading inary Files :: dbase headers
Message-Id: <slrn72k1t8.4fg.adelton@aisa.fi.muni.cz>

On Sat, 17 Oct 1998 22:03:52 -0400, tory1@mail.idt.net <tory1@mail.idt.net> wrote:
> 
> I have opend the file successfully and I can read 
> in the buffer read(INFILE, $buff32,32) and if
> I do something like
> print "Found Version 3.0" if (substr($buff32,0,1) == "x\03");
> then I get the correct print -- but I cannot do

I do not think you get a correct result. You would have to do
something like

	open INFILE, "test.dbf" or die $!;
	read(INFILE, $buff32,32);
	print "Found Version 3.0" if (substr($buff32,0,1) eq "\x83");

> $Version = sprintf("%x",substr($buff32,0,1));
> successfully.

Use unpack:

	printf("%x", unpack("C",substr($buff32,0,1)));

In case you are going to continue parsing your dbf file, let me
remember that there is a XBase.pm module on CPAN, that does just this
(and much more), much easier.

Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Sun, 18 Oct 1998 14:11:30 +0200
From: "Lars Kr. Lundin" <lkl@runge.uni-c.dk>
Subject: rsh perl problem
Message-Id: <3629DAF2.167E@runge.uni-c.dk>

I have a perl script running under UNIX (OSF1) that
redirects its STDOUT to a file on the local filesystem
and then does a
system('rsh -n remotehost /full_path/remotescript.pl');

The STDOUT redirection is done from within perl to avoid
a shell process handling the redirection.

remotehost runs either OSF1 or HP-UX.

remotescript.pl will either terminate successfully or fail
in malloc when all the remote memory is used up.

The occurrence of a certain text string in the standard output from
remotescript.pl signifies normal termination, while lack of the
text string signifies failure. The local perl script checks for this
and responds accordingly. (The text string is used because the exit
status of the local rsh command is unaffected by the exit status of
the remote command).

Things work OK when remotescript.pl terminates normally (i.e. the text
string is detected),
and also when I kill remotescript.pl myself (with f.ex: rsh remotehost
kill 1234) - i.e. no text string.

The problem is when remotescript.pl terminates abnormally on its own -
due to a malloc failure.
In this case there is no process left on remotehost - as expected.
In spite of this the local rsh process does not terminate (at least not
within several hours)
and consequently the local perl process hangs in the system call.

I tried to substitute the system call with
system("rsh -n remotehost '/full_path/remotescript.pl;exit'");

This approach requires both a local and a remote shell process, which is
not so desirable,
and, more importantly, is does not improve matters.

Can anybody help me to remotely run remotescript.pl in a
more robust fashion?

Could the use of ssh instead of rsh solve the problem?

Please E-mail a copy of your answer directly to me as well.

Thank you,
-Lars.

-- 
M.Sc. Lars Kr. Lundin.                           | Problems worthy
IMM, Technical University of Denmark.            |  of attack
Phone (Office) +45 4525 3080, Fax +45 4593 2373. | prove their worth
E-mail: lkl@runge.uni-c.dk                       |  by hitting back
URL: http://www.imm.dtu.dk/~lkl/                 |       -Piet Hein


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

Date: Sun, 18 Oct 1998 13:56:49 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Sorry
Message-Id: <BsmW1.19$OZ4.12465@news.shore.net>

Uri Guttman (uri@sysarch.com) wrote:
: you should see what it is like at a perl mongers meeting or at the
: perl conference!

Are you talking about rudeness?  Yes, I think so.

--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>


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

Date: Sun, 18 Oct 1998 15:43:46 +0100
From: "Tim Hicks" <tim.hicks@lineone.net>
Subject: Re: sub and return
Message-Id: <49nW1.3378$6r3.69@news-reader.bt.net>

Again, you guys have come to the rescue of a newbie programmer.  You lot are
great; I admire your patience and just want to take this opportunity to
thank everyone who puts in time, effort and expertise on this newsgroup.  If
this facility wasn't here, I would not be able to 'teach myself' (so to
speak) how to use perl.


Tim




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

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


Administrivia:

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

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


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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

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

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4002
**************************************

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