[17333] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4755 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 29 11:05:25 2000

Date: Sun, 29 Oct 2000 08:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972835509-v9-i4755@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 29 Oct 2000     Volume: 9 Number: 4755

Today's topics:
    Re: #perl on EFnet <crud_alex@yahoo.com>
        Arcane Serial Question <asquith@macconnect.com>
    Re: CGI Errors - Please Help <gellyfish@gellyfish.com>
    Re: CGI Errors - Please Help <mtaylorlrim@my-deja.com>
    Re: CGI.pm + exec = error nobull@mail.com
    Re: Detecting socket closure (Garry Williams)
        even or odd ? (Billy)
    Re: even or odd ? <adamf@box43.gnet.pl>
    Re: even or odd ? (Tad McClellan)
    Re: even or odd ? <not.my.real.email@bellglobal.com>
    Re: even or odd ? (Garry Williams)
    Re: func (a) func !a! func ~a~ func a .... more? <ren.maddox@tivoli.com>
    Re: How to call a perl script from HTML <Bill@net.com>
    Re: How to call a perl script from HTML <flavell@mail.cern.ch>
    Re: How to call a perl script from HTML (Tad McClellan)
    Re: How to call a perl script from HTML (Steve)
    Re: Installing HTML module <gellyfish@gellyfish.com>
    Re: Keyboard IO? <rsm@loop.com>
    Re: Lienes disappearing when reading from file <fb@ltec.ch>
    Re: Lienes disappearing when reading from file (Tad McClellan)
        Multi process under windows NT nir_y@my-deja.com
    Re: Multi process under windows NT <carvdawg@patriot.net>
    Re: Perl: ICQ Checker (Tony L. Svanstrom)
    Re: regex help <adamf@box43.gnet.pl>
    Re: regex help <krahnj@acm.org>
    Re: regex help <jason99992000@yahoo.com>
    Re: regex help <adamf@box43.gnet.pl>
    Re: regex help <jason99992000@yahoo.com>
    Re: regex help (Tad McClellan)
    Re: regex help <adamf@box43.gnet.pl>
    Re: regex help <adamf@box43.gnet.pl>
    Re: Sending mails from a Unix webserver <gellyfish@gellyfish.com>
    Re: Set path to perl.exe for Win 98 se <harrisr@bignet.net>
        Sorry test (Mounter)
    Re: Sorry test <gellyfish@gellyfish.com>
    Re: Sorry test (Tad McClellan)
    Re: Unpack tamplate <abe@ztreet.demon.nl>
    Re: what does /warn "$x" if "$x"/ mean (Tad McClellan)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 29 Oct 2000 19:08:15 +0800
From: "­»´ä¸}" <crud_alex@yahoo.com>
Subject: Re: #perl on EFnet
Message-Id: <8th0hj$7pb$1@imsp026.netvigator.com>

how do i get there?i'm newbie of irc

David Wall <darkon@one.net> wrote in message
news:8FDAD2FB1darkononenet@206.112.192.118...
: wescott@conterra.com (Mike Wescott) wrote in
: <osbsw7huhv.fsf@eriadne.sc.rr.com>:
:
: >It seems that #perl on EFnet has become "invite only". Why is that?
: >Not that I was a very frequent lurker, but on occasion it could
: >be instructive.
:
: I was wondering about that, too, and for the same reason.  I don't drop in
: there very often either, but I did pick up some useful bits of information
: on occasion.  I'm glad you said something, as I was considering posting a
: question myself.
:
: --
: David Wall
: darkon@one.net




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

Date: Sun, 29 Oct 2000 07:43:36 -0600
From: "Asquith" <asquith@macconnect.com>
Subject: Arcane Serial Question
Message-Id: <8th9i60n9@enews2.newsguy.com>

Looking for help talking to a Campbell Scientific Data logger through the 
serial port using Perl.  Linux preferred but Win32 ok too.  Is there an
chance that some has already done so?

Thanks,
-wha


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

Date: 29 Oct 2000 10:55:43 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI Errors - Please Help
Message-Id: <8tgvnf$k65$1@orpheus.gellyfish.com>

On Sun, 29 Oct 2000 04:39:24 GMT spicenews@my-deja.com wrote:
> Hi! I am only 14 and need some help trying to fix
> this thing. Please go to:
> http://thecgipath.hypermart.net/products/s_hsf.htm
> l - Read what the script is about, then download
> it. I use a server at http://www.chilliseeds.com
> and it doesn't work for me. See if it works for
> you. Please tell me what you did to get it to
> work! All I have done is uploaded it, I have made
> NO changes. If that's the problem (I am sure it
> is) What are the changes I have to make? It might
> help if you upload the script to your own server
> to correct things and test it. Any
> answers/replies would be GREATLY appreciated!
> Thankyou
> 

Firstly the page referred returns a 404 status - it isnt there,
secondly I really think that you should make an effort to debug the
program yourself,  It would be more helpful if you could supply us with
the error message thqat you get and the smallest piece of the code that
appears to be failing.   I think that you might want check out the item
in perlfaq9 entitled:

       My CGI script runs from the command line but not the
       browser.   (500 Server Error)

Which can be found with :

  perldoc -q 500


/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 29 Oct 2000 11:41:37 GMT
From: Mark <mtaylorlrim@my-deja.com>
Subject: Re: CGI Errors - Please Help
Message-Id: <8th2dh$bdd$1@nnrp1.deja.com>

In article <8tg9ls$qn6$1@nnrp1.deja.com>,
  spicenews@my-deja.com wrote:
> Hi! I am only 14 and need some help trying to fix
> this thing. Please go to:
> http://thecgipath.hypermart.net/products/s_hsf.htm

<snip>

A couple of things could be wrong.  First, you always need to check the
first line of a script for the location to perl. Perl is in differing
locations on different distributions and the first line of a script
must match the location of perl on the web server.  Find the location
of perl and check the line.

Second, the script requires SSI to work on your web server. Does other
SSI work?

These things take some technical expertise, possibly command line
access, and maybe even some configuration changes to the web server
itself. If you cannot do this on your own do you know the server
administrator? He may be willing to assist, but dont count on it.

Mark

--
Please reply to this newsgroup as my Deja mail
is used as a spam catcher only!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 29 Oct 2000 13:57:47 +0000
From: nobull@mail.com
Subject: Re: CGI.pm + exec = error
Message-Id: <u9vgub4un8.fsf@wcl-l.bham.ac.uk>

andre_sanchez@my-deja.com writes:

> I have two CGI scripts, tester.pl and testee.pl listed below, that I
> wish to have interact via the exec function.

Stop right there.  CGI script is designed to be called by a HTTP
server.  Wishing to exec() one CGI script from another is a silly
thing to wish.  Stop wishing this and your problem will go away.

If you really want a Perl script (CGI or otherwise) to call a CGI
script (Perl or otherwise) then use LWP to send a request to the HTTP
server.

If you want a Perl script that is to be called other than by a HTTP
server then don't make it try to use the CGI API.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sun, 29 Oct 2000 13:33:18 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Detecting socket closure
Message-Id: <yGVK5.207$ap4.8330@eagle.america.net>

On Sun, 29 Oct 2000 04:39:45 GMT, Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "GW" == Garry Williams <garry@ifr.zvolve.net> writes:
>
 ...
>  GW> blocking in a <$socket>.  The server cannot produce a reply
>  GW> immediately, but will be able to in the future so it calls
>  GW> pause().  Certain events cause the server to be signaled.  It is
 ...
>
>what is pause? not a standard perl function that i have ever seen.

Sorry.  POSIX::pause().  

>  GW> How can the server discover that the client interrupted the
>  GW> blocking read and then closed the socket (exited)?  I have tried
>  GW> using select(), but it always returns that the socket can_write,
>  GW> even when the client closed and exited long ago.
>
>you always have a socket checked for reading. that is the way to detect
>closed sockets. 

You said that before.  I just didn't listen :-).  It didn't occur to
me to read a socket that I expected to write to.  

>read perlipc for more on this. also the unix man pages
>on read have plenty on detecting closed sockets and pipes.

Thank you.  The manual page on read(2) does give the answer.  

>and use IO::Select or Event.pm for this stuff. it will save you a ton of
>work.

Yes, I was experimenting to find out how to detect the close.  Now
that I understand it, I think all I need is O_NONBLOCK and a check of
the return code from sysread() (defined and 0 indicates EOF).  

-- 
Garry Williams


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

Date: Sun, 29 Oct 2000 12:12:47 GMT
From: NOSPAM.billy@easynet.be (Billy)
Subject: even or odd ?
Message-Id: <39fc1359.100122189@news.easynet.be>

Hello !

Does an instruction exist which can test if an number is odd (eg 1, 3,
5, ...) or even (eg 2, 4, 6, 8, ...) ?

I hope that this question is understoodable, sorry for the english.


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

Date: Sun, 29 Oct 2000 14:54:21 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: even or odd ?
Message-Id: <39FC2C0D.4C31@box43.gnet.pl>

Billy wrote:
> 
> Hello !
> 
> Does an instruction exist which can test if an number is odd (eg 1, 3,
> 5, ...) or even (eg 2, 4, 6, 8, ...) ?

oh do not be kidding ;).
it is not an instruction but an operator:

my $number;

if ( $number % 2 ) {
  print "$number is odd";
} else {
  print "$number is even";
}

and read the basics of Perl operators in:
# perldoc perlop

--
Adam.


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

Date: Sun, 29 Oct 2000 07:23:34 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: even or odd ?
Message-Id: <slrn8vo5m6.vl.tadmc@magna.metronet.com>

On Sun, 29 Oct 2000 12:12:47 GMT, Billy <NOSPAM.billy@easynet.be> wrote:


>Does an instruction exist which can test if an number is odd (eg 1, 3,
>5, ...) or even (eg 2, 4, 6, 8, ...) ?

------------------
#!/usr/bin/perl -w
use strict;

foreach ( 0 .. 9 ) {
   if ( $_ % 2)               # perlop.pod describes the modulus operator
      { print "$_ is odd\n" }
   else
      { print "$_ is even\n" }
}
------------------


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


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

Date: Sun, 29 Oct 2000 14:17:54 GMT
From: "MNJP" <not.my.real.email@bellglobal.com>
Subject: Re: even or odd ?
Message-Id: <mkWK5.392093$Gh.12241068@news20.bellglobal.com>


Or the old way

$num = "4";

$result = ( ($num / 2) == int($num / 2) ) ? "EVEN" : "ODD";

print $result;

"Adam" <adamf@box43.gnet.pl> wrote in message
news:39FC2C0D.4C31@box43.gnet.pl...
> Billy wrote:
> >
> > Hello !
> >
> > Does an instruction exist which can test if an number is odd (eg 1, 3,
> > 5, ...) or even (eg 2, 4, 6, 8, ...) ?
>
> oh do not be kidding ;).
> it is not an instruction but an operator:
>
> my $number;
>
> if ( $number % 2 ) {
>   print "$number is odd";
> } else {
>   print "$number is even";
> }
>
> and read the basics of Perl operators in:
> # perldoc perlop
>
> --
> Adam.




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

Date: Sun, 29 Oct 2000 15:12:18 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: even or odd ?
Message-Id: <m7XK5.223$ap4.8818@eagle.america.net>

On Sun, 29 Oct 2000 12:12:47 GMT, Billy <NOSPAM.billy@easynet.be> wrote:
>Hello !
>
>Does an instruction exist which can test if an number is odd (eg 1, 3,
>5, ...) or even (eg 2, 4, 6, 8, ...) ?
>
>I hope that this question is understoodable, sorry for the english.

    perl -wle 'print 1 & shift() ? "odd" : "even"'

-- 
Garry Williams


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

Date: 29 Oct 2000 00:04:25 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: func (a) func !a! func ~a~ func a .... more?
Message-Id: <m3itqcp7ae.fsf@dhcp11-177.support.tivoli.com>

Uri Guttman <uri@sysarch.com> writes:

> >>>>> "DB" == Dave Brondsema <brondsem@my-deja.com> writes:
> 
>   DB> print qq(1);
>   DB> print qq~2~;
>   DB> print qq!3!;
>   DB> print qq/4/;
> 
>   >> those are double quoted strings and not regexes. which book or
>   DB> education
>   >> source is leading you to these false beliefs?
> 
>   DB> The title "Regexp Quote-Like Operators" from perlop
> 
> that section never mentions qq. show the section and the quote which
> says those forms are all regular expression when none of them are.

Unfortunately, it does:

       Regexp Quote-Like Operators

       Here are the quote-like operators that apply to pattern
       matching and related activities.

       ?PATTERN?
 ...
       m/PATTERN/cgimosx

       /PATTERN/cgimosx
 ...
       q/STRING/

       `'STRING''
 ...
       qq/STRING/

       ""STRING""
 ...

       qr/STRING/imosx
 ...
       qx/STRING/

       `STRING`
 ...
       qw/STRING/
 ...
       s/PATTERN/REPLACEMENT/egimosx
 ...
       tr/SEARCHLIST/REPLACEMENTLIST/cdsUC

       y/SEARCHLIST/REPLACEMENTLIST/cdsUC
 ...


Not only is there no intervening title, the fact that s/// and tr///
are later in the list (alphabetical) indicates that it isn't just a
case of a missing section title.  Putting all of these together does
make sense, bug titling the section "Regexp Quote-Like Operators" is
unfortunate.  It should probably be something along the lines of
"Quote and Quote-like Operators" or "Quote and Quote-like Regexp
Operators".  Or even simply "Quote Operators", though that may be a
stretch for tr/// (or maybe not -- tr/// quotes pretty much the same
way that q// does, and q// is certainly a quote operator).

-- 
Ren Maddox
ren@tivoli.com


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

Date: Sun, 29 Oct 2000 06:08:30 -0500
From: "Bill" <Bill@net.com>
Subject: Re: How to call a perl script from HTML
Message-Id: <39fc049b_2@news.newsfeeds.com>


> You mean like:
> <a
>
href="/cgi-bin/myfile.pl?firstvalue=something&secondvalue=something">Execute
> the script!</a>
> Is that what you wanted?

Yes, that's it exactly.

href="/cgi-bin/myfile.pl"

When I do that it simply dispalys the perl program.

Thanks




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Sun, 29 Oct 2000 13:00:28 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to call a perl script from HTML
Message-Id: <Pine.GHP.4.21.0010291258240.27164-100000@hpplus03.cern.ch>

On 28 Oct 2000, kevin metcalf wrote:

> You mean like:
> <a
> href="/cgi-bin/myfile.pl?firstvalue=something&secondvalue=something">Execute
> the script!</a>

Invalid HTML syntax.  As any proper validator would tell you.

> Is that what you wanted? 

Hope not.

http://ppewww.ph.gla.ac.uk/~flavell/www/formgetbyurl.html

> A little more info might get you a better response.

Is that a promise?  ;-)




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

Date: Sun, 29 Oct 2000 07:25:52 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to call a perl script from HTML
Message-Id: <slrn8vo5qg.vl.tadmc@magna.metronet.com>

On Sun, 29 Oct 2000 06:08:30 -0500, Bill <Bill@net.com> wrote:
>
>> You mean like:
>> <a
>>
>href="/cgi-bin/myfile.pl?firstvalue=something&secondvalue=something">Execute
>> the script!</a>
>> Is that what you wanted?
>
>Yes, that's it exactly.


Then you don't have a Perl problem.

The URL would look the same regardless of what language the
program was written in.


>href="/cgi-bin/myfile.pl"
>
>When I do that it simply dispalys the perl program.


You have a CGI/server setup question.

Please ask those in a CGI/server newsgroup:

      comp.infosystems.www.authoring.cgi
      comp.infosystems.www.servers.mac
      comp.infosystems.www.servers.misc
      comp.infosystems.www.servers.ms-windows
      comp.infosystems.www.servers.unix


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


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

Date: 29 Oct 2000 15:43:59 GMT
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: How to call a perl script from HTML
Message-Id: <slrn8vodha.8in.steve@zero-pps.localdomain>

On Sun, 29 Oct 2000 06:08:30 -0500, Bill wrote:
>
>> You mean like:
>> <a
>>
>href="/cgi-bin/myfile.pl?firstvalue=something&secondvalue=something">Execute
>> the script!</a>
>> Is that what you wanted?
>
>Yes, that's it exactly.
>
>href="/cgi-bin/myfile.pl"
>
>When I do that it simply dispalys the perl program.

The perl script needs to be somewhere where it can be executed (ae
set in httpd.conf), and the file type has to be set as world
executable.

-- 
Cheers
Steve              email mailto:steve@zeropps.uklinux.net

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

  1:48pm  up 18 days, 16:09,  3 users,  load average: 1.03, 1.04, 1.01


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

Date: 29 Oct 2000 12:27:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Installing HTML module
Message-Id: <8th52n$la7$1@orpheus.gellyfish.com>

On Sat, 28 Oct 2000 14:08:59 GMT 0149@my-deja.com wrote:
> I downloaded the HTML module 0.6 from cpan.org. How do I install it?
> (There is no Makefile.PL)
> 

There should be a README file that describes the installation.  Anyhow
I dont think there is *a* HTML module there are loads and loads of
HTML::* modules though perhaps you could be more specific ?

/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 29 Oct 2000 07:53:26 -0800
From: Bob Margulies <rsm@loop.com>
Subject: Re: Keyboard IO?
Message-Id: <39FC47F6.C909B7A1@loop.com>

I'm sorry that Gwyn was shocked, and I'm glad that Jason chimed in. I
was a little shocked myself when I tried their suggestion which, BTW, I
had already tried. It still didn't work. 

Then I got a bright idea. I was running perl from inside a batch file.
What if I ran perl from the command line? Tried it - it worked. I
suppose there's a reason why.

So thanks, guys. Ah, the perils of newbiehood!

jason wrote:
> 
> Gwyn Judd wrote ..
> >I was shocked! How could Bob Margulies <rsm@loop.com>
> >say such a terrible thing:
> >>I have searched as many FAQs as I could find, but no simple answer comes
> >>up. I am running perl from (don't laugh) DOS on a PC. What I want to do
> >>is issue a prompt for input, read a line of text from the keyboard,
> >>terminate it with "Enter", and then proceed to do something with the
> >>input.
> >>
> >>I can do that in a bunch of other languages, but perl has me stumped.
> >>AFAK, there's nothing in the Camel or Llama books. Am I wrong? Why is it
> >>so mysterious? And most of all, how do I do it?
> >
> >It's hardly mysterious. You use the diamond operator '<>' to read a
> >line* of text from a file. If you leave out the actual filehandle
> >argument then it reads from STDIN:
> >
> >$line = <STDIN>; # is the same as $line = <>;
> 
> oops .. these two are only the same when there are no command-line
> arguments .. if there are command-line arguments then those are treated
> as filenames and opened and read from with <> (but not with <STDIN>)
> 
> --
>   jason -- elephant@squirrelgroup.com --


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

Date: Sun, 29 Oct 2000 12:27:59 +0100
From: "Felix Brack" <fb@ltec.ch>
Subject: Re: Lienes disappearing when reading from file
Message-Id: <39fc0afd@news.datacomm.ch>

Well, this seems to be a difficult problem. The script I posted
is ok and now also runs on my IIS (NT4.0 SP6). Now, here is
the problem: one of my first versions of the script was wrong.
After correcting it, I did not realize, that the script (a .pl) file
was cached (!), either by the IIS or one of my local browser.
That's way my changes to the script did not show any improvement !

I still have that problem with the cache (IE and Navigator). I
always have to clear the cache several times, shutdown and restart
the browser, until the cache seems to be empty and my new Perl
script is loaded.
Is there any possibility to prevent a browser from caching any or
special files? I would like to tell the browser to reload all scripts,
i.e. do not cache them. Or is there a possibility to code something
in a Purl script so it always reloaded from disk when called ?

Any help would be appreciated ! Many thanks, Felix

--
-----------------------------------
Felix Brack
LTEC AG
Dorfgasse 10
CH-4435 Niederdorf
SWITZERLAND
Internet: http://www.ltec.ch

Tel. +41 61 963 14 14
Fax. +41 61 963 14 13
E-Mail: fb@ltec.ch
"Felix Brack" <fb@ltec.ch> wrote in message
news:39f559db@news.datacomm.ch...
> I wrote the following small script:
>
> $next_fn = "form_step_2.html";
>
> open NEXT_STEP, $next_fn or die;
>
> while (<NEXT_STEP>) {
>  if ($_ =~ /<!-- field_inclusion_start -->/) {
>   print $`;
>   print $&;
>   print "\n<!-- mark should be above -->";
>   print $';
>  }
>  else {
>   print $_;
>  }
> }
>
> close NEXT_STEP;
>
> I think this script should read the input file line by line
> and copy it to stdout, if the pattern "<!-- field_inclusion_start -->"
> is not found. The file "form_step_2.html" contains simple html
> code. The script works fine, but it does not copy the first tag (which
> is "<html>") from the source file to stdout. The copy operation
> seems to start with the "<head>" tag from the html file instead.
>
> What am I doing wrong ?
>
> Many thanks, Felix
> --
> -----------------------------------
> Felix Brack
> LTEC AG
> Dorfgasse 10
> CH-4435 Niederdorf
> SWITZERLAND
> Internet: http://www.ltec.ch
>
> Tel. +41 61 963 14 14
> Fax. +41 61 963 14 13
> E-Mail: fb@ltec.ch
>
>




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

Date: Sun, 29 Oct 2000 07:30:38 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Lienes disappearing when reading from file
Message-Id: <slrn8vo63e.vl.tadmc@magna.metronet.com>

On Sun, 29 Oct 2000 12:27:59 +0100, Felix Brack <fb@ltec.ch> wrote:

>Well, this seems to be a difficult problem. 


Made more difficult by a profound misunderstanding of how
this technology works...


>After correcting it, I did not realize, that the script (a .pl) file
>was cached (!), either by the IIS or one of my local browser.
                                                      ^^^^^^^

>I would like to tell the browser to reload all scripts,
                          ^^^^^^^      ^^^^     ^^^^^^


CGI programs do not run on a browser.

They run on the server.

The browser is nothing more than the input/output device. All
the processing happens on the server machine.


(though the browser may be caching the _output_ of your CGI program)


>i.e. do not cache them. Or is there a possibility to code something
>in a Purl script so it always reloaded from disk when called ?


I dunno, you should ask Purl questions in a Purl newsgroup.  :-)


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


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

Date: Sun, 29 Oct 2000 10:57:17 GMT
From: nir_y@my-deja.com
Subject: Multi process under windows NT
Message-Id: <8tgvqc$9sr$1@nnrp1.deja.com>

I would like to build a multi process server under Windows NT platform,
I would the server to fork another process when a client is iniatines a
connection.
Unfortunately fork() is not supported for Perl platforms under windows
NT platform.
Is there any way I can overcome this annoying problem ?
Help appreciated.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 29 Oct 2000 06:32:34 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: Multi process under windows NT
Message-Id: <39FC0AD2.B01B673F@patriot.net>

> Unfortunately fork() is not supported for Perl platforms under windows
> NT platform.
> Is there any way I can overcome this annoying problem ?

Yes...get ActiveState's ActivePerl 5.6 (build 61x)...fork() is supported.



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

Date: Sun, 29 Oct 2000 15:09:31 GMT
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Perl: ICQ Checker
Message-Id: <1ej9u57.1lbztvduiqcl6N%tony@svanstrom.com>

Teemu Oksanen <teemu.oksanen@luukku.com> wrote:

> > But why do you want such a thing when ICQ has its own tool for it?
> 
> Because I need that information as text. Not as picture! Sorry... =)

Just get it directly from the webpage at ICQs own servers and you can
get the information directly from the webpage (at least you used to be
able to do that). If you can't do that then just download the picture
and check if it is the picture that says on or offline by comparing it
to known on- and offline pictures.


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Sun, 29 Oct 2000 12:52:24 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: regex help
Message-Id: <39FC0F78.4A2D@box43.gnet.pl>

Jason Chung wrote:
> 
> I need some help with regex.
> Kindly point it out to me if it's in the faqs cos I couldn't find it.
> 
> $delimiter = "|";
> $mystring = "aaaaaa" . $delimiter . "bbbbbbb" . $delimiter . "cccccccc";
> 
> I'm trying to get the last part of the string (b4 the delimiter) from
> $mystring (ie. cccccccc).

sure it is in the documentation:
# perldoc perlre

in general you would use the split function but in your case
with RE it is easier, and (I think) more efficient.

you can use something like this:
my ($the_last) = $mystring =~ /\|([^\|]*)$/;

--
Adam.


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

Date: Sun, 29 Oct 2000 04:17:31 -0800
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: regex help
Message-Id: <39FC155B.B410E935@acm.org>

Jason Chung wrote:
> 
> I need some help with regex.
> Kindly point it out to me if it's in the faqs cos I couldn't find it.
> 
> $delimiter = "|";
> $mystring = "aaaaaa" . $delimiter . "bbbbbbb" . $delimiter . "cccccccc";
> 
> I'm trying to get the last part of the string (b4 the delimiter) from
> $mystring (ie. cccccccc).
> 
> How do I accomplish that with regex?

$lastpartofthestring = (split /\|/, $mystring)[-1]
                              ^^^^
                            Regex here

HTH

John


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

Date: Sun, 29 Oct 2000 20:31:06 +0800
From: "Jason Chung" <jason99992000@yahoo.com>
Subject: Re: regex help
Message-Id: <8th59p$c35$1@dahlia.singnet.com.sg>

I forgot to mention that there could be n number of delimiters 
within the string and the regex must include a match for 
$delimiter rather than "|". This will allow me to change $delimiter to 
anything I like.

I did look at perlre b4 I posted but couldn't find anything + I'm confused.

Any pointers? 



In article <39FC0F78.4A2D@box43.gnet.pl>, Adam <adamf@box43.gnet.pl>
wrote:
> Jason Chung wrote:
>> 
>> I need some help with regex. Kindly point it out to me if it's in the
>> faqs cos I couldn't find it.
>> 
>> $delimiter = "|";
>> $mystring = "aaaaaa" . $delimiter . "bbbbbbb" . $delimiter .
>> "cccccccc";
>> 
>> I'm trying to get the last part of the string (b4 the delimiter) from
>> $mystring (ie. cccccccc).
> 
> sure it is in the documentation:
> # perldoc perlre
> 
> in general you would use the split function but in your case with RE it
> is easier, and (I think) more efficient.
> 
> you can use something like this: my ($the_last) = $mystring =~
> /\|([^\|]*)$/;
> 
> --
> Adam.




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

Date: Sun, 29 Oct 2000 14:16:46 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: regex help
Message-Id: <39FC233E.2B46@box43.gnet.pl>

Jason Chung wrote:
> 
> I forgot to mention that there could be n number of delimiters
> within the string and the regex must include a match for
> $delimiter rather than "|". This will allow me to change $delimiter to
> anything I like.

my ($the_last) = $mystring =~ /\|([^\|]*)$/;
will work in case of n subsequent pipes.

and for an arbitrary delimiter try this:
my ($the_last) = $mystring =~ /\Q$delimiter\E([^\Q$delimiter\E]*)$/;

HTH
--
Adam.


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

Date: Sun, 29 Oct 2000 21:54:12 +0800
From: "Jason Chung" <jason99992000@yahoo.com>
Subject: Re: regex help
Message-Id: <8tha5i$vsf$1@violet.singnet.com.sg>

Ok, it wasn't giving me what I wanted initially b'cos I did not 
initialize $the_last (ie. should have used my($the_last) in my 
test script).

Much appreciated.

Cheers!

In article <39FC233E.2B46@box43.gnet.pl>, Adam <adamf@box43.gnet.pl>
wrote:
> Jason Chung wrote:
>> 
>> I forgot to mention that there could be n number of delimiters within
>> the string and the regex must include a match for
>> $delimiter rather than "|". This will allow me to change $delimiter to
>> anything I like.
> 
> my ($the_last) = $mystring =~ /\|([^\|]*)$/; will work in case of n
> subsequent pipes.
> 
> and for an arbitrary delimiter try this: my ($the_last) = $mystring =~
> /\Q$delimiter\E([^\Q$delimiter\E]*)$/;
> 
> HTH
> --
> Adam.




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

Date: Sun, 29 Oct 2000 07:20:38 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: regex help
Message-Id: <slrn8vo5gm.vl.tadmc@magna.metronet.com>

On Sun, 29 Oct 2000 12:52:24 +0100, Adam <adamf@box43.gnet.pl> wrote:
>Jason Chung wrote:
>> 
>> I need some help with regex.
>> 
>> $delimiter = "|";
    ^^^^^^^^^

That is a very poor variable name, as it is not a delimiter.

$separator = '|';   # it is a separator, not a delimiter

A "delimiter" marks the "limits" (ie. both ends) of something.

So a | delimited string would look like:

   '|aaaaaa||bbbbbbb||cccccccc|'

where it marks the start and the end of a field.


>> $mystring = "aaaaaa" . $delimiter . "bbbbbbb" . $delimiter . "cccccccc";
>> 
>> I'm trying to get the last part of the string (b4 the delimiter) from
>> $mystring (ie. cccccccc).


>you can use something like this:
>my ($the_last) = $mystring =~ /\|([^\|]*)$/;
                                ^^   ^
                                ^^   ^

Those characters are not necesary.

| is not special in a character class, so it does not need to be escaped.

Since you have an end-of-string anchor, you don't need to match
a | either.


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


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

Date: Sun, 29 Oct 2000 15:30:07 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: regex help
Message-Id: <39FC346F.557B@box43.gnet.pl>

Jason Chung wrote:
> 
> Ok, it wasn't giving me what I wanted initially b'cos I did not
> initialize $the_last (ie. should have used my($the_last) in my
> test script).

now i am not sure what your problem is... :(
but if you really do not want the $the_last scalar (i do not know why)
you can of course replace the original with the last element:
$mystring =~ s/.*\Q$delimiter\E([^\Q$delimiter\E]*)$/$1/;

but this is just a play with RE ;).
i strongly recomend you studying of perlre (once again ;)
and perlfunc as well.

--
good luck,
Adam.


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

Date: Sun, 29 Oct 2000 16:41:18 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: regex help
Message-Id: <39FC451E.B68@box43.gnet.pl>

Tad McClellan wrote:
> 
 ...
> 
> >you can use something like this:
> >my ($the_last) = $mystring =~ /\|([^\|]*)$/;
>                                 ^^   ^
>                                 ^^   ^
> 
> Those characters are not necesary.

of course i agree. just a silly redundancy.
thanks Tad.

--
Adam.


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

Date: 29 Oct 2000 12:38:43 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sending mails from a Unix webserver
Message-Id: <8th5oj$leh$1@orpheus.gellyfish.com>

On Sat, 28 Oct 2000 22:21:07 +0100 Geoff Soper wrote:
> I'm starting to think about building a mailing list system. I intend it to
> be a CGI application running on a Unix webserver running Apache. I see the
> part of the FAQ entitled 'How do I send mail?'. This seems simple enough,
> is it a good way to send this sort of quantity (<1000) of message? The
> messages will all be the same and will be sent to a certain subset of a
> larger number of addresses.

That FAQ item references several ways of sending mail - I assume that you
mean the use of sendmail.

Running a mailing list as a CGI program seems far from ideal to me as it 
will require some intervention to cause the mailing to be done.  I read
that you have discounted the use of majordomo but that doesnt preclude the
downloading of the source so you can examine how it does what it does.

> Also it says the -odq part means the message get put into the queue as
> opposed to being delivered directly, what is this queue?
> 

The mail is queued and the queue is processed at some predtermined interval.
You will want consult the sendmail documentation and possibly the groups
that discuss sendmail.

/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 29 Oct 2000 10:03:40 -0500
From: "Randy Harris" <harrisr@bignet.net>
Subject: Re: Set path to perl.exe for Win 98 se
Message-Id: <svof1g68hbmc18@corp.supernews.com>

Godzilla! <godzilla@stomp.stomp.tokyo> wrote in message
news:39FBBE93.2023980C@stomp.stomp.tokyo...
>
[snip]
>
> One of you boys courtesy enough to post step-by-step
> instructions on what should be used to establish a
> DOS path statement with hopes of having Perl work?
> For now I will be satisfied to simply get this
> example.pl to run.

Assume, for the moment that you installed Perl in c:\perl.
Launch the command shell window.
Type:
set path=%path%;c:\perl\bin

Assuming further that the example program is in c:\perl\eg
c:
cd \perl\eg
perl example.pl

If it now runs, you can permanently add the c:\perl\bin to your global
environment.

HTH
Randy




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

Date: 29 Oct 2000 11:35:51 GMT
From: mount@umount.org (Mounter)
Subject: Sorry test
Message-Id: <8th22n$1hhl$1@igloo.uran.net.ua>

test - i'm sory
-- 

Sent from http://newsreader.linuxnews.pl/



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

Date: 29 Oct 2000 12:14:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sorry test
Message-Id: <8th4bc$l4j$1@orpheus.gellyfish.com>

On 29 Oct 2000 11:35:51 GMT Mounter wrote:
> test - i'm sory

misc.test or alt.test next time please.

/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 29 Oct 2000 07:32:20 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Sorry test
Message-Id: <slrn8vo66k.vl.tadmc@magna.metronet.com>

On 29 Oct 2000 11:35:51 GMT, Mounter <mount@umount.org> wrote:

>test - i'm sory


killfiled, I'm sorry.


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


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

Date: Sun, 29 Oct 2000 12:27:42 +0100
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Unpack tamplate
Message-Id: <lu1ovs0991s8f3usr9dr8b4kdutjet9em7@4ax.com>

On Sat, 28 Oct 2000 17:06:18 +0200, "Aurelio Balgera"
<aurelio@b-soft.com> wrote:

> Can anyone help me to write the exact unpack template to convert this CPP
> structure:
> 
> struct V5Flow
> {
>  unsigned long srcaddr;

 ...

What part of the explanation of template chars for the pack/unpack
functions didn't you understand?

From perldoc -f pack  (5.6.0):

    L   An unsigned long value.
          (This 'long' is _exactly_ 32 bits, which may differ from
           what a local C compiler calls 'long'.  If you want
           native-length longs, use the '!' suffix.)

-- 
Good luck,
Abe
perl -wle '%_=qw(Just Just another Perl Perl another hacker hacker);
 print join" ",map$_{$_}=>sort keys%_'


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

Date: Sun, 29 Oct 2000 08:07:26 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: what does /warn "$x" if "$x"/ mean
Message-Id: <slrn8vo88e.vl.tadmc@magna.metronet.com>


[ Please put your comments *following* the quoted text that 
  you are commenting on.

  Please do not quote entire articles.

  Please do not quote .signatures

  Please visit      news.announce.newusers

  Thanks.
]


On Sun, 29 Oct 2000 13:34:34 +1100, Joseph Chakrvarti 
   <josephmariadassou@primus.com.au> wrote:

>Dear Mr Pedant
>You are perhaps the only one in the whole wide world that does not pinch
>code from books and software documentation. 


You are going to have a Real Hard Time with this programming stuff
if you use such nonsense logic as that.

Martien did not say, or even imply, that he does not use OPC
(Other People's Code).

He just said that he doesn't claim it as his own (and that "I wrote"
claims it, in the eyes of most of this newsgroup's readership).



>When I say I wrote, I meant I
                     ^^^^^^^
>take responsiblilty for it, not credit. 


Then it is fine to write that when you are writing to yourself.

When writing to others however, you should write so that *they*
will understand it correctly.


>If I have to mention every person
>who should be credited for making the program work I'll have a long list,
                                   ^^^^^^^^^^^
>starting with Bill Gates.
               ^^^^^^^^^^


You will eventually have to pay for your deal with the devil.

:-)



And I don't see that he played any part in the development of 
Perl anyway, and so, wouldn't be in the list for "the program".


>Thanks for your kind advice. I'll ask you more when I need it



Now that we are done with what was said 3rd and 4th, we will now
do a time warp, and have what was said 1st and 2nd:

>"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
>news:slrn8vmtcv.ac5.mgjv@martien.heliotrope.home...
>> On Sun, 29 Oct 2000 11:38:28 +1100,
>> Joseph Chakrvarti <josephmariadassou@primus.com.au> wrote:
>> > Obviuosly if I I had written the whole program I would know what I am
>doing.
>>
>> Let me just quote from your original post:
>>
>> > > > Here is a short perl script(?) I wrote to split images and it works:
>>                                      ^^^^^^^
>> You should probably just have said something like: Here's a program I
>> adapted from the docuemntation of Image::magick. It uses constructs I
>> copied that I don't understand.


>> When we say that 'I wrote' something, we do mean that we did that. We
>> don't mean copied bits and pieces and stuck them together.


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


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4755
**************************************


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