[9777] in Perl-Users-Digest
Perl-Users Digest, Issue: 3370 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 5 18:07:20 1998
Date: Wed, 5 Aug 98 15:00:23 -0700
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, 5 Aug 1998 Volume: 8 Number: 3370
Today's topics:
Re: -- Can Multiple ACTIONS be called from one POST? (Alastair)
Re: And sometimes the FAQ's suck (Albert W. Dorrington)
Re: And sometimes the FAQ's suck (I R A Aggie)
Re: Attaching a file to an email with a cgi script (Chris Russo)
Configuring Win32 Perl with IIS <support@ichat.com>
Re: file modification (Jeff Yoak)
Re: Frames <perlguy@inlink.com>
Re: hiding user input (Gary L. Burnore)
Re: hiding user input <johnc@interactive.ibm.com>
Re: Interesting Question needs Quick Answer (I.J. Garlick)
Re: Newbie: Objects indhiraa@hotmail.com
perl and sendmail <sgoodyear@genxsys.com>
Re: perl and sendmail <rootbeer@teleport.com>
Re: Perl+MS SQL bjohnsto@usa.net
Re: perl5 bug? (Mark-Jason Dominus)
Re: perlfaq - frequently asked questions about Perl (pa (John Stanley)
Re: perlfaq - frequently asked questions about Perl (pa (Alastair)
Re: perlfaq - frequently asked questions about Perl (pa <p-fein@uchicago.edu>
Re: Reading in one file and writing to another <mpgromm@sandia.gov>
Retrieving file from REMOTE_ADDR ... HELP! (Hector Catre)
Re: Retrieving file from REMOTE_ADDR ... HELP! <rootbeer@teleport.com>
Rights <kandiko@vbe.com>
Re: Rights <rootbeer@teleport.com>
Re: Setting $ENV{LD_LIBRARY_PATH} doesn't work (Todd Hivnor)
Re: simple regexp <evhendrs@micron.net>
Re: Single word ouptu from aa array (I.J. Garlick)
Re: split & empty patterns <matthies@fsinfo.cs.uni-sb.de>
Re: split & empty patterns <rootbeer@teleport.com>
stuck: variable replacement within backquote escape? <wynn@americasm01.nt.com>
Re: stuck: variable replacement within backquote escape <rootbeer@teleport.com>
Re: Teaching Perl <minich@globalnet.co.uk>
Re: Variable Length & Memory? <agy@macgreg.com>
When is the "Perl Cookbook" coming out? <digital_puer@hotmail.com>
Re: When is the "Perl Cookbook" coming out? (Mark-Jason Dominus)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Aug 1998 20:30:02 GMT
From: alastair@psoft.co.uk (Alastair)
Subject: Re: -- Can Multiple ACTIONS be called from one POST?
Message-Id: <6qafca$jf4@handupme.avid.com>
Webcruiser <kamenar@yeahright.net> wrote:
>On a submit, can I call two different cgi scripts from one submit
>action? If so, how?
Not sure if this is actually a perl question ...
I suppose, if you can call one program via the web, you can use that
one to do whatever you want. Including running another program.
Or am I missing something?
--
Alastair
Avid Effects
alastair@psoft.co.uk
------------------------------
Date: 5 Aug 1998 14:57:47 -0500
From: awdorrin@mail.delcoelect.com (Albert W. Dorrington)
Subject: Re: And sometimes the FAQ's suck
Message-Id: <6qadfr$3n2@ws051eng.ictest.delcoelect.com>
In article <6qabmb$2m9$3@info.uah.edu>, gbacon@cs.uah.edu (Greg Bacon) writes:
:> In article <6qa4ps$3ft@ws051eng.ictest.delcoelect.com>,
:> awdorrin@mail.delcoelect.com (Albert W. Dorrington) writes:
:> : So if a users misses .085 % of the notes, they don't have any
:> : business on Usenet - interesting rationale, not very logical, but
:> : interesting.
:>
:> The wisdom imparted by n.a.newusers tells new users to seek out these
:> very special documents. People who haven't read all the articles in
:> n.a.newusers have no business posting. I wish more news admins would
:> go back to this policy.
:>
:> Greg
I started using Usenet back in '92 and no one at that time
ever mentioned the n.a.newusers newsgroup. Since then
I've only found out about that newsgroup since it has recently
shown up within our firewall.
No administrator at my former school, or at my current employer
has ever mentioned, suggested or required users to review that
documentation.
Most users learn about Usenet when someone shows them a news
reading tool, and they start playing around with it.
Sure, I too wish that newbies were more knowledgable about
netiquette when they first start out, but you have to be realistic.
All I can really say is that it has been shown time and time
again that positive re-inforcement works much better than
negative re-inforcement.
Other than that, just remember what your mother told you:
"If you don't have anything nice to say, don't say anything at all."
- Al
--
Al Dorrington
FIRMS & Web Admin, Oracle DBA Phone: 765-451-9655
IC-DELCO CIM, Delphi Delco Electronics Systems Fax: 765-451-8230
------------------------------
Date: Wed, 05 Aug 1998 14:54:06 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: And sometimes the FAQ's suck
Message-Id: <fl_aggie-0508981454070001@aggie.coaps.fsu.edu>
In article <6qa4ps$3ft@ws051eng.ictest.delcoelect.com>,
awdorrin@mail.delcoelect.com (Albert W. Dorrington) wrote:
+ I stand corrected - looks like my newsreader has been kind enough
+ to filter out crossposted messages from other newsgroups, which
+ explains why I haven't seen these messages.
You mean you didn't see gnat's post of:
*** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly ***
The copy on my server said it had be posted to clp.misc group and wasn't
xposted elsewhere. Even a complete greenhorn should be able to grok the
meaning of that subject...
+ So if a users misses .085 % of the notes, they don't have any
+ business on Usenet - interesting rationale, not very logical, but
+ interesting.
No, if they don't know how to search for what they seek. My newsreader,
for instance, permits me to do a Subject search on the local server.
My search for "FAQ" turned up both Tom P's post and gnat's.
+ Just count me as another person who doesn't care for the
+ condecending, snobish, holier-than-thou attitudes of some
+ of the supposed 'experts' on this list.
Then follow your own advice and skip those posts...
One thing about the FAQ that gets relatively little mention is this:
the answers are as near to perfect as one can get. They've been looked
at by thousands of people, tried on various versions of perl, on systems
both popular and obscure. Corrections and suggestions have been made and
implemented, and what's left is pure gold.
For those who say the FAQs are incomprehensible, I would say that they
should learn to walk before trying to fly.
James
------------------------------
Date: Wed, 05 Aug 1998 14:09:01 -0700
From: news@russo.org (Chris Russo)
Subject: Re: Attaching a file to an email with a cgi script
Message-Id: <news-0508981409010001@buzz.hq.alink.net>
In article <6qa9v3$pcd$1@nnrp1.dejanews.com>,
chris_wellner@my-dejanews.com wrote:
>Thanks much, because I've been stuck looking around for quite some time to no
>avail.
If you can't find a module that does this, make your own MIME headers.
It's not hard to create simple ones "by hand". Send yourself a test email
message with an attachment, and then take a look at the file that is
generated directly in your mail spool.
If that's not enough, my consulting rates are very reasonable. :)
Regards,
Chris Russo
--
Chris Russo
news@russo.org
http://www.russo.org
------------------------------
Date: Wed, 05 Aug 1998 16:41:46 -0500
From: John Warner <support@ichat.com>
Subject: Configuring Win32 Perl with IIS
Message-Id: <35C8D19A.3DCC64F5@ichat.com>
*Flame suit on*
I realize this may be slightly off topic for this group
but..
I recently installed Perl 5.004_471 (ActiveState) on my NT
Workstation which is running IIS 4. I have been able to set
some Perl scripts to run under IIS. About the same time
that I installed IIS 4, I discovered the Lincoln Stein's
_Official Guid to Programming with CGI.pm_. When I
attempted to run the following code from the book, both IIS
and Perl (I pointed the script at both PerlIS.dll and
Perl.exe) to completely take over the CPU. The only way I
could recover was to reboot the machine. Does anyone know
if there is a problem with the CGI.pm that comes with the
ActiveState build of Perl? Is it an old version that needs
to be upgraded or what?
use CGI qw(:standard);
use POSIX 'strftime';
# print the HTTP header and the HTML document
print header,
start_html('A Virtual Clock'),
h1('A Virtual Clock');
print_time();
print_form();
print end_html;
# print out the time
sub print_time {
my($format);
if (param) {
$format = (param('type') eq '12-hour') ? '%r ' : '%T
' if param('time');
$format .= '%d ' if param('day');
$format .= '%B ' if param('month');
$format .= '%A ' if param('day-of-month');
$format .= '%Y ' if param('year');
} else {
$format = '%r %A %B %d %Y';
}
$current_time = strftime($format,localtime);
print "The current time is
",strong($current_time),".",hr;
}
# print the clock settings form
sub print_form {
print start_form,
"Show: ",
checkbox(-name=>'time',-checked=>1),
checkbox(-name=>'day',-checked=>1),
checkbox(-name=>'month',-checked=>1),
checkbox(-name=>'day-of-month',-checked=>1),
checkbox(-name=>'year',-checked=>1),
p(),
"Time style: ",
radio_group(-name=>'type',
-values=>['12-hour','24-hour']),
p(),
reset(-name=>'Reset'),
submit(-name=>'Set'),
end_form;
}
Any help would be appreciated.
*Flame suit off*
John Warner
Acuity Technical Support
http://support.acuity.com
------------------------------
Date: Wed, 05 Aug 1998 20:04:09 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: file modification
Message-Id: <ZU2y1.1343$N3.1917047@newse2.tampabay.rr.com>
Adam Ipnarski <adam@fastfare.co.uk> wrote:
>wilgro@my-dejanews.com wrote:
>>
>> Hello,
>>
>> I am looking for a program that will take a text file and add a line to it
>> at the beginning without needing to pull the whole file in, modify it and
>> then save it again.
>> -[snip]-
>As fare as I am aware, you can't just append to the beginning of a file
>and 'bump' the rest of the file forward (if you want to replace the
>first line, just
>open(FILE, "+<filename.txt"); seek(FILE, 0, 0); print FILE $line; close
>(FILE);
You can only do this if $line happens to be of exactly the same length
as the current first line of the file. The best way to deal with this
is located in the FAQ, as other posters have pointed out.
Cheers,
Jeff
--
Jeff Yoak jeff@yoak.com
------------------------------
Date: Wed, 5 Aug 1998 18:19:14 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Frames
Message-Id: <35C8A222.B0E80B5C@inlink.com>
Try a:
print header();
BEFORE you do any other print statements.
When printing your output to the web, you MUST tell it what kind of data
is being sent. The command above sinmply does a:
print "Content-type: text/html\n\n";
Try it.
Brent
Norman Bunn wrote:
>
> When I run a perl program to generate HTML for frames, I receive:
>
> CGI Error
> The specified CGI application misbehaved by not returning a complete set of
> HTTP headers. The headers it did return are:
>
> <html>
> <head>
> <title>my title</title>
> </head>
> <frameset cols='23%,77%'>
> <frameset rows='66%,*'>
> <frame src=ordermenu.html name=ordermenu>
> <frame src=picture.html name=picture>
> </frameset>
> <frameset rows="*,25">
> <frame src=ordermain.html name=ndsmain marginwidth=1 marginheight=1>
> <frame marginheight=0 src=/desktopindex.html name=desktopindex
> scrolling=no>
> </frameset>
> </frameset>
> </html>
>
> The HTML is okay, as it displays fine when copied and pulled up in a
> browser. The program works fine from the command line. Any ideas why this
> is happening under NT 4.0 and IIS 4? Here's the source:
>
> #!c:/perl/bin/perl
>
> use CGI qw(:all);
> #####################################################
>
> print "<html><head><title>my title</title></head>";
> print "<frameset cols='23%,77%'>";
> print "<frameset rows='66%,*'>";
> print "<frame src=ordermenu.html name=ordermenu>";
> print "<frame src=picture.html name=picture>";
> print "</frameset>";
> print "<frameset rows=\"*,25\">";
> print "<frame src=ordermain.html name=ndsmain marginwidth=1
> marginheight=1>";
> print"<frame marginheight=0 src=/desktopindex.html name=desktopindex
> scrolling=no>";
> print "</frameset>";
> print "</frameset>";
> print "</html>";
>
> Norman
> norman.bunn@mci.com
------------------------------
Date: Wed, 05 Aug 1998 20:05:01 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cabae3.146925435@nntpd.databasix.com>
On 5 Aug 1998 18:01:50 GMT, in article <6qa6me$hhf$2@client3.news.psi.net>,
abigail@fnx.com (Abigail) wrote:
>Greg Bacon (gbacon@cs.uah.edu) wrote on MDCCC September MCMXCIII in
><URL: news:6q9u5q$mk7$10@info.uah.edu>:
>++ In article <35d28369.67175268@nntpd.databasix.com>,
>++ gburnore@databasix.com (Gary L. Burnore) writes:
>++ : Yep, chris. Ignore me. Continue to let people like Abigail shit on peop
>++ : when someone says something about it, be sure to ignore them.
>++
>++ Why do your protests have to be public? Wouldn't a polite private
>++ message to Abigail have suited your needs just as well? Does your
>++ emailphobia prevent you from doing this?
>
>
> I DO NOT WISH TO RECEIVE EMAIL FROM THINGS CALLED BURNORE.
And you won't, bitch.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Wed, 05 Aug 1998 17:08:00 +0000
From: John Call <johnc@interactive.ibm.com>
Subject: Re: hiding user input
Message-Id: <35C89153.91AF1746@interactive.ibm.com>
> I offer my most sincere apology if
> you thought I was speaking on Abigail's (or anyone else's behalf). I
> can only take responsibility for and make promises about my own
> behavior.
>
> You'll witness that I haven't bashed anyone for posting a FAQ here.
You are correct and I apologize for writing as if you had bashed someone.
> You say the
> atmosphere is nicer elsewhere, but what is a typical ratio of FAQ to
> non-FAQ posts in those groups?
Well, the other group I visit a lot is the linux.misc group and there is a lot
of FAQ (what they call HOWTO) traffic in there. It is responded to by politely
pointing to the correct HOWTO most of the time.
> This group is not obsolete. This group still needs to be
> useful. FAQ flooding and usefulness are forces in opposing directions.
>
> Greg
I agree with you to a point but would like to ask this: What if someone doesn't
know about the FAQs? It could happen. When I first started programming Perl I
knew about the newsgroup before I knew about the FAQs. That could happen to
others. Now, I know that people should research better before asking here but if
they don't we still shouldn't knock them in the head about it.
One thing I can say I appreciate is good, honest discussion even in the midst of
disagreement. It bothers me more to see the regulars here at each others throats
than to see a bashing over the FAQs.
Thanks again,
John Call
------------------------------
Date: Wed, 5 Aug 1998 09:11:46 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: Interesting Question needs Quick Answer
Message-Id: <Ex7LJM.347@csc.liv.ac.uk>
In article <m31zqx2k2b.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> writes:
> I J Garlick <ijg@csc.liv.ac.uk> writes:
>
>> Now could you explain it? (I have only been learning Perl since April
>> and Patrick started last Tuesday)
[snipped]
Thanks Russ, the explanation deffinitely did the business.
And might I also take the oppertunity to thank everyone who responded.
Is anybody interested in the solution from the seter of the question?
--
--
Ian J. Garlick
ijg@csc.liv.ac.uk
Children are unpredictable. You never know what inconsistency they're
going to catch you in next.
-- Franklin P. Jones
------------------------------
Date: Wed, 05 Aug 1998 20:37:46 GMT
From: indhiraa@hotmail.com
Subject: Re: Newbie: Objects
Message-Id: <6qafqr$4bj$1@nnrp1.dejanews.com>
>
> I've hit a stumbling block pretty early on:
>
> #!/usr/local/bin/perl
>
> $a = TEST::new('Foo');
Oops, wrong invocation. Here you call this just like an ordinary
subroutine. So you should pass the class name explicitly.
$a = TEST::new("TEST", 'Foo');
Hope it helps,
Indira.
> print 'a: ', ref $a, "\n";
>
> $b = TEST->new('Foo');
> print 'b: ', ref $b, "\n";
>
> $c = new TEST ('Foo');
> print 'c: ', ref $c, "\n";
>
> $a->test;
> print "\n";
> $b->test;
> print "\n";
> $c->test;
>
> package TEST;
>
> sub new
> {
> my $this = shift;
> my $class = ref($this) || $this;
> my $arg = shift;
>
> my $self = {
> arg => $arg,
> };
>
> bless $self, $class;
> return $self;
> }
>
> sub test
> {
> my $self = shift;
>
> print "$self->{arg}\n";
> }
> __END__
>
> After looking through perlbot and perlobj (To be honost, I haven't read
> these as thoroughly as I should.), I'm not sure why I get:
>
> a: Foo
> b: TEST
> c: TEST
> Can't locate object method "test" via package "Foo" at ./tst line 12.
>
> When I comment out the direct notation $a = TEST::new('Foo'); I get the
> expected results. Why doesn't the direct notation work? What's going
> on?
>
> --
> Matt Knecht - <hex@voicenet.com>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 5 Aug 1998 16:13:44 -0400
From: "Steve Goodyear" <sgoodyear@genxsys.com>
Subject: perl and sendmail
Message-Id: <35c8bc67.0@news.destek.net>
how do I pass an email message to perl for parsing?
I realize I can alias a program in the aliases file, but i'm not sure how it
passed the message to a program.
------------------------------
Date: Wed, 05 Aug 1998 20:18:45 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: perl and sendmail
Message-Id: <Pine.GSO.4.02.9808051318120.14291-100000@user2.teleport.com>
On Wed, 5 Aug 1998, Steve Goodyear wrote:
> how do I pass an email message to perl for parsing?
The docs, FAQs, and newsgroups about sendmail should be able to help you
with this. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 05 Aug 1998 21:33:36 GMT
From: bjohnsto@usa.net
Subject: Re: Perl+MS SQL
Message-Id: <6qaj3g$9lh$1@nnrp1.dejanews.com>
In article <m6lx1.135$H11.540024@ptah.visi.com>,
seebs@plethora.net (Peter Seebach) wrote:
>
> >DBI 0.92 and DBD::Sybase 0.08 work just fine with Sybase11 Open Client HP/UX
> >connecting to MS SQLServer 6.5. So far, so good.
>
> Can you clarify this? I'm a bit weak on how SQL really works under the hood,
> am I correct in inferring that you apparently must have some SQL stuff
> already installed on a machine to connect to an SQL server? If so, what's
> a good free one? :)
Client server databases require a database driver.
A client program interfaces to a database drivers which interfaces to a
database server. This database driver has to be installed on the machine
running the program that issues the queries.
The programming interface (API) between the program issuing the queries and
the database drivers is different for each of the different vendors. One
vendor, Sybase has two API's ctlib and dblib.
However DBI for perl, JDBC for Java, and ODBC for many different languages
are a standard API's for programs which need to interface with database
drivers.
The wire interface (protocol) between the database driver and the database
server is in general different for different database vendors, ie Oracle,
Sybase, DB2, and Informix.
At one stage the Microsoft had Sybase port their server to create MS-SQL
server. Although I don't believe that Microsoft SQL-Server is still based on
this code (A Sybase manager told MS-SQL server was not based on Sybase code),
it is compatible with it this older version (I think Version 4.9 not System
10) of Sybase. This is why Sybperl and a Sybase database driver may work with
MS-Sql.
There are no free database drivers for any of the databases to my knowledge.
I think Microsoft Office comes with an ODBC driver for MS-SQL server. Some
ODBC drivers need another (native to the database server) driver as well to
function and merely map one API to another. Others implement all that is
required on the client and talk directly to the database server.
There is an ODBC DBI for Perl which I have used. The documentation said it
was not tested etc, but I had no problems with my limited use.
If the Sybase stuff works well and Microsoft says that do not support that
solution DON'T WORRY. Microsoft does not acutally provide much useful
support for anything so there is no difference. We found a big in Excel 3.0.
It was still in Excel 4.0, it got more pervasive 5.0 and stayed up to Excel
7.0. After much time with Microsoft Tech Support they agreed it was a bug
and said they had no intention of fixing it. Time was wasted with MS support
staff on the release of every version. In my experience Sybase support is
excellent. Maybe they can have a sideline of selling support for accessing
MS-SQL server from Unix machines.
> -s
Hope this helps.
Brendan Johnston
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 5 Aug 1998 17:35:40 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: perl5 bug?
Message-Id: <6qaj7c$sta$1@monet.op.net>
In article <uh1y1.1444$1Z1.1659958@news3.atl.bellsouth.net>,
Mission A/V <dan@dont.spam.me.please.missionrec.com> wrote:
> Can I then use the $hash like I would an array?
Yes.
> would print No under the following?
>
>print "$hash{$31}";
print $hash{31};
You really need to get a book about Perl, and then yu need to read it.
------------------------------
Date: 5 Aug 1998 20:12:55 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <6qaec7$e52$1@news.NERO.NET>
In article <6q9j0q$25l$1@csnews.cs.colorado.edu>,
Tom Christiansen <perlfaq-suggestions@perl.com> wrote:
It's nice to see the FAQ back in the group.
Could you add the part number (0) to the string 'perlfaq' in the subject
of part 0, as you have the part number in each of the other parts? Thank
you. I.e., "perlfaq0 -- frequently asked ...".
------------------------------
Date: 5 Aug 1998 20:27:17 GMT
From: alastair@psoft.co.uk (Alastair)
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <6qaf75$jf4@handupme.avid.com>
no.unsoliciteds@dead.end.com <no.unsoliciteds@dead.end.com> wrote:
>Greg Bacon wrote:
>
>> Such is the cost of catering to the LCD. :-(
>
>Greg you learned the wrong language, try python it's not used on the web :)
Hmmm. Actually it is :\
Just not as much as perl.
--
Alastair
Avid Effects
alastair@psoft.co.uk
------------------------------
Date: Wed, 5 Aug 1998 20:44:06 GMT
From: Peter A Fein <p-fein@uchicago.edu>
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <opgg1fbupk9.fsf@harper.uchicago.edu>
gbacon@cs.uah.edu (Greg Bacon) writes:
>
> In article <opgpvefv2eb.fsf@harper.uchicago.edu>,
> Peter A Fein <p-fein@uchicago.edu> writes:
> : WTF was that?!? Thanks, I've already got my own copy of the man
> : pages.
>
> Such is the cost of catering to the LCD. :-(
My point, though slightly clearer. Is clp.moderated up yet & if so
who do I need to beg to let me in? No such junky replies, I promise. ;)
--
Peter A Fein Summering in SF!
Home: 650-571-6476 Work: 650-628-2172
p-fein@uchicago.edu pfein@us.checkpoint.com
Gilette's Razor: The best a man can get.
------------------------------
Date: Wed, 05 Aug 1998 13:45:04 -0600
From: Matt Grommes <mpgromm@sandia.gov>
Subject: Re: Reading in one file and writing to another
Message-Id: <35C8B640.4920F5D@sandia.gov>
I meant writing to a _third_ file. Someday I'll get the hang of writing
complete sentences that actually express what I want to say. :)
-- matt
Ala Qumsieh wrote:
> Matt Grommes wrote:
> >
> > Man, I'm an idiot. I never even thought of writing to another file. doh.
> > Thanks alot.
> >
>
> Hmmm... how do you explain the subject of the thread (that you wrote)
> then ? ;-)
>
> --
> Ala Qumsieh | No .. not Just Another
> ASIC Design Engineer | Perl Hacker!!!!!
> Matrox Graphics Inc. |
> Montreal, Quebec | (Not yet!)
>
------------------------------
Date: Wed, 05 Aug 1998 23:59:18 GMT
From: hector@followme.com (Hector Catre)
Subject: Retrieving file from REMOTE_ADDR ... HELP!
Message-Id: <6qagl0$9f3$1@demon.uunet.ca>
OK maybe I'm making myself clear.
I have a website
I have a jpg that I want to upload to the server
I want the cgi to open up a directory listing of my (client side) computer,
then
after I choose what that file is,
the cgi-uploads it to the server
simple.
if you think it can't be done, please go to hotmail.com, they have an option
where you can attach a file into an e-mail, and it does this by exactly the
process I just described. This is what I am trying to achieve.
Again, any help you can provide would be highly appreciated.
Hector
>On Wed, 5 Aug 1998, Hector Catre wrote:
>
>> Hello,
>>
>> I'm trying to figure out how to access the REMOTE_ADDR so that I can
download
>> a file from that system to the server. I can't even figure out how to
access
>> the REMOTE_ADDR's directory structure so that they can choose the file to
be
>> downloaded. HELP!
>
>This is not a perl language question.
>
>In fact, it's hard to see just what kind of a question it is, because
>(as I'm afraid so often happens) you have presented us with a
>half-formed solution to some unstated problem, and we can only guess
>just what it is supposed to be achieving.
>
>REMOTE_ADDR may be in general the address of some proxy between the
>client and the server. Even IF it were the address of the client, how
>the heck do you suppose that the _server_ can do something to poke
>around in the client's file hierarchy? The WWW doesn't work that way;
>thank goodness.
>
>If the client wants to send the server a file, you can use INPUT
>TYPE=FILE in a FORM: consult the appropriate CGI resources for details.
>If that isn't what you want, then choose an appropriate group (i.e not
>this one) to say just what you are trying to achieve, and then a better
>answer may be feasible.
>
>F'ups prophylactially set - please feel free to override to whatever
>seems most appropriate. E.g the CGI authoring group.
>
------------------------------
Date: Wed, 05 Aug 1998 21:04:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Retrieving file from REMOTE_ADDR ... HELP!
Message-Id: <Pine.GSO.4.02.9808051359250.14291-100000@user2.teleport.com>
On Wed, 5 Aug 1998, Hector Catre wrote:
> I have a website
That's nice. :-)
> I have a jpg that I want to upload to the server
So far, so good.
> I want the cgi to open up a directory listing of my (client side) computer,
Maybe you want to write a CGI program to do that.
> then after I choose what that file is, the cgi-uploads it to the
> server
So, you want your program to let you choose a filename, then your remote
user will upload it? Or will _you_ be the remote user? This isn't clear.
Of course, there's nothing Perl-specific about this. If your problem is
with the CGI interface, perhaps the docs, FAQs, and newsgroups about the
CGI interface and related topics would help you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 5 Aug 1998 21:10:20 GMT
From: "Josh" <kandiko@vbe.com>
Subject: Rights
Message-Id: <01bdc0b5$60220de0$1c9622ce@206.242.16.3.vbe.com>
Hi
I was wondering how you would change the writes to a script on win95.
thx
Josh
------------------------------
Date: Wed, 05 Aug 1998 21:25:09 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Rights
Message-Id: <Pine.GSO.4.02.9808051424440.14291-100000@user2.teleport.com>
On 5 Aug 1998, Josh wrote:
> I was wondering how you would change the writes to a script on win95.
If it's not covered in the docs, you should install a better system. Good
luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 5 Aug 1998 21:16:52 GMT
From: hivnor@shore.net (Todd Hivnor)
Subject: Re: Setting $ENV{LD_LIBRARY_PATH} doesn't work
Message-Id: <6qai44$1s7@fridge.shore.net>
> > setenv LD_LIBRARY_PATH /user/oracle/lib
> I see something different between those two strings. Surely it's not so
> simple as this?
No .. there was a typo in my posting .. sorry.
My actual csh script says:
setenv LD_LIBRARY_PATH /usr/oracle/lib
-- Todd
------------------------------
Date: Wed, 05 Aug 1998 13:38:53 -0600
From: Ed Henderson <evhendrs@micron.net>
Subject: Re: simple regexp
Message-Id: <35C8B4CD.80E93B19@micron.net>
This is a multi-part message in MIME format.
--------------F29608CDA2EC6AD8EAE5DA91
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Rasan Rasch wrote:
> Can anyone tell me what is wrong with
>
> @matches = /http.*(com|edu)/g;
>
> in trying to extract a url from a line? All I can seem to fill @matches
> with is the subdomain "edu."
This may be what you are looking for:
@matches = /(http.*?(?:com|edu))/g;
This will return 0 or more http address from $_.
You need the .*? or else:
http.foo.bar.bletch.com some stuff there http.foo.bar.blecth.edu
will return "http.foo.bar.bletch.com some stuff there
http.foo.bar.blecth.edu"
as a single item
With .*? you get two elements
("http.foo.bar.bletch.com","http.foo.bar.blecth.edu")
Also, add the memory free-parenthesis operator to (com|edu), unless you
really
want to return them as an item.. ($:com|edu) brackets the alternation,
without
the memory.
Cheers.
--------------F29608CDA2EC6AD8EAE5DA91
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ed Henderson
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Ed Henderson
n: Henderson;Ed
org: Micron Technology
email;internet: evhendrs@micron.net
title: Software Engineer
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
--------------F29608CDA2EC6AD8EAE5DA91--
------------------------------
Date: Wed, 5 Aug 1998 09:06:39 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
To: "MSmith" <Msmith@notes.net>
Subject: Re: Single word ouptu from aa array
Message-Id: <Ex7LB3.33M@csc.liv.ac.uk>
[Posted and mailed]
In article <0%Mx1.338$ML4.1093024@news4.mia.bellsouth.net>,
"MSmith" <Msmith@notes.net> writes:
> Im new to Perl. I'M trying to place a file, a txt file, into an array..then
> print out the first character of the first line..and then the second
> character....etc..but IM having a bit of trouble. IM only able to print out
> a line at a time:
>
You haven't got -w turned on have you? because this would have told you what
was wrong, and even suggested a solution to part of the problem I think.
> open (INFILE, "c:\\csv\\cpu_in\\test.txt");
> @csvfiles = <INFILE>;
> close (INFILE);
> print @csvfiles[0];
^
I could be wrong but the print wont do what you think it does.
You will also need a foreach loop around that print probably.
Do your self a big favour read perlfaq4.
--
--
Ian J. Garlick
ijg@csc.liv.ac.uk
Children are unpredictable. You never know what inconsistency they're
going to catch you in next.
-- Franklin P. Jones
------------------------------
Date: 5 Aug 1998 20:47:15 GMT
From: Niklas Matthies <matthies@fsinfo.cs.uni-sb.de>
Subject: Re: split & empty patterns
Message-Id: <6qagcj$hhc$1@hades.rz.uni-sb.de>
In comp.lang.perl.misc, Tom Phoenix <rootbeer@teleport.com> writes:
> On 5 Aug 1998, Niklas Matthies wrote:
>> From the perlop man page:
>>
>> If the PATTERN evaluates to a null string, the last
>> successfully executed regular expression is used
>> instead.
>
> Of course, perlfunc's entry about split says something different about
> what happens if the pattern used there is null. Hope this helps!
Not really. It says:
A pattern matching the null string (not to be
confused with a null pattern //, which is just one
member of the set of patterns matching a null
string) will split the value of EXPR into separate
characters at each point it matches that way. [...]
So, reading both man page extracts, one would (or at least could) assume
that 'split' will act that way on all patterns matchig a null string
_except_ the null pattern, because this one will be replaced by the last
successfully executed regular expression. Especially since 'split' can
also take expressions in stead of patterns, this would seem more "logical".
Like this:
TEST =~ /S/;
split '', TEST; # empty string, interpreted by split as pattern
# matching the null string, gives (T, E, S, T)
TEST =~ /S/;
split //, TEST; # empty pattern, the last successfully executed
# regular expression is used instead, gives (T, E, T)
Well, I see that I was wrong with my assumptions. :) But I think this issue
should be clarified in some future version of the documentation (who's
responsible for this, actually?), and I wonder what will happen if/when
regexps become first class objects in Perl ;).
-- Niklas
------------------------------
Date: Wed, 05 Aug 1998 21:14:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: split & empty patterns
Message-Id: <Pine.GSO.4.02.9808051413280.14291-100000@user2.teleport.com>
On 5 Aug 1998, Niklas Matthies wrote:
> I think this issue should be clarified in some future version of the
> documentation (who's responsible for this, actually?),
You are. :-) If you don't like the docs, submit a patch with the perlbug
program. Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 05 Aug 1998 16:01:08 -0400
From: "Fenwick, Wynn [FITZ:4C17:009]" <wynn@americasm01.nt.com>
Subject: stuck: variable replacement within backquote escape?
Message-Id: <35C8BA04.D2BC9AFA@americasm01.nt.com>
Hello all,
I'm stuck on trying to get a count of $regexp matches of a gzipped file
without having to gunzip it and re-gzip it. I'd also like to make it
flexible and have the paths to the programs flexible, as well as the
regexp I'm searching on.
this...
$today= `$gzcat $logfilename | $grep -c $regexp`;
...does not work because the identifiers are sent to the shell that
services the backquote expression instead of being replaced with values
first. Is there a way to make them get replaced first before sending
this command to the shell?
--
Wynn Fenwick |
Nortel, Ottawa |
------------------------------
Date: Wed, 05 Aug 1998 20:24:42 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: stuck: variable replacement within backquote escape?
Message-Id: <Pine.GSO.4.02.9808051321490.14291-100000@user2.teleport.com>
On Wed, 5 Aug 1998, Fenwick, Wynn [FITZ:4C17:009] wrote:
> $today= `$gzcat $logfilename | $grep -c $regexp`;
> ...does not work because the identifiers are sent to the shell that
> services the backquote expression instead of being replaced with values
> first. Is there a way to make them get replaced first before sending
> this command to the shell?
Maybe you've got that backwards. Those four variables are expanded before
the command is sent to the shell. If that's not your trouble, perhaps you
should try asking again. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 5 Aug 1998 22:59:15 +0100
From: "Martin" <minich@globalnet.co.uk>
Subject: Re: Teaching Perl
Message-Id: <6qakku$b96$1@heliodor.xara.net>
>Since I only have one day, and since none of the people
>I will be working with have any knowledge of perl
>at all, I am going to try to present a broad overview
>of the basics of programming in perl. I'm currently
>planning on presenting the following topics-
I would recommend teaching the basic regexps, at least
s/// and tr/// as these are one of the great things that make
Perl easy to use for parsing tasks that would be a lot
more complex in other languages.
Martin
------------------------------
Date: Wed, 05 Aug 1998 21:42:35 GMT
From: "Adam Graham-Yooll" <agy@macgreg.com>
Subject: Re: Variable Length & Memory?
Message-Id: <fl4y1.156$741.279262@client.news.psi.net>
When a script is compiled all the variable names are turned into memory
addresses. So there is no difference in the executable size or speed.
nanobreath@my-dejanews.com wrote in message
<6qa3rn$duk$1@nnrp1.dejanews.com>...
>Hello... this question might be rooted in assumptions that are way off
base...
>if so, feel free to let me know. I guess this question could be in regards
to
>any programming language, but I'm thinking of it in regards to perl.
>
>It is generally considered good practice to use long variable names so that
>the code is more readable. My question is: does variable length ever become
a
>factor in memory allocation or program speed? As I think about it,
>$db_file_marker seems like it would take up more space somewhere than
$dbfm.
>Perhaps I'm way off here, and I'm inclined to think I am, since I've never
>heard any discussion of this before, just recommendations to use long
>variable names.
>
>If you could, please cc: any responses to my e-mail address. Thanks a lot!
>
>--
>
>nanobreath@my-dejanews.com
>open source everything
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 05 Aug 1998 13:28:37 -0700
From: Digital Puer <digital_puer@hotmail.com>
Subject: When is the "Perl Cookbook" coming out?
Message-Id: <35C8C075.3719B8F9@hotmail.com>
Does anyone know when O'Reilly is going to release "The Perl Cookbook"?
I would like to order this interesting book from bookpool or amazon
sometime soon.
------------------------------
Date: 5 Aug 1998 17:39:22 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: When is the "Perl Cookbook" coming out?
Message-Id: <6qajea$su0$1@monet.op.net>
In article <35C8C075.3719B8F9@hotmail.com>,
Digital Puer <digital_puer@hotmail.com> wrote:
>Does anyone know when O'Reilly is going to release "The Perl Cookbook"?
O'Reilly website at http://www.ora.com.
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3370
**************************************