[19258] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1453 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 6 18:05:41 2001

Date: Mon, 6 Aug 2001 15:05:17 -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: <997135517-v10-i1453@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 6 Aug 2001     Volume: 10 Number: 1453

Today's topics:
    Re:  Sending e-mail from a script in MS windows <somewhere@in.paradise.net>
    Re: 3 very easy ones 4 u <bart.lateur@skynet.be>
        Calling Multiple perl interpreters <balar@cisco.com>
    Re: CGI.pm file upload problem - Please Help! (Andreas Schmitz)
        Change in Perl ENV variables. <tsmeyer@fnal.gov>
    Re: Change in Perl ENV variables. <tsee@gmx.net>
    Re: Change in Perl ENV variables. <tsee@gmx.net>
    Re: comp.infosystems.www.authoring.cgi now moderated <djberg96@hotmail.com>
    Re: Data Interchange Format (Robert Goff)
    Re: Extract the relative sorting of items from multiple (Abigail)
        FAQ: How do I reset an each() operation part-way throug <faq@denver.pm.org>
    Re: launching a perl program not in a window <jurgenex@hotmail.com>
    Re: launching a perl program not in a window <tsee@gmx.net>
    Re: launching a perl program not in a window <ow22@nospam-cornell.edu>
    Re: launching a perl program not in a window <tsee@gmx.net>
    Re: launching a perl program not in a window <ow22@nospam-cornell.edu>
    Re: launching a perl program not in a window (Eric Bohlman)
    Re: launching a perl program not in a window <somewhere@in.paradise.net>
        Need Hints on Upgrading to Perl 5.005 (Bob Dilworth)
        newbie question (Raquel Hunter)
        Pairwise foreach-like idiom ctcgag@hotmail.com
    Re: Pairwise foreach-like idiom (Eric Bohlman)
        perl - AS/400 <jsutch@op.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 7 Aug 2001 07:53:11 +1000
From: "Tintin" <somewhere@in.paradise.net>
Subject: Re:  Sending e-mail from a script in MS windows
Message-Id: <znEb7.2$001.178339@news.interact.net.au>


"Dan Baker" <dan@nospam_dtbakerprojects.com> wrote in message
news:3B6E9DEB.60200B0C@nospam_dtbakerprojects.com...
>
>
> Just Some Guy wrote:
> >
> > Hi,
> >
> > I need a method to send an e-mail with an attacheded file from a perl
cgi
> > script running on Win2K Apache Server.
> ----------
>
> I ended up using MIME::Lite because can be set to work from both a win21
> machine and/or a UNIX/LINUX server as well a being able to handle
> attachments. One thing it does NOT do is send to multiple addresses
> using either CC or BCC as far as I could tell.

[snipped example]

Of course it handles CC and BCC.  The very first example in the
documentation makes this obvious.

$msg = MIME::Lite->new(
                 From     =>'me@myhost.com',
                 To       =>'you@yourhost.com',
                 Cc       =>'some@other.com, some@more.com',
                 Subject  =>'Helloooooo, nurse!',
                 Type     =>'image/gif',
                 Encoding =>'base64',
                 Path     =>'hellonurse.gif'
   );





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

Date: Mon, 06 Aug 2001 20:05:32 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: 3 very easy ones 4 u
Message-Id: <9lttmt0sqviatikinq81vudlk20083mknp@4ax.com>

Paul Fortescue wrote:

>1) How do I equivalent a #include? I have some subroutines which I don't
>want to edit anymore, but I don't want them cluttering up my code some I
>want do the equivalent of #include mysub.pl

use(), or require() for the newbies. The latter is less powerful, but
easier to grasp. It includes the file at run time, defining subs and
running (initialization) code.

>2) How do I find the number of occurrences of "abc" in "abcdefabc" for
>example? m// and s/// do everything but return the count as far as I can
>see.

s/abc//g DOES return the count. For m// you need to use a trick:

	$count = () = m/abc/g;

> Also can I m// for an exact match, eg a password without checking the
>match and the string length?

Yes... Anchor the regex.

	/^mypassword$/

or, if you're not sure about embedded newlines, but you won't accept
them:

	/^mypassword\z/

>3) not so important, my code works but I can't help thinking it's not as
>clever/small/efficient as it could be. I want to find all the files
>containing a string, and how many of them there are, and what the highest
>numbered suffix is. the files are called filetype.1, filetype.2 etc. I have
>written
>$fn="./";
>opendir DH, $fn;
>@fils=readdir(DH);
>$type="filetype.";
>@this=grep (/$type/, @fils);

You forgt to anchor, and to "quotemeta" the $type:

	@this=grep (/^\Q$type/, @fils);

>foreach $this (@mail) {
>$this=~s/$type//g;

Same thing:

	s/^\Q$type//

No need for /g, as you only do one replacement per string.

>}
>@this = sort {$b <=> $a} @this;
>$count=@this;
>print "$type files : the largest one is $this[0], and the total number is
>$count\r\n";
>exit;

Ok... how about using glob instead of grep?

	@this= glob("filetype.*);

That replaces your opendir+readdir+closedir+grep, but you still need the
s///.

Or, with a map() instead of grep():

	@ext =map /^\Q$type.(\d+)$/, @fils;

If you have a match, the digit(s) of the file extension will be pushed
onto @ext, while with no match, nothing gets pushed.

You can combine them, and use glob+map.

-- 
	Bart.


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

Date: Mon, 6 Aug 2001 12:52:18 -0700
From: "Bala Ramakrishnan" <balar@cisco.com>
Subject: Calling Multiple perl interpreters
Message-Id: <997127342.750979@sj-nntpcache-5>

I am writing a telnet gateway server in C++ and Corba. The client programs
send requests via Corba to the telnet gateway server to download commands to
various routers the gateway should manage.

I would like the gateway server to be as efficient as possible. Instead of
forking multiple perl processes running different perl scripts, per client
request, I would like to fire off  a thread everytime a client request is
made and invoke the perl interpreter from C, which will compile a specified
script script. The gateway will invoke the perl functions in this script to
carryout the actual telnet interaction with the device.

I am planning to use the Telnet.pm module in these scripts.

Has anyone done this kind of invoking multiple perl interpreters in
different threads? I have seen some information in archives regarding
building perl in a specific way, and that I need perl 5.6 or better.

The host environment is Solaris 2.6/2.7 and also I would like to know if
this is possible with Perl 5.4




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

Date: Mon, 06 Aug 2001 21:08:47 GMT
From: technik@medialsoft.de (Andreas Schmitz)
Subject: Re: CGI.pm file upload problem - Please Help!
Message-Id: <3b6f058b.4800244@news.rus.uni-stuttgart.de>

On Sun, 05 Aug 2001 01:23:43 GMT, "Gala" <Gala@nonono.com> wrote:
Hay,
>21  my $file = $q->param("file") || print "No file specified.";
>22  my $fh = $q->upload($file) || print "error";
Line 22 is not correct. 
my $fh = $q->upload("file") || ''; this is the correct syntax.


--      
Andreas Schmitz www.medialsoft.de
 _ _  _  _ ° _     _ _  _ _
| | ||_ | \|| || _| (_)|- |
| | ||_ |_/||-||__              


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

Date: Mon, 06 Aug 2001 16:06:53 -0500
From: Tom Meyer <tsmeyer@fnal.gov>
Subject: Change in Perl ENV variables.
Message-Id: <3B6F06ED.41DF7CFD@fnal.gov>

On an old version of Perl I was able to collect the environmental variable "REMOTE_HOST" which was the IP name of the requesting machine.  This was done for internal auditing of web site usage.  I upgraded machines, and my version of Perl to 5.6.1 and "REMOTE_HOST" is now an empty string.  I still get the "REMOTE_ADDR" or the IP address but, as you can imagine, this gets tedious looking up the machines by this method.  

Any ideas?

Thanks,
Tom Meyer
-- 
Tom Meyer
BD/RF&Instrumentation
Fermi National Accelerator Laboratory
tsmeyer@fnal.gov


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

Date: Mon, 6 Aug 2001 23:23:23 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Change in Perl ENV variables.
Message-Id: <9kn1mq$cob$05$1@news.t-online.com>

"Tom Meyer" <tsmeyer@fnal.gov> schrieb im Newsbeitrag
news:3B6F06ED.41DF7CFD@fnal.gov...
> On an old version of Perl I was able to collect the environmental variable
"REMOTE_HOST" which was the IP name of the requesting machine.  This was
done for internal auditing of web site usage.  I upgraded machines, and my
version of Perl to 5.6.1 and "REMOTE_HOST" is now an empty string.  I still
get the "REMOTE_ADDR" or the IP address but, as you can imagine, this gets
tedious looking up the machines by this method.

Investigate your server configuration. Something like DNS resolving if I
recall correctly.
Not a Perl issue, though.

Steffen Müller




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

Date: Mon, 6 Aug 2001 23:24:54 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Change in Perl ENV variables.
Message-Id: <9kn1pl$u2d$02$1@news.t-online.com>

>I still get the "REMOTE_ADDR" or the IP
>address but, as you can imagine, this gets
>tedious looking up the machines by this method.

Sorry that I didn't mention that in the first place, but: What do you think
your server does to supply you with the remote_host env?

Steffen





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

Date: Mon, 06 Aug 2001 22:00:14 GMT
From: "Daniel Berger" <djberg96@hotmail.com>
Subject: Re: comp.infosystems.www.authoring.cgi now moderated
Message-Id: <OrEb7.28203$X6.980200@typhoon.mn.mediaone.net>

> You personally are bordering on unlawful harassment which can
> be resolved by filing of a criminal complaint with your local
> law enforcement agency, an activity in which I have engaged
> in the past, as documented in this group's archives.
>
>
> Godzilla!

Godzilla, Randal - I couldn't care less about this topic one way or another
so I'm going to lighten the mood a little...

A new version of the (in)famous Blue Oyster Cult song:

"With a purposeful grimace and a terrible sound
he drags fragile coder egos down

Helpless newbies on the gravy-train
Scream bug-eyed as he looks in on them

Takes their code and tears it to shreds
As he wades through lines and lines of pitiful dretch

* chorus *
Oh, no, they say he's got to go, Go! Go! Godzilla!
Oh, no, there goes another ego!  Go! Go! Godzilla!

Larry points out again and again
How Perl points out the folly of men..."

Those who don't know the song can get an idea of the sound here:

http://www.geocities.com/SunsetStrip/Palladium/1718/blueoyst.html

Now be quiet as I try to use Perl to figure out how 8x7 = 42.

Regards,

Dan









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

Date: 6 Aug 2001 13:40:11 -0700
From: beast@avalon.albuquerque.nm.us (Robert Goff)
Subject: Re: Data Interchange Format
Message-Id: <55f4cea3.0108061240.77e4e678@posting.google.com>

Jeff Zucker <jeff@vpservices.com> wrote in message news:<3B683002.E053F9F0@vpservices.com>...

> Yep, I thought of that.  But I had a look at DIF and it seems like quite
> a mess though still a good candidate for an AnyData plug-in.  I'll stick
> it on the list after Mail/Mbox and DBM which, in my mind have a bit of
> priority.  But if anyone else wants to give it a shot, I'd be glad to
> help out.

I'll probably do that.  I'm working on a remote, commercially hosted
server, and the complications of getting ODBC installed and working
sound a bit larger than this client wants to pay for.  I need some
kind of data format I can parse directly from perl, and tab-delimited
text is proving to be one challenge too many for the client.  At least
with DIF there is sufficient self-definition in the file that I can
unabiguously determine if it's corrupted and if there is sufficient
data for the operation I'm trying to carry out.

Thanks for the link to the DIF spec, and I'll review the docs for
DBD::AnyData and contact Jeff directly.

--
Our bombs are smarter than the average high school student. At least
they can find Kuwait.
======================================================================
Robert Goff                                  http://aisling.cc/resume/
Technical Writer/Editor, Webmaster                        505-564-8959


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

Date: 6 Aug 2001 19:33:04 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Extract the relative sorting of items from multiple lists
Message-Id: <slrn9mts8d.v40.abigail@alexandra.xs4all.nl>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDCCCXCV September MCMXCIII
in <URL:news:pnjnmt8k6pl8as26f3p9qj5panfqsbbl13@4ax.com>:
[] David Combs wrote:
[] 
[] >>The Graph module, as found on CPAN and discussed in
[] >>"Mastering Algorithms with Perl" has such a method.
[] >>
[] >
[] >Some of the more nifty algorithms in that Aho, Ullman, etc
[] >algorithms book (way back when) somehow didn't make
[] >into that perl book.  (Pretty much every algorithms
[] >book SINCE the aho/ullman book also has them).
[] 
[] Aho, Ullman, etc? Those are the guys from the Dragon Book, "Compilers:
[] Principles, Techniques and Tools". (BTW the third name is Sethi.)

Some people write more than one book!

    Afred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman: "The Design
    and Analysis of Computer Algorithms". Addison-Wesley, 1974.

    Afred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman: "Data Structures
    and Algorithms". Addison-Wesley, 1983.

    Alfred V. Aho, and Jeffrey D. Ullman: "The Theory of Parsing,
    Translation and Compiling. Volume I: Parsing". Prentice-Hall, 1972.

    Alfred V. Aho, and Jeffrey D. Ullman: "The Theory of Parsing,
    Translation and Compiling. Volume II: Compiling". Prentice-Hall, 1972.

    John E. Hopcroft, and Jeffrey D. Ullman: "Automata Theory, Languages
    and Computation". Addison-Wesley, 1979.

[] "Mastering Algorithms with Perl" is written by Jon Orwant, Jarkko
[] Hietaniemi & John Macdonald.

Yeah, so they collected a set of known algorithms, and made Perl
implementations. That doesn't mean they didn't leave out some of
the algorithms discussed by Aho, Hopcroft and Ullman.

Any of the Aho, Hopcroft and Ullman are infinitely more useful than the
O'Reilly book.

[] A quick scan at O'Reilly's website, section "Perl", could have told you
[] that.

Anyone involved in computing should *know* the contributions of giants
like Aho, Hopcroft and Ullman - no need to look it up.



Abigail
-- 
$_ = "\112\165\163\1648\141\156\157\164\150\145\1628\120\145"
   . "\162\1548\110\141\143\153\145\162\0128\177"  and &japh;
sub japh {print "@_" and return if pop; split /\d/ and &japh}


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

Date: Mon, 06 Aug 2001 18:17:01 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How do I reset an each() operation part-way through?
Message-Id: <xaBb7.64$T3.171060224@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  How do I reset an each() operation part-way through?

    Using "keys %hash" in scalar context returns the number of keys in the
    hash *and* resets the iterator associated with the hash. You may need to
    do this if you use "last" to exit a loop early so that when you re-enter
    it, the hash iterator has been reset.

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           04.61
-- 
    This space intentionally left blank


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

Date: Mon, 6 Aug 2001 13:55:24 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: launching a perl program not in a window
Message-Id: <3b6f043c$1@news.microsoft.com>

"Oliver" <ow22@nospam-cornell.edu> wrote in message
news:9kmurv$eil$1@news01.cit.cornell.edu...
Well, your question is quite confusing.
Step by step:

> Hi, i was wondering if anyone knew the html code for launching

HTML is a text description language, not a programming language. It cannot
"launch" another program. Actually it doesn't even have any control
structures, commands, or functions. Are you talking about DHTML and
PerlScript maybe (rather unlikely)?

> a perl program into a hidden frame or somthing,

Well, yes, HTML 4 has frames. But I've no idea what a Perl (not perl)
program has to do with frames. You run a Perl program on a computer, not in
an HTML frame.

> basically i have a perl program
> that updates an html file, i want to call this perl program

Just type it's name on the command line

> but not have it
> actually launch the program into a window.

Well, unless you got a very unusual configuration Perl won't launch another
window but run in the command window/shell/xterm where you typed the
command.

jue




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

Date: Mon, 6 Aug 2001 22:55:00 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: launching a perl program not in a window
Message-Id: <9kn03t$es0$07$1@news.t-online.com>

"Oliver" <ow22@nospam-cornell.edu> schrieb im Newsbeitrag
news:9kmurv$eil$1@news01.cit.cornell.edu...
> Hi, i was wondering if anyone knew the html code for launching a perl
> program into a hidden frame or somthing, basically i have a perl program
> that updates an html file, i want to call this perl program but not have
it
> actually launch the program into a window. so i cant just use the standarf
> href. okay thanks a lot
>
> oliver

What I can think of would be that you point the href at the script. However,
the script doesn't print HTML back to the browser but instead a redirecting
header pointing at whatever site you want the user to go (maybe the page he
clicked the link on). This involves a reloading of the original page, but I
can't think of a better way to do this right now. You can have CGI.pm handle
the redirection or do it by hand:

print 'Location: http://YOURSERVER/PATH/HTMLFILE.HTML'."\n\n";
print 'URI: http://YOURSERVER/PATH/HTMLFILE.HTML'."\n\n";

If I recall correctly: The URI version is the standard redirector but
doesn't work with all browsers, I think. The Location one is not part of the
standard but is supported by more browsers. Use both to be on the safe side.
Always use absolute URLs. Relative ones lead to trouble. CGI.pm prints both
lines.

BTW: This belongs into comp.infosystems.www.authoring.cgi as it is more
about CGI than Perl, but afterall, it might be just my response.

Steffen Müller




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

Date: Mon, 6 Aug 2001 14:03:41 -0700
From: "Oliver" <ow22@nospam-cornell.edu>
Subject: Re: launching a perl program not in a window
Message-Id: <9kn0nt$gsh$1@news01.cit.cornell.edu>

hm i think you missed the point, steffen muller was right saying that this
belonged more in a cgi group than a perl group, but i wasnt aware of the
other before i posted this question and i thought that someone would know in
this group anyway. im not asking how to run a perl program from the command
line and have it pop up in another window, that doesnt make any sense, i was
just wondering how to get it so that the web browser doesnt put the cgi
program in a frame/window, which it does by default with the html href tag.

oliver


"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:3b6f043c$1@news.microsoft.com...
> "Oliver" <ow22@nospam-cornell.edu> wrote in message
> news:9kmurv$eil$1@news01.cit.cornell.edu...
> Well, your question is quite confusing.
> Step by step:
>
> > Hi, i was wondering if anyone knew the html code for launching
>
> HTML is a text description language, not a programming language. It cannot
> "launch" another program. Actually it doesn't even have any control
> structures, commands, or functions. Are you talking about DHTML and
> PerlScript maybe (rather unlikely)?
>
> > a perl program into a hidden frame or somthing,
>
> Well, yes, HTML 4 has frames. But I've no idea what a Perl (not perl)
> program has to do with frames. You run a Perl program on a computer, not
in
> an HTML frame.
>
> > basically i have a perl program
> > that updates an html file, i want to call this perl program
>
> Just type it's name on the command line
>
> > but not have it
> > actually launch the program into a window.
>
> Well, unless you got a very unusual configuration Perl won't launch
another
> window but run in the command window/shell/xterm where you typed the
> command.
>
> jue
>
>




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

Date: Mon, 6 Aug 2001 23:18:17 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: launching a perl program not in a window
Message-Id: <9kn1d8$21t$01$1@news.t-online.com>

"Oliver" <ow22@nospam-cornell.edu> schrieb im Newsbeitrag
news:9kn0nt$gsh$1@news01.cit.cornell.edu...
> hm i think you missed the point, steffen muller was right saying that this
> belonged more in a cgi group than a perl group, but i wasnt aware of the
> other before i posted this question and i thought that someone would know
in
> this group anyway. im not asking how to run a perl program from the
command
> line and have it pop up in another window, that doesnt make any sense, i
was
> just wondering how to get it so that the web browser doesnt put the cgi
> program in a frame/window, which it does by default with the html href
tag.

Jürgen was right to point out that you don't call the program via the
client-side HTML. By clicking the href link, the user kind of asks the
server to execute the script and return the script's stdout. A CGI script
returns HTML in most cases. Anyway, you can't run scripts via a browser. You
ask for the output of some script on the server. As web servers with perl on
them are nice servers, they run the scripts and return their output.

Steffen




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

Date: Mon, 6 Aug 2001 14:27:34 -0700
From: "Oliver" <ow22@nospam-cornell.edu>
Subject: Re: launching a perl program not in a window
Message-Id: <9kn24m$i8l$1@news01.cit.cornell.edu>

ya that much is true, but its mostly a point of symantics, it doesnt really
matter to the end user whether the script is executed on the server or the
client or on a totally unrelated computer, as long as they get what they
want.  for example, i dont care how the perl interpreter parses and executes
the perl code, just like i dont care how the actual unix machine interprets
the machine commands.  by saying "launch" a program, i didnt mean that the
html would actually excute the program, but i figured i would save some
typing rather than explain percisely what happens with the system.  and the
fact that jurgen was able to correct my mistake means that he did understand
what i was trying to say anyway.

oliver

"Steffen Müller" <tsee@gmx.net> wrote in message
news:9kn1d8$21t$01$1@news.t-online.com...
> "Oliver" <ow22@nospam-cornell.edu> schrieb im Newsbeitrag
> news:9kn0nt$gsh$1@news01.cit.cornell.edu...
> > hm i think you missed the point, steffen muller was right saying that
this
> > belonged more in a cgi group than a perl group, but i wasnt aware of the
> > other before i posted this question and i thought that someone would
know
> in
> > this group anyway. im not asking how to run a perl program from the
> command
> > line and have it pop up in another window, that doesnt make any sense, i
> was
> > just wondering how to get it so that the web browser doesnt put the cgi
> > program in a frame/window, which it does by default with the html href
> tag.
>
> Jürgen was right to point out that you don't call the program via the
> client-side HTML. By clicking the href link, the user kind of asks the
> server to execute the script and return the script's stdout. A CGI script
> returns HTML in most cases. Anyway, you can't run scripts via a browser.
You
> ask for the output of some script on the server. As web servers with perl
on
> them are nice servers, they run the scripts and return their output.
>
> Steffen
>
>




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

Date: 6 Aug 2001 21:58:40 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: launching a perl program not in a window
Message-Id: <9kn3ug$n2$1@bob.news.rcn.net>

Oliver <ow22@nospam-cornell.edu> wrote:
> ya that much is true, but its mostly a point of symantics, it doesnt really
> matter to the end user whether the script is executed on the server or the
> client or on a totally unrelated computer, as long as they get what they
> want.  for example, i dont care how the perl interpreter parses and executes
> the perl code, just like i dont care how the actual unix machine interprets
> the machine commands.  by saying "launch" a program, i didnt mean that the
> html would actually excute the program, but i figured i would save some
> typing rather than explain percisely what happens with the system.  and the
> fact that jurgen was able to correct my mistake means that he did understand
> what i was trying to say anyway.

Seriously, while it might at first *sound* nitpicky to insist on drawing
precise distinctions like this, experience shows (just read a couple
weeks' worth of posts here) that a lot of problems are caused by failure
to understand such distinctions.  For example, an extremely common
complaint is "my program works when I run it from the command line, but
not when I run it from the browser."  In almost all cases, such problems
are related to the fact that when you run a program from the command line,
it's running as you, but when you use a browser to ask the Web server to
run a CGI script for you, the script is *not* running as you, it's running
as whatever user the server runs as, and that user doesn't have the same
environment, permissions, working directory, etc. as you do.  In this case 
the phrase "running it from the browser" obscures this important 
distinction; it implies a model of processing that simply doesn't exist.

In any client-server scenario, it's extremely important to understand the 
responsibilities of the client, the responsibilities of the server, and 
the boundaries in between them.  It's also extremely easy to get all these 
things confused.  Thus people who have been there, done that have learned 
to insist on the use of extremely precise language when describing 
client/server setups, since the alternative is unproductive guesswork.  
Don't take it personally; people are speaking from their own experience 
when they emphasize the importance of precise language in such matters.




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

Date: Tue, 7 Aug 2001 08:02:03 +1000
From: "Tintin" <somewhere@in.paradise.net>
Subject: Re: launching a perl program not in a window
Message-Id: <TvEb7.4$D01.188460@news.interact.net.au>


"Oliver" <ow22@nospam-cornell.edu> wrote in message
news:9kmurv$eil$1@news01.cit.cornell.edu...
> Hi, i was wondering if anyone knew the html code for launching a perl
> program into a hidden frame or somthing, basically i have a perl program
> that updates an html file, i want to call this perl program but not have
it
> actually launch the program into a window. so i cant just use the standarf
> href. okay thanks a lot

The Javascript ng is thata way ---->




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

Date: Mon, 06 Aug 2001 20:48:25 GMT
From: bdilworth@mco.edu (Bob Dilworth)
Subject: Need Hints on Upgrading to Perl 5.005
Message-Id: <3b6f0033.29527688@news4u.mco.edu>

All:

In my failed effort to find a version of Parse::RecDescent that runs
under Perl 5.004 it looks like my only choice is to upgrade to Perl
5.005 (minimally).  Having installed Perl on my Sun box but never
upgraded I'm wondering about the various gotchas inherent in the
process.

For example, I have the perl binary in /usr/local/bin and the libs/PMs
in /usr/local/lib/perl5/...    If I compile 5.005 and install it in
the same place, replacing 5.004, will it (5.005) have problems with
some of the "old" PMs?  If I install 5.005 in a "new" location,
preserving 5..004, I'm assuming I'll also need to download and
re-install all the modules I've built for 5.004.  Yes, No?

I really feel like an idiot here but having never done this before I
want to make sure I know what I'm doing before I proceed.  So ... Any
hits/suggestions/experiences along these line, including pointers to
web-based (or even POD-based) docs would be greatly appreciated.

If this question is inappropriate for this forum please let me know
that too.

Thanks in advance!!!!!!

Bob Dilworth
Toledo, Ohio


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

Date: 6 Aug 2001 12:25:04 -0700
From: rshbruin@mamashealth.com (Raquel Hunter)
Subject: newbie question
Message-Id: <406c3e5d.0108061125.55a8facf@posting.google.com>

I'm sending information using a form...basically, I am trying to
design it where a user will input information in a form, click
submit...the information they just entered will be displayed to them
and then they can print it out.  The problem is when the submit button
is clicked, should the form post to a .cgi or a .pl?  This is the part
that confuses me.  Is the process .html-->.cgi-->.html?

Please help!

Raquel


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

Date: 06 Aug 2001 21:22:42 GMT
From: ctcgag@hotmail.com
Subject: Pairwise foreach-like idiom
Message-Id: <20010806172242.453$30@newsreader.com>

I've run into this problem and problems similar several times.
I want to visit the neighbors of a given datapoint, $x[$j][$i],
but have it flexible (so I can add diagonal neighbers, etc.)

The solution I came up with is this:

@group = ( -1,0,    +1,0,   0,-1,   0,+1 );
while ( ($io, $jo, @group ) = @group ) {
   $ii=$i+$io;
   $jj=$j+$jo;
   -- Do something with $x[$jj][$ii] --
};


Does someone have an idiom they prefer for doing this sort of thing?

Thanks,

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
                    Usenet Newsgroup Service


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

Date: 6 Aug 2001 22:04:38 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Pairwise foreach-like idiom
Message-Id: <9kn49m$n2$2@bob.news.rcn.net>

ctcgag@hotmail.com wrote:
> I've run into this problem and problems similar several times.
> I want to visit the neighbors of a given datapoint, $x[$j][$i],
> but have it flexible (so I can add diagonal neighbers, etc.)

> The solution I came up with is this:

> @group = ( -1,0,    +1,0,   0,-1,   0,+1 );
> while ( ($io, $jo, @group ) = @group ) {

while (($io,$jo)=splice(@group,0,2)) {

>    $ii=$i+$io;
>    $jj=$j+$jo;
>    -- Do something with $x[$jj][$ii] --

I'd skip the intermediate assignments (if you still want to do them,
locally scope $ii and $jj) and just do something with $x[$i+$io][$j+$jo];  
to my mind that makes it clearer that we've got an "anchor point" and
we're poking around it

I'd also use Perl syntax for comments, even comments that won't end up in 
the code :)

};


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

Date: Mon, 06 Aug 2001 19:10:29 GMT
From: "JT" <jsutch@op.net>
Subject: perl - AS/400
Message-Id: <3b6eeb77.2590$1d9@news.op.net>

I have been developing reports on the as/400 using perl over the past two
years.
Recently we upgraded one of our systems from V4R4 to V4R5. At this point, my
perl programs
no longer read character data from the db2 tables. Numeric comes across fine
but I get an
undefined error when reading the tables.

If possible, could you please point me in the appropriate direction for
resolving this issue?

Any assistance will be much appreciated,

Thanks in advance,

John Sutch
Programmer/Analyst





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

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


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