[13169] in Perl-Users-Digest
Perl-Users Digest, Issue: 579 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 18 19:07:33 1999
Date: Wed, 18 Aug 1999 16:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 18 Aug 1999 Volume: 9 Number: 579
Today's topics:
Adding up a Data Variable Completely Lost perl script <Ezjy@execpc.com>
Re: arghh! can't figure out s/// ! (Donovan Rebbechi)
Re: arithmetic right bit shift <Mark_Reibert-SC2762@email.mot.com>
Re: continual reading of file <chradil@acuitive.com>
Re: continual reading of file <chradil@acuitive.com>
GMT not local server time? <pelibriefNOptSPAM@aol.com>
Re: GMT not local server time? <All@n.due.net>
Re: GMT not local server time? <flavell@mail.cern.ch>
Re: Is it possible to send oneway message to perl cgi? (Donovan Rebbechi)
Re: Is it possible to send oneway message to perl cgi? <flavell@mail.cern.ch>
keep contents of new file when user ctrl-c's? <pnkflyd51@hotmail.com>
Re: keep contents of new file when user ctrl-c's? (brian d foy)
Re: keep contents of new file when user ctrl-c's? <meowing@banet.net>
looking for http spider to check local webs <karl@proline.at>
Re: ODBC & UNIX unicode_developer@my-deja.com
Re: Perl/ HTML form mail attachments <makkulka@cisco.com>
Re: Problem running CGI script <glenn.rix@ce.gatech.edu>
Re: pushing an anonymous hash slice (Greg Bacon)
Re: restoring variables for computation (Donovan Rebbechi)
Re: shell script translation <argyrodes@sympatico.ca>
Re: shell script translation (Donovan Rebbechi)
Re: shell script translation (Donovan Rebbechi)
Upload file via html and browse <internet@reimer.ch>
Re: What editors are folks using for PerlScript develop (Donovan Rebbechi)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 18 Aug 1999 17:23:18 -0500
From: "E-Z Auction" <Ezjy@execpc.com>
Subject: Adding up a Data Variable Completely Lost perl script
Message-Id: <7pfbhb$78f@newsops.execpc.com>
Hi,
I am trying to add up the last field in a data file, and then cause
another event to occur when it reaches a limit set in the data file. any
tips, examples, information of a helpful manner are welcome, and encouraged.
the data is arraigned in this manner:
###########################
field1
field 2
field 3
field 4
data1[]data2[]data3[]data4[]data5 # line 1
data1[]data2[]data3[]data4[]data5 # line2
data1[]data2[]data3[]data4[]data5 # line3
#############
#line is not actually in the data file just put it there for explanation
purposes
field 4 will be a number
data 5 will be a number
What I need to do is starting with the most recent line (in this example it
would be line three) take the data5 variable and compare it against field 4.
If data5 is less than field 4 then I need it to go to the line above it (in
this example it would be line two) and add that lines data5 to the other
(line3 again) data 5 and compare again against field 4. and continue on up
until field4 is met or exceeded
when data 5 meets the amount then I need to increase another variable thats
in the script but not in the data (this part I figured out already but for
the sake of this I will call it $inc
Heres the really tricky part lets say
Line3 data5 =2
Line2 data5 =4
field4 = 4
Ok,
reads line 3 data5 gets amount of 2 compares against field 4 value is not
met, goes back and reads line 2 data 5 ads that value(4) with line3 value(2)
making the total 6 compares against field4. oops amount is higher than what
it is suppose to be. Line 3 we want to leave alone because it is most
current. I want to decrease the value of line 2 data5 to the amount that
makes line 3 and line 2 data 5 fields equal to field 4 in this case line2
data 5 would become 2 (I would have it make a new data field but that will
mess up the next time this is run) oy once again I will need to increase the
other variable $inc.
Tia,
Michael Bruce
mike@e-zcomp.com
ezjy@execpc.com
http://www.e-zcomp.com
------------------------------
Date: 18 Aug 1999 18:00:54 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: arghh! can't figure out s/// !
Message-Id: <slrn7rmb8l.poq.elflord@panix3.panix.com>
On Wed, 18 Aug 1999 15:14:10 -0400, AL wrote:
>$string =~ s/' '/'\+'/;
You don't need quotation marks inside the slashes. The slashes are
delimiters ( ie like quotes. In fact you *could* use quotes instead of
slashes. )
You should have
$string =~ s/ /\\+/;
( you need \\ because \ is the "escape" character that you use to
quote special characters )
--
Donovan
------------------------------
Date: Wed, 18 Aug 1999 14:35:59 -0700
From: "Dr. Mark S. Reibert" <Mark_Reibert-SC2762@email.mot.com>
Subject: Re: arithmetic right bit shift
Message-Id: <37BB273F.B5008086@email.mot.com>
Never mind!
The lsb in PL_op->op_private is turned on by the "use integer" pragma,
thereby giving an arithmetic instead of logical shift. Wouldn't you know
the perlop man page tells you this if your MANPATH enviromnent variable is
pointing you to a Perl version >= 5.004!
Mark Reibert
"Dr. Mark S. Reibert" wrote:
>
> Does anyone know where Perl's arithmetic right bit shift went?
>
--
------------------------------
Mark S. Reibert, Ph.D.
Motorola SSTG (Datasoft Corp.)
Tel: 480-732-3752
Page: 800-759-8352 #7689193
Mail: sc2762@email.mot.com
------------------------------
------------------------------
Date: Wed, 18 Aug 1999 17:36:55 -0400
From: "christopher j. hradil" <chradil@acuitive.com>
Subject: Re: continual reading of file
Message-Id: <rrm9q2i0boh47@corp.supernews.com>
Although this is a subject in the perlfaq's, and you seem to know them
pretty well,
it's problably not the best way to "watch" a log file, which is what I
assume is the goal,
install File::Tail, and
Time::HiRes,
then try :
use File::Tail;
use strict;
my $name="/var/log/maillog";
my $line;
# tail file after reading
my $file =
File::Tail->new(name=>$name,maxinterval=>1,interval=>1,reset_tail=>1);
while (defined($line=$file->read)) {
splitter($line);
}
splitter is a subroutine to parse the lines of the log file,
later,
chris
--
Christopher J. Hradil, MCP
Sr. Consultant, Acuitive, Inc.
chradil@acuitive.com
http://www.acuitive.com
Direct (973)-809-4606
Office (973)-771-0456
FAX (973)-771-0457
Michel Dalle <michel.dalle@usa.net> wrote in message
news:7p9jb3$5ai$1@xenon.inbe.net...
> In article <yhXt3.2115$1B5.125845@monger.newsread.com>, "Darren Janisse"
<djanisse@northrock.bm> wrote:
> >
> >Hello,
> >
> > I am fairly new to Perl and am attempting to write a perl script
which
> >parses data from a sendmail log file. Is it possible to have a file open
in
> >perl for continual processing (i.e. perl would keep the maillog file open
> >and read any new data which is added to it)?
> >
> >Any suggestions would be greatly appreciated!
>
> Funnily enough, this is a FAQ (although you wouldn't know it if you're
> not familiar with Unix commands).
>
> Look in Perl FAQ 5, under "How do I do a tail -f in Perl ?"
>
> Michel.
------------------------------
Date: Wed, 18 Aug 1999 17:37:37 -0400
From: "christopher j. hradil" <chradil@acuitive.com>
Subject: Re: continual reading of file
Message-Id: <rrm9rd3sboh21@corp.supernews.com>
install File::Tail, and
Time::HiRes,
then try :
use File::Tail;
use strict;
my $name="/var/log/maillog";
my $line;
# tail file after reading
my $file =
File::Tail->new(name=>$name,maxinterval=>1,interval=>1,reset_tail=>1);
while (defined($line=$file->read)) {
splitter($line);
}
splitter is a subroutine to parse the lines of the log file,
------------------------------
Date: Wed, 18 Aug 1999 15:19:08 -0700
From: Pelican Brief <pelibriefNOptSPAM@aol.com>
Subject: GMT not local server time?
Message-Id: <0221c012.f79269f1@usw-ex0108-057.remarq.com>
Hello,
Is there any easy way to display the time in GMT with perl
instead of the standard local server time (which is
currntly EDT...)?
Any help is appreciated.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Wed, 18 Aug 1999 22:41:47 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: GMT not local server time?
Message-Id: <LEGu3.7091$y03.848@news.rdc1.ct.home.com>
Pelican Brief <pelibriefNOptSPAM@aol.com> wrote in message
news:0221c012.f79269f1@usw-ex0108-057.remarq.com...
: Hello,
:
: Is there any easy way to display the time in GMT with perl
: instead of the standard local server time (which is
: currntly EDT...)?
Oddly enough the function is called gmtime. <g>.
see perlfunc gmtime
or perldoc -f gmtime;
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--Random Quote--
'And I don't like doing silly things (except on purpose).'
Larry Wall in <1992Jul3.191825.14435@netlabs.com>
------------------------------
Date: Thu, 19 Aug 1999 00:26:33 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: GMT not local server time?
Message-Id: <Pine.HPP.3.95a.990819002611.27889B-100000@hpplus03.cern.ch>
On Wed, 18 Aug 1999, Pelican Brief wrote:
> Is there any easy way to display the time in GMT with perl
Try reading perldoc -f gmtime
------------------------------
Date: 18 Aug 1999 17:55:10 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: Is it possible to send oneway message to perl cgi?
Message-Id: <slrn7rmatt.poq.elflord@panix3.panix.com>
On Wed, 18 Aug 1999 19:47:07 GMT, yangsu@ustc.edu wrote:
>Maybe it sounds silly, but what I want is that when client sends
>a http request to perl cgi script, the client only cares about sending
>in the information and never cares about returning message, so after
>the client sends the message to server, it should return immediately
>(without waiting on the server processing)
>Is this possible? My experience is that it has to wait until cgi program
>finishes processing.
This is really a CGI question.
Anyway, one thing I can think of is that you could try fork()ing,
and have the parent process exit ( which keeps the client happy ) and
offload the grunt work to the child process. See man perlfunc for an intro,
and man perlipc for an in depth version.
--
Donovan
------------------------------
Date: Wed, 18 Aug 1999 23:55:39 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Is it possible to send oneway message to perl cgi?
Message-Id: <Pine.HPP.3.95a.990818235241.27889A-100000@hpplus03.cern.ch>
On Wed, 18 Aug 1999 yangsu@ustc.edu wrote:
> Maybe it sounds silly, but what I want is that when client sends
> a http request to perl cgi script, the client only cares about sending
> in the information and never cares about returning message, so after
> the client sends the message to server, it should return immediately
> (without waiting on the server processing)
This is a CGI question, the answer to which is waiting for you in Nick
Kew's CGI FAQ. CGI questions are best asked on the group
comp.infosystems.www.authoring.cgi, unless there's something
Perl-specific about them, which doesn't seem to be the case here.
http://www.htmlhelp.org/faq/cgifaq.3.html#8
have fun
------------------------------
Date: Wed, 18 Aug 1999 17:14:38 -0400
From: "AL" <pnkflyd51@hotmail.com>
Subject: keep contents of new file when user ctrl-c's?
Message-Id: <7pf7pm$3uh$1@autumn.news.rcn.net>
I'm sure this is in one of the FAQ sections, but I can't find the answer.
If it is out there, please point me in the right direction!
I'm going to be running a long script (okay, long for me, perhaps not you,
10+ hours) that outputs data to a new file. If for some reason the script
is ended w/ ctrl-c, I want the new file preserved. As it is now, if a
ctrl-c is done, the new file ends up empty.
What is the preferred way of doing this? I can think of three
possibilities, but don't know if any of them would work.
-Opening and closing the file after each write save each entry with the
possible exception of the current write (if ctrl-c is done during that
write).
-Clearing the file buffer after each write. Would this work? Is it only
possible by doing a
close(FH)?
-capturing the ctrl-c and exiting perl script gracefully. I saw a
suggestion on this in PerlFaq8, but it looks ugly!
I'm a little above my head on this one. Any insight would be helpful.
Thanks, Al
------------------------------
Date: Wed, 18 Aug 1999 17:57:29 -0400
From: brian@pm.org (brian d foy)
Subject: Re: keep contents of new file when user ctrl-c's?
Message-Id: <brian-ya02408000R1808991757290001@news.panix.com>
In article <7pf7pm$3uh$1@autumn.news.rcn.net>, "AL" <pnkflyd51@hotmail.com> posted:
> I'm sure this is in one of the FAQ sections, but I can't find the answer.
> If it is out there, please point me in the right direction!
>
> I'm going to be running a long script (okay, long for me, perhaps not you,
> 10+ hours) that outputs data to a new file. If for some reason the script
> is ended w/ ctrl-c, I want the new file preserved. As it is now, if a
> ctrl-c is done, the new file ends up empty.
trap the INT signal:
$SIG{INT} = \&prepare_to_exit;
then have the &prepare_to_exit routine do the clean-up. another way
to do this, depending on your situation, might be:
$SIG{INT} = sub { exit };
END { # do a bunch of stuff here }
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: 18 Aug 1999 18:22:08 -0400
From: meow <meowing@banet.net>
Subject: Re: keep contents of new file when user ctrl-c's?
Message-Id: <87u2pwd90v.fsf@banet.net>
AL <pnkflyd51@hotmail.com> wrote:
> I'm sure this is in one of the FAQ sections, but I can't find the answer.
> If it is out there, please point me in the right direction!
> I'm going to be running a long script (okay, long for me, perhaps not you,
> 10+ hours) that outputs data to a new file. If for some reason the script
> is ended w/ ctrl-c, I want the new file preserved. As it is now, if a
> ctrl-c is done, the new file ends up empty.
First, you probably want to turn on autoflushing for that output file.
The clear but expensive way (but for something that's going to be
running 10 hours, who cares?) is to use IO::Handle; also see perlvar
for $| which does the same thing.
That is probably all you really need, but to ensure a chance at
properly closing the file you will want to look at...
> -capturing the ctrl-c and exiting perl script gracefully. I saw a
> suggestion on this in PerlFaq8, but it looks ugly!
Why? There are some gotchas when dealing with signal handlers, but
most of them don't really matter if you're going to terminate the
process anyway. If it's the combined signal and sub assignment shown
in the FAQ that you don't like, use a "real" sub and do it as:
sub siginthandler {
# close files and stuff
}
$SIG{INT} = \&siginthandler;
------------------------------
Date: Thu, 19 Aug 1999 00:07:44 +0200
From: "Karl" <karl@proline.at>
Subject: looking for http spider to check local webs
Message-Id: <7pfapg$u1$1@fleetstreet.Austria.EU.net>
i am looking for a spider script/module wehre i can check the webs on the
local machine for consistency. only found treebuilder, but this reads the
physical file with local path. i want to check the webs by a http request
following all links inside http://MY_DOMAIN/*.
any tip would be great.
thanks
karl
austria
------------------------------
Date: Wed, 18 Aug 1999 21:48:32 GMT
From: unicode_developer@my-deja.com
Subject: Re: ODBC & UNIX
Message-Id: <7pf9nb$knp$1@nnrp1.deja.com>
Merant (formerly Intersolv) provides ODBC drivers for Unix
systems (I've been working on Solaris platform)
Their drivers are current (ODBC 3.50 specs)
I've successfully connected to Sybase database servers.
I believe they also support SQL Server 6.5 and Oracle.
In article <7p94c3$340$1@nnrp1.deja.com>,
pyammine@my-deja.com wrote:
> I am fairly new to perl and have a question.
>
> I have been researching into whether or not there is a way to get ODBC
> to work in UNIX. we currently have PERL connected through ODBC but on
> an IIS and were talking about ditching IIS and wasn't sure how much
> changes would have to be made.
>
> I noticed a lot of talk about using DBI instead of the win32::ODBC. So
> first, is it possible to use ODBC & UNIX and what is typically more
> favored the win32::odbc or DBI?
>
> Thanks in advance for your opinions.
>
> P
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 18 Aug 1999 14:59:31 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Perl/ HTML form mail attachments
Message-Id: <37BB2CC3.D663FBD@cisco.com>
[news wrote:
> How do you then attach the file in the perl script that calls sendmail?
> The example below will just send the path and name of the file that was
{ Code snipped..}
> print MAIL "Attachment: $FORM{'attachment'}";
You need to send mail as a multi-part MIME document using
separators to separate the different parts. You may want
to use readily available modules in the CPAN to do this
if you do not want to understand MIME stuff. If you
want to do it the hard way --the chunk of code I am
attaching might be of help. Notice the usage of the
separator string in this example...
use FileHandle ;
$fh = new FileHandle ( "formail.pl", "r" ) || die ;
$resultsfile="attachment-file" ;
@_to=( 'myself@myDomain.com' ) ;
open ( MAIL, "| /usr/lib/sendmail -t" ) || die
" Tragic Death !. Heck with Sendmail -- check pathname for
sendmail..\n" ;
print MAIL map { "To:". $_ . "\n" } @_to unless ( scalar (
@_to) ==0 ) ;
print MAIL map { "Cc:". $_ . "\n" } @_cc unless ( scalar ( @_cc
) == 0) ;
print MAIL map { "Bcc:". $_ . "\n" } @_bcc unless (scalar (
@_bcc ) == 0) ;
print MAIL "From:somebody\@somewhere.com\n" ;
print MAIL "Subject: Your subject line here..\n" ;
print MAIL "MIME-Version: 1.0\n" ;
print MAIL "Content-Type: multipart/mixed;
boundary=\"gc0y0pkb9ex\"\n";
print MAIL "-------------------------------------\n";
print MAIL "\n";
print MAIL "This is a multipart message in MIME format \n";
print MAIL "\n--gc0y0pkb9ex\n" ;
print MAIL "Content-type: text/plain; charset=\"iso-8859-1\";\n";
print MAIL " Your message here.. \n" ;
print MAIL "\n--gc0y0pkb9ex\n" ;
print MAIL "\n--gc0y0pkb9ex\n" ;
print MAIL "Content-type: text/plain; charset=\"iso-8859-1\"\n";
print MAIL "Content-Disposition:
attachment;filename=\"$resultsfile\"\n\n";
print "\n\n\n";
while (<$fh>) { print MAIL; } ;
$fh->close;
print MAIL "\n--gc0y0pkb9ex\n" ;
print MAIL "\n--gc0y0pkb9ex--\n" ;
close(MAIL) ;
--
$resultsfile is used by the Mail user Agent at the recieving end to name
the resulting attachment file.
------------------------------
Date: Wed, 18 Aug 1999 18:15:11 -0400
From: "Glenn J. Rix" <glenn.rix@ce.gatech.edu>
Subject: Re: Problem running CGI script
Message-Id: <7pfbel$7jg$1@news-int.gatech.edu>
Hello Sumathi,
You may wish to check the server configuration guidelines at
http://www.activestate.com/ActivePerl/docs/perl-win32/perlwin32faq6.html
Glenn J. Rix
Georgia Institute of Technology
<ksumi@my-deja.com> wrote in message news:7pe9j9$ql7$1@nnrp1.deja.com...
> Hi world,
>
> I am new to the perl world and I have problem in running my CGI script.
>
> It goes this way.
>
> I have a html program which has a aref link to a cgi script.
> The cgi script is supposed to display a html file.
>
> The problem is .html files are showing as HTMl source rather than being
> formatted.
>
> I am running MicrosoftPWS on windows 98.
> My perl is under c:\per\bin ( frm activestate.com )
> My script is under file://localhost/cgi-bin ( which is c:
> \inetpub\wwwroot\cgi-bin )
> My calling HTML file is under file://localhost ( c:\inetpub\wwwroot ).
>
> Am I missing out something. I am able to run normal cgi scripts
> ( reading a file etc ) at the command prompt.
>
> My first print statement in the script ofcourse says the mime-type
> /text/html.
>
> Do I need to set something in my web browser ( IE 4.0 ).
>
> Kindly help.
>
> Thanks
>
> Sumathi
>
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: 18 Aug 1999 21:58:21 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: pushing an anonymous hash slice
Message-Id: <7pfa9t$nj0$1@info2.uah.edu>
In article <x7so5gygsb.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> writes:
: GB> If @a and @b are different lengths, then you end up with undefs in the
: GB> result. There's also the minor gripe about the calling context
: GB> propagating to the map().
:
: i did mention the differing lengths issue. but it is not well defined
: how to interleave two arrays of differing lengths. do you truncate, pad
: or just append the tail of the longer one? all are valid but need
: different code.
Here's the MW definition of `interleave':
to arrange in or as if in alternate layers
If someone handed you two decks of cards and asked you to interleave
them, most people wouldn't be happy if you inserted other cards. At
the same time, they also wouldn't be happy if you threw some cards
away.
: i assumed equal lengths in advance as you should check
: or know that before you merge in most cases. in the original post, the
: lengths were known to be equal as one list was keys and the other an
: array slice.
I disagree. The real question when it comes to interleaving is "how
should I interleave the objects?". Do I take three of one and two of
the other? I'm still waiting for mjd (or Abigail?) to chime in with a
way to interleave an aribitrary number of arrays by arbitrary rules. :-)
: also propogating the calling context to the map is the user's
: problem.
That's an interesting approach to writing useful software.
: this function obviously must return a list so assuming a useful
: value in a scalar context is dumb. what would you want, the last value
: of the merge? or if it was generated in a temp array, the size of the
: array?
A reference to the resulting array? A count of objects in the resulting
array? Launching nethack? :-) There are plenty of valid results in
scalar context.
: GB> # 'twould be nice to have lazy eval here
:
: or first.
The hypothetical first() implies the existence of lazy evaluation.
: on the original topic, making an interleaved list is more general than what
: building a hash needs.
I like generality.
Greg
--
PC Bulletin: Henceforth, sentient computers would like to be known as
'Silicon Intelligences.' 'Artificial Intelligence' is a pejorative term
invented by humans based on the mistaken belief that computers are somehow not
'natural.' -- Elf Sternberg
------------------------------
Date: 18 Aug 1999 18:09:16 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: restoring variables for computation
Message-Id: <slrn7rmbob.poq.elflord@panix3.panix.com>
On Wed, 18 Aug 1999 11:24:38 -0500, liberator.net wrote:
>I have figured out that textfield names are restorable with the
>'import_names()' command. However, I can't seem to figure out how to
>restore variables. If I construct $a, how do I recall it on the second pass
>of the same script? Can I also use these restored variables to do
>computation?
You could store your data (ie variables ) in a file.
This is well covered in the FAQs ( eq perlfaq4 ). you can use something
like FreezeThaw, Storable, or DB_File.
--
Donovan
------------------------------
Date: Wed, 18 Aug 1999 21:22:34 GMT
From: Norman Crooks <argyrodes@sympatico.ca>
Subject: Re: shell script translation
Message-Id: <37BB278E.80E7FE2D@sympatico.ca>
Okay,
Let me amend that. I know a little about perl, but not enough. Specifically, I don't know
how to pass the HOME environment variable to the pgp executable from perl. Hence I am asking
for salient suggestions.
I don't understand why there are so many uptight people in this group. This is NOT directed
at you Tom, you sound nice enough, but I received three glib e-mails after posting my
question telling me how I should wise up instead of pestering the group with such a basic
question. I've seen this sort of response leveled at many beginner questions in this group.
Personally I am involved in many hobbies, and professionally I am skilled in SQL, IDC, ASP,
HTML, design, etc., and I'm active in many relevant newsgroups. If I encounter a question in
a newsgroup that I can easily answer, even a misguided one, I answer it. What I don't do is
waste my time telling people not to ask, to make myself feel like a big shot.
Anyways, I'm not soliciting a flame war, I have no time for such juvenile b.s. I'm just
wondering why people who have nothing constructive to say bother saying anything?
-Norm
Tom Kralidis wrote:
> If you know nothing about Perl, why would you want to have this
> converted? How would you be able to debug, etc.?
>
> Advice: learn (something about) Perl, and give it a go, rather than dump
> this to the group. You'll find that it's not that complicated to make
> your script into Perl.
>
> ..Tom
>
> Norman Crooks wrote:
> >
> > Hello Perl Group,
> >
> > Can someone help me convert this short shell script into a perl script?
> >
> > #!/bin/sh
> > echo "Content-Type: text/html\n\n"
> > HOME="/server/www/homepage"
> > export HOME
> > echo $HOME
> > echo "<h1>test\n\n</h1>"
> > /server/www/homepage/.pgpdir/pgp -eatw
> > /server/www/homepage/cgi-bin/filename.txt Stricker 2>&1
> > #/usr/local/bin/perl -e '`/server/www/homepage/.pgpdir/pgp -eatw
> > /server/www/homepage/cgi-bin/filename.txt Stricker`' 2>&1
> >
> > echo
> >
> > I know nothing about perl, but I do know that the pgp executable has to
> > know that it is in "/server/www/homepage" to be able to find all it's
> > files.
> >
> > I thought the perl command for this should look like $ENV{HOME} =
> > "/server/www/homepage", but I couln't get this to work.
> >
> > Any help much appreciated.
> > -Norm
> > argyrodes@nospamsympatico.ca
>
> --
>
> -----------------------------------------------------------------------------------------
> Tom Kralidis Geo-Spatial Technologist
> Canada Centre for Remote Sensing Tel: (613) 947-1828
> 588 Booth Street , Room 241 Fax: (613) 947-1408
> Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
> -----------------------------------------------------------------------------------------
------------------------------
Date: 18 Aug 1999 17:43:18 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: shell script translation
Message-Id: <slrn7rma7l.poq.elflord@panix3.panix.com>
On Wed, 18 Aug 1999 11:22:18 GMT, Norman Crooks wrote:
>Hello Perl Group,
>
>Can someone help me convert this short shell script into a perl script?
You don't need to. There's nothing to stop you having a shell script
as a CGI.
--
Donovan
------------------------------
Date: 18 Aug 1999 17:45:22 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: shell script translation
Message-Id: <slrn7rmabh.poq.elflord@panix3.panix.com>
On Wed, 18 Aug 1999 21:22:34 GMT, Norman Crooks wrote:
>how to pass the HOME environment variable to the pgp executable from perl.
You should have been more specific.
Your HOME variable is
$ENV{HOME}
in perl, like shellscript, variables are expanded inside single ( but
not double ) quotes.
But I *still* don't see why you think that CGI only works when you do
it in perl
--
Donovan
------------------------------
Date: Wed, 18 Aug 1999 10:03:44 +0200
From: Patrick Stalder <internet@reimer.ch>
Subject: Upload file via html and browse
Message-Id: <37BA68E0.2F01ACD@reimer.ch>
Hi,
I have create a html page with a form, on which I can upload a file to
the server via directly via browser. The perl program receive this file
and
save this to the local disk. This process is working correctly. But if I
upload
a file larger than 50 KByte, the server cut this file and save only the
first 50 Kbyte.
I am using a NT server 4.0 with service pack 5.0 and IIs 4.0.
Has anyone the same problems? Maybe it is a configuration problem of IIs
4.0!
Thanks for your help
Patrick
_________________________________________
REIMER AG
Internet Management Consulting
Seestrasse 13
8702 Zollikon
Switzerland
Tel. +41 1 395 2000
Fax +41 1 395 2008
URL: http://www.reimer.ch
E-Mail: internet@reimer.ch
__________________________________________
------------------------------
Date: 18 Aug 1999 18:15:37 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: What editors are folks using for PerlScript development?
Message-Id: <slrn7rmc48.poq.elflord@panix3.panix.com>
On Tue, 17 Aug 1999 11:27:52 -0700, Ken Snyder wrote:
>What editors are folks using for PerlScript development under Windows? I
>have had some success with Homesite but would like to use Visual Interdev.
>Is there anyway to get Interdev to parse Perl? Is there a better editor I
>should use instead?
I use vim ( which is based on vi ) . It has many nice features,
including syntax highlighting for perl scripts and support for tags
( ie jump-to-function ). It is available for Windows.
--
Donovan
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 579
*************************************