[8125] in Perl-Users-Digest
Perl-Users Digest, Issue: 1743 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 27 17:08:15 1998
Date: Tue, 27 Jan 98 14:00:26 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 27 Jan 1998 Volume: 8 Number: 1743
Today's topics:
accessing netware server files from NT <thebreez@erols.com>
Re: Awk command does not work. Why? <rootbeer@teleport.com>
Re: Creating a serial processing queue (Craig Berry)
Re: crypt function ... help. (Gabor)
Re: Datachecking a CGI with Javascript. (Chip Salzenberg)
Re: Datachecking a CGI with Javascript. <mr.t@umich.edu>
Re: declarating subroutine prototypes <rootbeer@teleport.com>
Re: declaring subroutine prototypes <rootbeer@teleport.com>
Re: Don't use signal handlers (was Re: Child processes) <zamboni@cs.purdue.edu>
Re: HELP HELP HELP!!! - with function call parameters <rootbeer@teleport.com>
Help with debugging perl outside of web <dbm@cadence.com>
Help with debugging perl without the web <dbm@cadence.com>
How to implement a timeout in NT/95? (D461-David_F_Haertig(Dave)83040)
IIS 4.0 Perl Problem <jenki021@tc.umn.edu>
Installing a CPAN module on Windows NT <Kari.Marttila.@tietogroup.com>
Re: IP Address as new File <rootbeer@teleport.com>
Is there a WebRing Script? <warchie@att.net.hk>
Re: making lists of items in text file using perl <rootbeer@teleport.com>
Re: Newbie: Flafile database creation <rootbeer@teleport.com>
Oraperl to DBI migration issue with ora_bind <schramm@one.net>
Re: Perl (4) and images in the code.... <rootbeer@teleport.com>
Re: Perl and IIS. Trying to get the server running. <keefner@kinetic.com>
Perl script reading in HTML POST Form info mgeorgeadis@fallschurch.esys.com
Re: Perl script reading in HTML POST Form info <xxTony.Curtis@vcpc.univie.ac.at>
Re: print<< into variable? (Craig Berry)
Re: Survival Of perl (Earl Hood)
system command and using variable in list <keefner@kinetic.com>
UK download sites? <news@outline.ednet.co.uk>
Re: unix command pipes (Chip Salzenberg)
Re: White Hats and Black (Jack Straw)
Win32 Perl & Internet Information Server 4.0 (NT) cristi@obs-us.com
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 27 Jan 1998 16:22:50 -0500
From: Kevin Bree <thebreez@erols.com>
Subject: accessing netware server files from NT
Message-Id: <34CE5029.AC5D5BBA@erols.com>
I am running a script on NT 4 that accesses a directory(opendir), opens
files in that directory(open), reads the files and parses them for a
pattern. When I run this on a regular NTFS everything is fine. However,
it doesn't work on a mapped netware drive. It gets to the directory and
opens the file, but when it reads the file it gets a bunch of control
characters. I am using perl version 5.004_02 for NT.
Any help would be appreciated.
Kevin
thebreez@erols.com
------------------------------
Date: Tue, 27 Jan 1998 13:40:02 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Sylvain Juneau <sjuneau@microtec.net>
Subject: Re: Awk command does not work. Why?
Message-Id: <Pine.GSO.3.96.980127133836.22373h-100000@user2.teleport.com>
On Tue, 27 Jan 1998, Sylvain Juneau wrote:
> `awk -F"send2" '{print $2}'`;
I'm not sure why you're using awk when you have perl handy, but you should
know that that command is using Perl's $2 variable, not awk's. Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 27 Jan 1998 21:06:42 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Creating a serial processing queue
Message-Id: <6ali92$qhn$2@marina.cinenet.net>
Chris Schoenfeld (chris@ixlabs.com) wrote:
: I have an LWP app which automatically POSTs submissions to a CGI
: application throughout the day...
:
: Once in a while, the CGI is unnavailable due to normal, transient
: internet network glitches.
:
: If this happens, it is very important that this submission is queued and
: that it goes out before any subsequent submissions - the CGI must
: process the requests serially.
:
: I have never done a queueing system and would like some pointers
: regarding how I might implement this from experienced folks who know the
: subtleties of such a system.
Conceptually, this can be very simple. When you generate an update, put
it into a single scalar, then push this onto a 'pending' list. When you
send updates, send every pending update, pulling them destructively off
the pending list. Here's pseudocode:
@pending = ();
...
my $update = &generateUpdate(); # gU() must return scalar!
...
&sendUpdate($update);
...
sub sendUpdate
{
push @pending, shift;
shift @pending while (@pending && &sendOneUpdate($pending[0]));
}
HTH...
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 27 Jan 1998 21:14:47 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: crypt function ... help.
Message-Id: <slrn6csj93.in.gabor@vnode.vmunix.com>
In comp.lang.perl.misc, chad <chad> wrote :
#
# How do I de-crypt a crypt'd string? I cryp'd it using the perl crypt function.
#
# thanks,
#
# -chad
use crypt twice on the string while chanting some secret voodoo
rhymes. :-)
------------------------------
Date: Tue, 27 Jan 1998 21:12:35 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Datachecking a CGI with Javascript.
Message-Id: <6alimd$2ln$1@cyprus.atlantic.net>
According to "SPLiNTeR" <mr.t@umich.edu>:
[nothing worth repeating]
That was probably the worst article actually involving programming
that I have ever seen posted to c.l.p.m.
ChipDude
<mrt> I pity the fool </mrt>
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: Tue, 27 Jan 1998 16:39:42 -0500
From: "SPLiNTeR" <mr.t@umich.edu>
Subject: Re: Datachecking a CGI with Javascript.
Message-Id: <6alk7g$r5p$1@charm.magnus.acs.ohio-state.edu>
thanks for the help.
------------------------------
Date: Tue, 27 Jan 1998 13:31:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>
Subject: Re: declarating subroutine prototypes
Message-Id: <Pine.GSO.3.96.980127133038.22373e-100000@user2.teleport.com>
On 27 Jan 1998, M.J.T. Guy wrote:
> foo('x');
> sub foo () { print "foo-led you" };
>
> _could_ be treated as if it were
>
> sub foo;
> foo('x');
> sub foo () { print "foo-led you" };
>
> which generates an error. And I think Perl _should_ do that.
Great minds think alike: I made a similar proposal to the Perl developers'
mailing list yesterday. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 13:13:34 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: declaring subroutine prototypes
Message-Id: <Pine.GSO.3.96.980127124244.22373a-100000@user2.teleport.com>
On Tue, 27 Jan 1998, Chipmunk wrote:
> perlsub appears to say the same thing as Programming Perl:
>
> As of the 5.002 release of perl, if you declare
> sub mypush (\@@)
> then mypush takes arguments exactly like push does. The
> declaration of the function to be called must be visible
> at compile time.
>
> The declarations of the functions I am calling are visible at compile
> time. They just happen to be later in the file.
Maybe the docs aren't as clear as they should be. To me, that is saying
that the compiler has to know about your prototype before it compiles the
sub using that prototype.
> If that text is supposed to mean "the declaration of the function to be
> called must appear before the function call", then it should say that.
> :-)
Doc patches are always welcome. (But, please, don't say that the prototype
must appear in the source before the function call. It needs to be seen by
the compiler before the compiler sees the function call, which may mean
that it's contained in a separate file, for example.)
Nevertheless, as a result of this confusion, I've proposed (to the Perl
developers' mailing list) that defining a prototype other than the default
should give a warning if a (prototypable) call to the sub has already been
compiled.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 27 Jan 1998 16:12:39 -0500
From: Diego Zamboni <zamboni@cs.purdue.edu>
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <fwsoq9hb94.fsf@narnia.cs.purdue.edu>
chip@mail.atlantic.net (Chip Salzenberg) writes:
> You should not use signal handler subroutines in Perl programs you
> depend on. Perl doesn't do signals right, yet.
Could you please expand on this? In what sense doesn't Perl do signals right?
Any examples or further references would be useful.
A program I'm writing uses signals to respond to certain user-generated
events, so this interests me.
Thanks,
--Diego
------------------------------
Date: Tue, 27 Jan 1998 13:28:41 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Bhanu P. Suravarapu" <bhanu@usl.edu>
Subject: Re: HELP HELP HELP!!! - with function call parameters
Message-Id: <Pine.GSO.3.96.980127132441.22373c-100000@user2.teleport.com>
On Tue, 27 Jan 1998, Bhanu P. Suravarapu wrote:
> Subject: HELP HELP HELP!!! - with function call parameters
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> In my perl script I have something like
>
> open(somefile1....);
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
It's generally preferable to use all caps for filehandle names.
> So my function is not being called sometimes I donot know
> why this is happening.
It sounds as if you have a bug in your program. If you can show us more of
your program, someone may be able to show you more about where the bug is.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 13:15:20 -0800
From: David Morris <dbm@cadence.com>
Subject: Help with debugging perl outside of web
Message-Id: <34CE4E68.FED09816@cadence.com>
Hello folks ... I'm interested in a technical solution for the following:
I have a collection of perl programs that usually are executed through the
web, and therefore, have the environment variable REQUEST_METHOD set by the
browser calls (usually set with method=POST statements).
What I would like to do now is try debugging these as stand-alone, without the
web environment. When attempted I get the expected:
C:\PublicFolder\public_html\cgi-bin>perl -d buildrpt.pl
Content-type: text/html
Content-type: text/html
cgi-lib.pl: Unknown request method:
What would any of you suggest I do to short circuit the errors coming out of
the check for request method type? I can think of maybe forcing the assignment
of REQUEST_METHOD, but I'm unclear on the grammar. Of course, there may be
alternative solutions as well.
Thanks for the advice you provide,
--
David Morris
------------------------------
Date: Tue, 27 Jan 1998 13:16:49 -0800
From: David Morris <dbm@cadence.com>
Subject: Help with debugging perl without the web
Message-Id: <34CE4EC1.5C831C6F@cadence.com>
Hello folks ... I'm interested in a technical solution for the following:
I have a collection of perl programs that usually are executed through the
web, and therefore, have the environment variable REQUEST_METHOD set by the
browser calls (usually set with method=POST statements).
What I would like to do now is try debugging these as stand-alone, without the
web environment. When attempted I get the expected:
C:\PublicFolder\public_html\cgi-bin>perl -d buildrpt.pl
Content-type: text/html
Content-type: text/html
cgi-lib.pl: Unknown request method:
What would any of you suggest I do to short circuit the errors coming out of
the check for request method type? I can think of maybe forcing the assignment
of REQUEST_METHOD, but I'm unclear on the grammar. Of course, there may be
alternative solutions as well.
Thanks for the advice you provide,
--
David Morris
------------------------------
Date: Tue, 27 Jan 1998 21:29:18 GMT
From: dfh@dwroll.lucent.com (D461-David_F_Haertig(Dave)83040)
Subject: How to implement a timeout in NT/95?
Message-Id: <EnGp0u.FEp@drnews.dr.lucent.com>
Keywords: timeout, alarm, signal, NT
How do I implement a timeout around an operation in NT/95?
Under UNIX, I've done:
local($SIG{'ALRM'}) = 'AlarmSignalHandler';
eval {
alarm($Timeout);
&SendDB($LocalDcFile); # Upload file over socket
alarm(0);
};
if ($@ =~ /ALRM/) {
blah, blah, blah;
}
The above doesn't work under NT/95. If tried, it acts like I'm
getting an immediate ALRM signal. I know signals are a UNIX thing,
but I guess I was hoping that someone had tricked Windows
into handling this when PERL was ported. I'm using that
ActiveState (ActiveWare? ... ActiveWhatever) port.
Thanks,
--
Dave Haertig
haertig@lucent.com
--
Dave Haertig
haertig@lucent.com
------------------------------
Date: Tue, 27 Jan 1998 14:58:01 -0600
From: Jon Jenkins <jenki021@tc.umn.edu>
Subject: IIS 4.0 Perl Problem
Message-Id: <34CE4A59.A4D494CF@tc.umn.edu>
I had NT Perl Build 513 running on IIS 3.0 (scripts worked both from the
command prompt and a web browser. However, after I upgraded to IIS 4.0
scripts will no longer run from the browser (but continue to run fine
from the command line. The error I get is as follows:
CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
Can't open perl script "???????????????????f??????": Invalid argument
For reference the script I'm trying to run resides at
http://134.84.242.102/cgi-bin/index.pl
It's a simple script that has a correctly formed header with two line
feeds and prints hello. What gives? Is IIS 4.0 not finding the file?
--Jon Jenkins
------------------------------
Date: Tue, 27 Jan 1998 17:25:06 +0200
From: Kari Marttila <Kari.Marttila.@tietogroup.com>
Subject: Installing a CPAN module on Windows NT
Message-Id: <34CDFC52.3198@tietogroup.com>
I am a new Perl user and having some problems with installing a CPAN
module on Windows NT. My perl is version 5.004_02. I wanted to install
MD5-1.7. I got the module from ftp.funet.fi ok and gunzipped and
untarred it to my hard disk. Installation guide said that I should make
following commands:
perl Makefile.PL
make
make test
make install
perl Makefile.PL was ok. Then I noticed that there is no 'make' in my NT
but I found dmake in my perl/bin directory. When I tried 'dmake' that
gave me the following error message: dmake.exe: makefile: line 726:
Error -- Expecting macro or rule defn, found neither.
I hope this is not a stupid question, but what is wrong here?
Should I get a proper 'make' for NT? I have copied some lines from
Makefile, the line 726 is marked with #:
Thanks!
Kari.Marttila@tietogroup.com
PS. If possible, I'd appreciate a personal reply also.
# --- MakeMaker pm_to_blib section:
pm_to_blib: $(TO_INST_PM)
@$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
"-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
-e "pm_to_blib(qw[ <<pmfiles.dat ],'$(INST_LIB)\auto')"
$(PM_TO_BLIB) # THIS IS LINE 726!!!!!!!!!!!!!!!!!!
<<
@$(TOUCH) $@
------------------------------
Date: Tue, 27 Jan 1998 13:24:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Derek Blandford <blan0416@uidaho.edu>
Subject: Re: IP Address as new File
Message-Id: <Pine.GSO.3.96.980127132034.22373b-100000@user2.teleport.com>
On Tue, 27 Jan 1998, Derek Blandford wrote:
> And you do not use parenthesis when printing to the file....
Parentheses are generally optional with print.
> open (TEMP_FILE, ">$file_base/$remote_address");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> print TEMP_FILE "$remote_address\|$url\n";
The first backslash is superfluous.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 25 Jan 1998 23:01:41 +0800
From: Walter Archie <warchie@att.net.hk>
Subject: Is there a WebRing Script?
Message-Id: <34CB53D5.4E8B6C50@att.net.hk>
I am looking for a webring script out there. If someone has one or knows
of one please help find it. I am looking for a site I am putting
together. This is really appreciated if you can help me.
Thank You,
Justin Archie
------------------------------
Date: Tue, 27 Jan 1998 13:29:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: James <James@cydaps.demon.co.uk>
Subject: Re: making lists of items in text file using perl
Message-Id: <Pine.GSO.3.96.980127132908.22373d-100000@user2.teleport.com>
On Tue, 27 Jan 1998, James wrote:
> Is there any way that I can get perl to search through a delimited text
> file for all the occurances of a certain item, (ie if there is a list of
> different colour jumpers) and then create a file to store this
> information in, but not to repeat duplicate items.
Yes, you can do that with a hash. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 13:35:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: avern@hotmail.com
Subject: Re: Newbie: Flafile database creation
Message-Id: <Pine.GSO.3.96.980127133336.22373f-100000@user2.teleport.com>
On Tue, 27 Jan 1998 avern@hotmail.com wrote:
> 1. recursive traversal of directories
You way want the File::Find module.
> 2. creating and populating the database
There are several useful database modules.
> 3. the feasibility of having a single file that contains the "bodies"
> of over 3000 web pages (on a UNIX server [SunOS 5.5.1])
This is beyond the scope of this newsgroup. If you'd like to discuss the
feasibility of various file formats for various data, a newsgroup about
general data-storage or programming issues may be able to help.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 16:31:41 -0500
From: "RDSchramm" <schramm@one.net>
Subject: Oraperl to DBI migration issue with ora_bind
Message-Id: <34ce523f.0@news.one.net>
Hello,
I am trying to migrate some DB access code away from the Oraperl model and
into the DBI standard model.
The oraperl code is taking information from a web form and loading it into a
DB. The data needs to be added exactly as it was entered, including all
meta charactors, quote marks, etc.
To keep the meta information inside the scalars from being interpretted
inside the query string for the INSERT SQL statement, we used ora_bind:
$query = "INSERT INTO clr_house(user_id,site,date_created)
VALUES(:1,:2,:3)";
$csr = &ora_open($lda, $query);
&ora_bind($csr,$user_id,$site,$date_created);
However, as I read the docs and make some attempts with the DBI method, the
only binding I see (bind_col, bind_columns) is only for SELECT statements.
Is there a way to do this in DBI model so that my scalars are not expanded
into the SQL statement but just dumped to the database as is??
Thanks,
Rich Schramm
------------------------------
Date: Tue, 27 Jan 1998 13:37:42 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: -=Falcon=- <Falcon@darkwave.org.uk>
Subject: Re: Perl (4) and images in the code....
Message-Id: <Pine.GSO.3.96.980127133541.22373g-100000@user2.teleport.com>
On Tue, 27 Jan 1998, -=Falcon=- wrote:
> Question, using Perl 4 (yes I know it's not 5 but that just makes it
> more interesting), is it possible to import a .JPG file as a line
> (or lines) of text (probably ascii escaped) and then at a later point
> in the code, shove it back onto the browser?
Almost certainly, in much the same way that it's possible to redirect the
program's output to the clay tablet printer. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 14:54:21 -0600
From: "Craig A. Keefner" <keefner@kinetic.com>
To: Jason Vallery <vallery@bvsd.k12.co.us>
Subject: Re: Perl and IIS. Trying to get the server running.
Message-Id: <34CE497D.58066758@kinetic.com>
Two areas to look at:
1. Make sure your cgi-bin or virtual directory has the proper permissions
applied to it via the iis server admin.
2. your mime type have to set correctly. With IIS3 and perl, you had to
go into the registry to accomplish it sometimes. In IIS4 you should be able
to configure that from the administrator again (new feature).
craig
Jason Vallery wrote:
> We have NT Server 4.0 and ISS 4.0 as well. We can't seem to get a snigle
> Perl program to execute with a browser, I have went over every FAQ I could
> find and nothing, It asks us if we want to save the file to disk. I know
> to get around that I am supposed to use a '?' but that doesn't work
> either. We derpreatly need help getting this working as soon as possible.
> Any sugg. would be appreciated.
> Thanks.
------------------------------
Date: Tue, 27 Jan 1998 15:01:14 -0600
From: mgeorgeadis@fallschurch.esys.com
Subject: Perl script reading in HTML POST Form info
Message-Id: <885934437.719847431@dejanews.com>
Let me get right to the point. I'm constructing web pages using perl
scripts, which parse the info submitted from the previous form. However,
a security problem has arisen which added an additional password field
to the login page. Submission of the form info causes the fields and
values to appear in the URL. I know that the METHOD=POST option of
FORM in HTML solves this problem, but I'm not sure how to access the
info passed to the next perl script.( The GET Method passes the info
into the QUERY_STRING variable. The scripts now access and parse
out the info from QUERY_STRING.) Any ideas? Thanks.
-MG
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 27 Jan 1998 22:13:17 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
To: mgeorgeadis@fallschurch.esys.com
Subject: Re: Perl script reading in HTML POST Form info
Message-Id: <7x4t2p39jm.fsf@beavis.vcpc.univie.ac.at>
Re: Perl script reading in HTML POST Form info, mgeorgeadis
<mgeorgeadis@fallschurch.esys.com> said:
mgeorgeadis> that the METHOD=POST option of FORM in HTML
mgeorgeadis> solves this problem, but I'm not sure how to
mgeorgeadis> access the info passed to the next perl
mgeorgeadis> script.( The GET Method passes the info into
mgeorgeadis> the QUERY_STRING variable. The scripts now
mgeorgeadis> access and parse out the info from
mgeorgeadis> QUERY_STRING.) Any ideas? Thanks.
http://www-genome.wi.mit.edu/ftp/pub/software/WWW/
hth,
tony
------------------------------
Date: 27 Jan 1998 20:53:04 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: print<< into variable?
Message-Id: <6alhfg$qhn$1@marina.cinenet.net>
Tony L. Svanstrom (tony@svanstrom.com) wrote:
: What if I want to "print" to a variable a couple of times and I don't
: want to replace the information already in it?
:
: Right now I'm trying to rewrite a script that uses print to send some
: information to sendmail, I'd rather save it somewhere and then send it
: all to sendmail at the same time instead of a line at a time like it is
: now.
Use a list or scalar accumulator:
push @out, "And here's another line for sendmail...\n";
or
$buf .= "And here's another line for sendmail...\n";
(and similarly whenever you add something you eventually want to output
to sendmail), then
print SENDMAIL @out;
or
print SENDMAIL $buf;
just once when you've finished accumulating output.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 27 Jan 1998 21:39:19 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Survival Of perl
Message-Id: <6alk67$6jg@news.service.uci.edu>
In article <6ajes3$o58$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>You're seriously telling me that you're looking forward to giving threads
>to people who can't even understand critical sections, advisory locking,
>data integrity, shared file descriptors, mutexes, counting semaphores,
>signals, non-blocking I/O, fork, copy-on-write, or select? Is that
>right?
Yep. I would guess that a good part of Perl is already beyond
man programmers.
Many people use Perl to do serious work, and the programs are non
trivial. For those who want to use Perl to develop programs and are
concerned about performance, threads can provide a great use and do
better than forking many processes.
If Perl has threads, what's the need for Java? ;)
>The vast majority Perl users need threads the way a five-year-old
>needs an Uzi. Maybe even not that much.
The vast majority Perl users need fork() the way ...
>I for one do not look forward to that day.
>From the perspective of the hard-working folks that develop Perl,
I can understand the apprehension (ie. more work). On a users-side,
Perl needs it if it wants to stay on par with modern programming
languages.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Tue, 27 Jan 1998 15:06:32 -0600
From: "Craig A. Keefner" <keefner@kinetic.com>
Subject: system command and using variable in list
Message-Id: <34CE4C58.5059F995@kinetic.com>
project requires use of a dos executable so I'm
using NT4 and Fast Track with 315 win32 port.
executable can run at command line with arguments and create a file.
After gathering some user input, I can use system to execute it, write a file
that I then read and can use later, as long as listing parameters are explicit.
hard coded example using camaro:
open(JUSTDO, "|theexcefile.exe /m CAMARO >tmp/$$.file");
sleep(3);
close(JUSTDO);
open(RECONVERT, "tmp/$$.file");
while (<RECONVERT>)
{
$newbody .= $_;
}
close(RECONVERT);
Problem is that when I ask the use which model car and store it in $model, I'd
like
to use $model in the statement above. There isn't any other way to get the data
out of the source files without running the dos program.
Ideas?
Craig
------------------------------
Date: Tue, 27 Jan 1998 21:29:23 -0000
From: "Chris Lamb" <news@outline.ednet.co.uk>
Subject: UK download sites?
Message-Id: <6aljbf$2fv$1@monteverdi.ednet.co.uk>
Can anyone supply me with the address of UK download sites for Perl on Win32
(Specifically IIS4 on Server 4).
I am suffering terribly on Tuesday evening maintaining a trans_Atlantic
connection for a 1.5 Mb file!
Has a story broken out again about Clinton and everyone is calling the
states or is it that other thing he is doing, State of the Union or
something!
Cheers
Chris
------------------------------
Date: Tue, 27 Jan 1998 21:16:39 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: unix command pipes
Message-Id: <6aliva$2ms$1@cyprus.atlantic.net>
According to Sonya Allin <sja3@columbia.edu>:
>when i try to run my program at the command line, I write:
> ./myprogram.pl
>every time i try this, however, i get the error message
> 'permission denied'.
>i have chmod-ed my program so that it should be executable by anyone
I'll bet that the first line of the .pl file is not #!/usr/bin/perl
or whatever your Perl path is. It should be.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: Tue, 27 Jan 1998 20:52:58 GMT
From: jackstraw@notachance.net (Jack Straw)
Subject: Re: White Hats and Black
Message-Id: <34ce48ef.16068193@news.erols.com>
Forget the white AND black hats...
Try Opera, you'll be pleasantly surprised.
http://opera.nta.no
It's all I use anymore.
+;+;+;+;+;
Jack Straw
wnpxfgenj naba rstn bet
http://pgp5.ai.mit.edu:11371/pks/lookup?op=index&search=0x3D561045
**************************************************************************
When they took the 4th Amendment, I was quiet because I didn't deal drugs.
When they took the 6th Amendment, I was quiet because I am innocent.
When they took the 2nd Amendment, I was quiet because I don't own a gun.
Now they have taken the 1st Amendment, and I can only be quiet.
**************************************************************************
------------------------------
Date: Tue, 27 Jan 1998 15:22:22 -0600
From: cristi@obs-us.com
Subject: Win32 Perl & Internet Information Server 4.0 (NT)
Message-Id: <885935526.798228489@dejanews.com>
Hi,
IIS is not set up by default to handle perl scripts so I added .pl
extension to be handled by <drive>:\perl\perl.exe. When I try to make a
request like http://my_machine/some/directory/script.pl the IIS launches
perl.exe (I can see it in taskmanager window) but the server does not
pass the script name (script.pl) as argument for perl.exe and hence my
browser waits and the perl.exe process doesn't end, ever. Unless I
restart my machine which is abnormal and very annoing.
Please explain me how can I set up IIS 4.0 to handle Perl scripts!
10x
cristi
PS. CC to my e-address <cristi@obs-us.com>
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1743
**************************************