[19533] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1728 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 10 21:05:54 2001

Date: Mon, 10 Sep 2001 18:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1000170308-v10-i1728@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 10 Sep 2001     Volume: 10 Number: 1728

Today's topics:
    Re: Baiting Gozilla to obtain quality code for nothing! (Tim Hammerquist)
    Re: Can't fork on certain computers? (Ian Boreham)
    Re: Cannot overload operator <> ? <bwalton@rochester.rr.com>
    Re: Efficiency (Malcolm Dew-Jones)
    Re: GetOptions($argument => \$output); <bwalton@rochester.rr.com>
        getting characters <jks@spam.me.not.akula.com>
    Re: getting characters (Tad McClellan)
    Re: getting characters <jurgenex@hotmail.com>
    Re: HELP: Capture a page? <spam@funnybytes.com>
    Re: HELP: Capture a page? (Tad McClellan)
    Re: HELP: Capture a page? (Malcolm Dew-Jones)
        how to get the length of string <delta1604@yahoo.com>
    Re: how to get the length of string (Tad McClellan)
    Re: how to get the length of string <spam@funnybytes.com>
    Re: how to get the length of string <jurgenex@hotmail.com>
    Re: how to get the length of string <Jon.Ericson@jpl.nasa.gov>
        mysql connection. <mfrick@chariot.net.au>
    Re: mysql connection. (Damian James)
    Re: mysql connection. (Malcolm Dew-Jones)
    Re: Problem with expect (Charles DeRykus)
    Re: Problems with sample modules from a book (Chas Friedman)
        start a script when a process exits <luke@chipcity.com.au>
    Re: start a script when a process exits (Damian James)
    Re: start a script when a process exits <Jon.Ericson@jpl.nasa.gov>
        Verify https communication (Nitin G.)
    Re: Warning on adding hash element (so)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 10 Sep 2001 23:01:39 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Baiting Gozilla to obtain quality code for nothing!!
Message-Id: <slrn9pqiad.s7.tim@vegeta.ath.cx>

Me parece que Matt Garrish <matthew.garrish@sympatico.ca> dijo:
> She [Godzilla!/Kira] should perhaps
> read the story of the little boy who cried wolf. One day she might actually
> have something interesting to say, but there will be nobody left who will
> listen...

Given the contents of many clpm'ers killfiles, this may already apply.

-- 
The two surviving chocolate people copulate desperately, losing
themselves in a melting frenzy of lust, spending the last of their
brief, borrowed lives in a spasm of raspberry cream and fear.
    -- Narrator, The Sandman


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

Date: 10 Sep 2001 17:56:11 -0700
From: ianb@ot.com.au (Ian Boreham)
Subject: Re: Can't fork on certain computers?
Message-Id: <f02c4576.0109101656.733409d0@posting.google.com>

thepro@toao.net (Graham W. Boyes) wrote in message news:<e9503d3c.0109101032.5d4505ce@posting.google.com>...

> I want to capture the output of a program called mem.exe and use it in
> my program.  I have this code:
> 
> open FORK, "MEM |" or die "Doesn't work";

You should always print the error reason, e.g.

$ perl -e 'open BLAH, ">/hello" or die "Failed: $!"'
Failed: Permission denied at -e line 1.

Then you might know why it failed.

Regards,


Ian


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

Date: Tue, 11 Sep 2001 00:22:37 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Cannot overload operator <> ?
Message-Id: <3B9D592D.B8F02223@rochester.rr.com>

Clemens Hintze wrote:
 ...
> I have tried to overload the <> operator within an own class. But it
> didn't work, I get the message:
> 
>   Not a GLOB reference at foo.pl line 240.
> 
> As I didn't find a way to get it working, I friend of mine has passed
> the book "Programming Perl 3rd Edition" to me. Here was following
> example program mentioned:
 ...
> This way it is shown to work here, was very similar to my own one. So I
> put this sample into a file, started it and ...
> 
>   Not a GLOB reference at pp3ed-sample.pl line 19.
> 
> Gnark! What did I done wrong? :-(
> 
> I am using Perl on FreeBSD 4.3-STABLE. A perl -v shows:
> 
>   version 5.005_03 built for i386-freebsd
> 
> I have already searched groups.google.com, and some other documentation
> like FAQ and manpages. Unfortunately I did not find anything referring
> to that problem. That error did only occur not relating to overload
> issues at elder Perl versions.
> 
> Any hints for me?
> 
> Thanks in advance,
> Clemens.

Well, I pasted your sample verbatim and ran it and got:

D:\junk>perl junk74.pl
The 1st lucky number is: 29.
The 2nd lucky number is: 12.
The 3rd lucky number is: 13.
The 4th lucky number is: 10.
The 5th lucky number is: 50.
The 6th lucky number is: 33.

And the bonus number is: 34.

D:\junk>perl -v

This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2001, Larry Wall

Binary build 628 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 15:41:05 Jul  4 2001

 ...

D:\junk>ver

Windows 98 [Version 4.10.2222]


D:\junk>


So it looks like an issue with either your OS or your version of Perl.
-- 
Bob Walton


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

Date: 10 Sep 2001 15:36:56 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Efficiency
Message-Id: <3b9d4088@news.victoria.tc.ca>

TM (tm@kernelconsult.com) wrote:
: Hi,

: Can Perl instructions either from the core or from specific modules be
: more efficient than system commands such as copy, xcopy, del, move etc
: with their many switches and wildcards. Or maybe that's a nonsense. In
: my case, I'm working on WIn2K with procedures that handle thousands of
: files with such commands that's why I'm looking for improvement in
: execution time of such actions.


Large batch files can be inefficient, the command processor opens and
closes the batch file for each command, and scans the batch file for
labels starting at the top each time you use them (big hit if you have any
loops). 

I'm not sure that doing system('the command') numerous times from perl
would be better, though.



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

Date: Tue, 11 Sep 2001 00:12:58 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: GetOptions($argument => \$output);
Message-Id: <3B9D56EF.8BDC633@rochester.rr.com>

Sten Sogaard wrote:
 ...
> I am trying to get GetOptions to work with variable arguments.
> Bacially I am getting the possible arguments somewhere else during
> runtime and want to feed that to GetOptions.
> When I define the argument as a constant (line 2) it works, but when I
> get the argument from another variable it does not work.
> 
> Can anyone please give me a hint to what I am doing wrong.
> 
> >  $set{'name'}="teste_2";
> >  my $argument = "$set{'name'}=s";    # this does not work
> >  #      my $argument = "teste_2=s"; # this works
> >
> >  print ">$argument<\n";   # prints out >teste_2=s<
> >  my $output;
> >  GetOptions($argument => \$output);

Well, I don't see anything wrong.  Your program fragment (verbatim, with
use Getopt::Long; included and the value of $output printed) works with
either the second or third line commentted, giving exactly the same
results in $output, which are per the Getopt::Long docs.  You state "it
does not work".  What precisely is it you think does not work?  What
does it do that it should not do?  What doesn't it do that it should
do?  Does it generate an error message?  If so, what exactly does it
say?  We're not mind readers -- all we know is what you tell us, and
"doesn't work" isn't telling us much.
-- 
Bob Walton


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

Date: Mon, 10 Sep 2001 22:07:37 -0000
From: Joseph Shraibman <jks@spam.me.not.akula.com>
Subject: getting characters
Message-Id: <tpqed92j06lp9b@corp.supernews.com>

I have a script that reads some text and converts it into xml.  The 
problem is that characters > 128 sometimes don't parse, so I want to 
convert them into &#<num>; sequences.  How can I get each individual 
character and treat it as a number?  I can get individual strings of 1 
character each but I don't know how to treat them as numbers.

-- 
--
TuPari
Joseph Shraibman
jks(at)iname.com


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

Date: Mon, 10 Sep 2001 22:22:19 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: getting characters
Message-Id: <slrn9pqcia.vlr.tadmc@tadmc26.august.net>

Joseph Shraibman <jks@spam.me.not.akula.com> wrote:

>How can I get each individual 
>character and treat it as a number?


   perldoc -f ord


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 10 Sep 2001 15:24:47 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: getting characters
Message-Id: <3b9d3daf$1@news.microsoft.com>

"Joseph Shraibman" <jks@spam.me.not.akula.com> wrote in message
news:tpqed92j06lp9b@corp.supernews.com...
> I have a script that reads some text and converts it into xml.  The
> problem is that characters > 128 sometimes don't parse, so I want to
> convert them into &#<num>; sequences.  How can I get each individual
> character and treat it as a number?  I can get individual strings of 1
> character each but I don't know how to treat them as numbers.

Are you looking for "ord"?

jue




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

Date: Tue, 11 Sep 2001 00:08:13 +0200
From: "Admin UsePad" <spam@funnybytes.com>
Subject: Re: HELP: Capture a page?
Message-Id: <9njdd9$pfg$1@news.hccnet.nl>

Thank you,


"Jürgen Exner" <jurgenex@hotmail.com> schreef in bericht
news:3b9d3858@news.microsoft.com...
> [Please do not post jeopardy-style]
> "Admin UsePad" <spam@funnybytes.com> wrote in message
> news:9njc5n$obi$1@news.hccnet.nl...
> > Ok than,.. could you tell me where to find that perl faq? and what's
that
> > special -q operator, is it quick?
>
> It is sitting right there on your very own harddrive as part of every
> standard Perl installation.
> And the "special -q operator" is the hint for perldoc to search in the FAQ
> rather than in the man pages, in the module description, etc.
>
> Further details see
>     perldoc perldoc
>
> jue
>
> BTW: a quick search in google or reading this NG for a few days would have
> told you this without ever asking the same question again.
>
>




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

Date: Mon, 10 Sep 2001 22:16:47 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: HELP: Capture a page?
Message-Id: <slrn9pqc49.vkq.tadmc@tadmc26.august.net>

Admin UsePad <spam@funnybytes.com> wrote:

>Ok than,.. could you tell me where to find that perl faq? 


On your very own hard drive somewhere. It is installed along
with perl itself.

If that doesn't work, try typing "Perl FAQ" into one of those
new-fangled search engine thingies.

But you don't even need the FAQ now, I already showed
you how to do it.


>and what's that
>special -q operator, 


   Did you try it?


(it is not an "operator", it is a "command line switch" for the
 perldoc program)


>is it quick?


No, it is not quick.

To learn how to use perldoc, type:

   perldoc perldoc


[snip Jeopardy quoted text. Please don't do that.]

-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 10 Sep 2001 15:28:58 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: HELP: Capture a page?
Message-Id: <3b9d3eaa@news.victoria.tc.ca>

Tad McClellan (tadmc@augustmail.com) wrote:
: Nigel Heinsius <Nigel_member@newsguy.com> wrote:

: >I hope someone can help me with this.
:         ^^^^^^^
: Too lazy to spend even 30 seconds trying to help yourself first?
: That's what it is going to look like to most of us...

: >Is it possible to capture a complete HTML page
:    perldoc -q HTML
:       "How do I fetch an HTML file?"

: You are expected to check the Perl FAQs *before* posting to the
: Perl newsgroup.

He said he had to "rebuild it using javascript".  Since it is very common
for a browser to depends on javascript to build the final displayed image,
I must assume that this is in fact what he wishes to do.

Please explain to us which part of the perl faq tells us how to render
javascript from within perl, because this would be useful to do and I seem
to have missed that part.


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

Date: Mon, 10 Sep 2001 22:16:02 GMT
From: "Denny Hardian" <delta1604@yahoo.com>
Subject: how to get the length of string
Message-Id: <CYan7.14713$Uf1.1292541@bgtnsc06-news.ops.worldnet.att.net>

Dear Perl Gurus,
I have a question on how to get the length of string in Perl. Is there any
command in Perl to do that or I have to do some trick in order to solve this
? Pls advise.

For example :

$a = "eat,run,sleep";

I want to know the length of $a ( how many chars ).  Should be 13 in this
case. Any idea ?

Thanks a lot for your help

Denny




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

Date: Mon, 10 Sep 2001 22:22:17 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: how to get the length of string
Message-Id: <slrn9pqcgl.vlr.tadmc@tadmc26.august.net>

Denny Hardian <delta1604@yahoo.com> wrote:

>I have a question on how to get the length of string in Perl. Is there any
                                     ^^^^^^
>command in Perl to do that


   perldoc -f length


>I want to know the length of $a ( how many chars ).
                    ^^^^^^

You have a self-answering question!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 11 Sep 2001 01:33:31 +0200
From: "Admin UsePad" <spam@funnybytes.com>
Subject: Re: how to get the length of string
Message-Id: <9njid7$95$1@news.hccnet.nl>

2 days ago,.. I was asking myself the same question,...
I tried something for the fun,..

$lenght = lenght($string);

It worked!

How do I get rid of this jeopardy quoted text? I'm using Outlook


"Tad McClellan" <tadmc@augustmail.com> schreef in bericht
news:slrn9pqcgl.vlr.tadmc@tadmc26.august.net...
> Denny Hardian <delta1604@yahoo.com> wrote:
>
> >I have a question on how to get the length of string in Perl. Is there
any
>                                      ^^^^^^
> >command in Perl to do that
>
>
>    perldoc -f length
>
>
> >I want to know the length of $a ( how many chars ).
>                     ^^^^^^
>
> You have a self-answering question!
>
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas




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

Date: Mon, 10 Sep 2001 16:50:03 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how to get the length of string
Message-Id: <3b9d51ab$1@news.microsoft.com>

"Admin UsePad" <spam@funnybytes.com> wrote in message
news:9njid7$95$1@news.hccnet.nl...
> How do I get rid of this jeopardy quoted text? I'm using Outlook

Same as with any other new client: use the DELETE key, Luke

Actually OE does the right thing. It places the cursor at the top, such that
while you are working your way down you can mark and delete those parts of
the original posting which are irrelevant for your answer. It's just that
most people don't make the effort to delete the junk parts in their replies.

jue




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

Date: 10 Sep 2001 16:07:02 +0000
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: how to get the length of string
Message-Id: <86elpfav2x.fsf@jon_ericson.jpl.nasa.gov>

"Admin UsePad" <spam@funnybytes.com> writes:

> 2 days ago,.. I was asking myself the same question,...
> I tried something for the fun,..
> 
> $lenght = lenght($string);
> 
> It worked!

I find that hard to believe:

  $ perl -e '$string="Hi!\n"; $lenght = lenght($string);print $lenght' 
  Undefined subroutine &main::lenght called at -e line 1.

The usual way to discover a feature in a programming language is to
consult the documentation.

> How do I get rid of this jeopardy quoted text? I'm using Outlook

I would imagine it would involve moving the cursor around, selecting
text to delete and deleting it.  Normally you should leave a bit of
context (like I did), so that people can pick up on a discussion part
way through (like I did).  If you put the quoted material before your
response (like I did) people can follow the discussion by simply
scrolling down the page.  How to reconfigure Outlook is off-topic for
this newsgroup and beyond my expertise.

Jon


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

Date: Tue, 11 Sep 2001 09:18:32 +0930
From: "Matthew Frick" <mfrick@chariot.net.au>
Subject: mysql connection.
Message-Id: <3b9d5072$1_6@news.chariot.net.au>

Can anyone give me a clue as to what I need to do to go about getting a
connection to a mysql db (on a lynix server) from an NT server?

Thanks in advance.

Matthew Frick.





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

Date: 11 Sep 2001 00:03:47 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: mysql connection.
Message-Id: <slrn9pql3g.2fv.damian@puma.qimr.edu.au>

Matthew Frick chose Tue, 11 Sep 2001 09:18:32 +0930 to say this:
>Can anyone give me a clue as to what I need to do to go about getting a
>connection to a mysql db (on a lynix server) from an NT server?

Since you are posting this to a Perl newsgroup, I assume you are trying to
do this with Perl? If this is the case, you need to go to www.cpan.org and
locate the MySQL DBD drivers, and the DBI module. If you are running
ActiveState perl, you might have an easier time finding these at
ActiveState's website. Once you have these installed, the documentation
(think `perldoc DBI`, `perldoc `DBD::mysql`) should be enough to get you
started.

If you are NOT trying to do this with Perl, then you should be asking
somehwere else. Hint: MySQL's website would be a good place to start.

Cheers,
Damian
-- 
@:=grep!(m!$/|#!..$|),split//,<DATA>;@;=0..$#:;while($:=@;){$;=rand
$:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,,
$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/}  __END__
Just another Perl Hacker, ### rev 3.3 -- stupidectomy performed :-)


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

Date: 10 Sep 2001 17:30:09 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: mysql connection.
Message-Id: <3b9d5b11@news.victoria.tc.ca>

Matthew Frick (mfrick@chariot.net.au) wrote:
: Can anyone give me a clue as to what I need to do to go about getting a
: connection to a mysql db (on a lynix server) from an NT server?

: Thanks in advance.

: Matthew Frick.

Assuming the mysql database already exists on the linux server, and you
are working on the NT, and connected to the internet...

	C:> ppm
	PPM interactive shell (1.1.1) - type 'help' for available commands.
	PPM> install DBD-mysql

(rest snipped)




--
Want to access the command line of your CGI account?  Need to debug your
installed CGI scripts?  Transfer and edit files right from your browser? 

What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgi


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

Date: Mon, 10 Sep 2001 22:48:50 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Problem with expect
Message-Id: <GJGy1E.MJs@news.boeing.com>

In article <9nis27$h6u$01$1@news.t-online.com>,
Ludmilla Markowska <ludmilla.markowska@gmx.net> wrote:
>Hi all,
>i have to write a perl script to add users to the IMAP-Server Cyrus. So i
>was told to use Expect.pm. After searching the web and deja for hours i
>can´t find a howto or explanation how to use it. Somebody can give me a
>hint/link where to learn a bit about using Perl and Expect.

Take a look here:

  http://search.cpan.org/doc/RGIERSIG/Expect-1.12/README

The README says the OS must be POSIX compliant ruling out
Win32 but there's been success with a Cgywin environment 
under Windows NT.

Once installed:

  perldoc Expect_Intro
  perldoc Expect

On Unix, there're example and tutorial directories distributed 
with the source too.


--
Charles DeRykus


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

Date: Mon, 10 Sep 2001 22:05:23 GMT
From: friedman@math.utexas.edu (Chas Friedman)
Subject: Re: Problems with sample modules from a book
Message-Id: <3b9d36ae.4141497@news.itouch.net>

On Mon, 10 Sep 2001 18:58:38 GMT, "Mark Riehl"
<mark.riehl@agilecommunications.com> wrote:

>All - I'm on Win2k and I'm trying to work through some of the examples in
>Lincoln Stein's Perl Network Programming  book.  The samples come with
>modules, and install script.  Everything installed w/o any errors.
>
>When I try to run the sample server, I get the following error:
>
>perl eliza_select.pl
>Can't locate Chatbot/Eliza.pm in @INC (@INC contains: C:/Perl/lib
>C:/Perl/siib .) at C:/Perl/site/lib/Chatbot/Eliza/Polite.pm line 2.
What is C:/Perl/siib?
>BEGIN failed--compilation aborted at
>C:/Perl/site/lib/Chatbot/Eliza/Polite.pne 2.
What is Polite.pne?
>Compilation failed in require at eliza_select.pl line 7.
>BEGIN failed--compilation aborted at eliza_select.pl line 7.
>
>The following directories were created:
>
>c:\Perl\site\lib\Chatbot\Eliza, and the Eliza directory contains the
>following modules: Polite.pm and Server.pm.
>
>Any suggestions?
>
>Thanks,
>Mark
>
>
>
You could try putting:
use lib 'C:/Perl/site/lib'; at the beginning of your script.
(Sometimes double quotes work better on Windows - try
that also.)
If that doesn't work, you could also try putting statements like:
use Chatbot::Eliza;
after the above use lib statement.
                        chas


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

Date: Tue, 11 Sep 2001 09:07:57 +0930
From: Luke Vanderfluit <luke@chipcity.com.au>
Subject: start a script when a process exits
Message-Id: <3B9D4ED4.961E9E1@chipcity.com.au>

Hi,

I want to start a script when a program terminates (triggered by the
program exiting).
more specifically:
I am running linux. I have a prgram called wvdial that connects me to
the internet.
when it exits, I want to run a script (perl or other) that I have
written.

How do I get the exit of a process to trigger another process to run?
Can it be done in perl?

Thanks,
--
                           Lo que ves es lo que obtienes

                           Luke Vanderfluit
 [if no image, click here]
                           Phone 61 8 8556 6112

                           Aldinga Beach, South Australia





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

Date: 10 Sep 2001 23:50:58 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: start a script when a process exits
Message-Id: <slrn9pqkbg.2fv.damian@puma.qimr.edu.au>

Luke Vanderfluit chose Tue, 11 Sep 2001 09:07:57 +0930 to say this:
>...
>I am running linux. I have a prgram called wvdial that connects me to
>the internet.
>when it exits, I want to run a script (perl or other) that I have
>written.
>
>How do I get the exit of a process to trigger another process to run?
>Can it be done in perl?
>

Wrap your call to the program in the script with a system() call, which
waits for the former to complete before going on:

#!/path/to/perl -w
use strict;

system('wvdial'); ### might want to check the return status, too

#
# do other stuff here
#

__END__

Cheers,
Damian
-- 
@:=grep!(m!$/|#!..$|),split//,<DATA>;@;=0..$#:;while($:=@;){$;=rand
$:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,,
$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/}  __END__
Just another Perl Hacker, ### rev 3.3 -- stupidectomy performed :-)


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

Date: 10 Sep 2001 16:20:30 +0000
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: start a script when a process exits
Message-Id: <86ae03augh.fsf@jon_ericson.jpl.nasa.gov>

Luke Vanderfluit <luke@chipcity.com.au> writes:

> I want to start a script when a program terminates (triggered by the
> program exiting).  more specifically: I am running linux. I have a
> prgram called wvdial that connects me to the internet.  when it
> exits, I want to run a script (perl or other) that I have written.

Maybe there's an easier way to solve your problem.  Perhaps you can
have your script call the program that needs to be run first in before
it does anythings else.  For instance near the top of the script you
could have a line such as:

  system "wvdial";

Read perldoc -f system for more information.  Don't forget to check
the exit status (in $?) before you do anything else.

Jon


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

Date: 10 Sep 2001 17:38:08 -0700
From: niting@onebox.com (Nitin G.)
Subject: Verify https communication
Message-Id: <f87cbf2f.0109101638.4aad30ae@posting.google.com>

Hi,

This might sound like a dumb question but how do I confirm that a
script that I have to do POST requests to a HTTPS server is actually
encrypting the data before transferring it? I don't have any problems
with the script itself, everything is working as desired.

-Nitin


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

Date: 10 Sep 2001 17:54:05 -0700
From: soosterh@my-deja.com (so)
Subject: Re: Warning on adding hash element
Message-Id: <db6cb1f3.0109101654.72c7b7d7@posting.google.com>

soosterh@my-deja.com (so) wrote in message news:<db6cb1f3.0109100737.3f0726e1@posting.google.com>...
> Hello all:
> 
> I have a subroutine that accepts a reference to a hash.
> Now I want to add an element to that hash.
> The following line does actually work, but with 
> use strict enabled I get a warning...
> 
> $hash_ref->{ 'subHash' } = { -option1=>'val1', -option2=>'val2' };
> 
> produces...
> Use of uninitialized value at (eval 11) line 17.
[rest snipped]

Sorry to reply to my own post, but I found the solution myself.
Tad McClellan was correct that line of code is actually correct.
What I was actually doing was this...
$sInfo->{ '-script' } = {-language=>'javascript',-src=>'/macros_so.js' };
print start_html( $sInfo ), "\n";

I found I could easily fix the warning by changing '-script' to
something else (ie. '-foo' ).  So my guess is that inside of the
CGI module's start_html() there is some dependency that an other
element is defined for the '-script' subHash, and the function
actually then blindly dereferences that element.

Now why exactly the warning showed up in my script and not in the module
I have no clue -- perhaps they have an error handler that passes errors
up the stack ?

SammyO


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

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

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 V10 Issue 1728
***************************************


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