[9373] in Perl-Users-Digest
Perl-Users Digest, Issue: 2967 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 24 17:17:59 1998
Date: Wed, 24 Jun 98 14:00:39 -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, 24 Jun 1998 Volume: 8 Number: 2967
Today's topics:
bizarre quote/backslash requirements persicom@my-dejanews.com
Can someone help me find a script? kjernigan@geocities.com
Re: Date Calculation Problems. (Larry Rosler)
Re: Flames.... (Craig Berry)
Re: Flames.... (T. Ames)
Re: Flames.... (Leslie Mikesell)
Re: Flames.... (John Moreno)
foreach not reading array? <mike@newfangled.com>
Re: foreach not reading array? <mike@newfangled.com>
Re: Have we got a good free Perl manual? (Abigail)
Re: Help with site command in NET::FTP <jcisaac@pacbell.com>
Re: Help: PERL Library path <rootbeer@teleport.com>
Looking for Perl Application, PLEASE HELP <k.joch@kmjeuro.com>
Re: Perl question: newbiw help please! <rootbeer@teleport.com>
Running a Perl/CGI form script from the command line <clive@webhost.coza>
Searching through a file <hurban@snet.net>
Re: system() and security again (Chris Adams)
Re: What a Crappy World (oh, yes!) <upsetter@ziplink.net>
Re: What a Crappy World (oh, yes!) (Stuart McDow)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 24 Jun 1998 20:10:05 GMT
From: persicom@my-dejanews.com
To: mpersico@erols.com
Subject: bizarre quote/backslash requirements
Message-Id: <6mrmet$dbi$1@nnrp1.dejanews.com>
I have a tricky quoting requirement that has me stumped in Perl 5.003 (don't
yell, I just got to this job and I'm not the SysAdmin!):
I need to pass to the Sybperl function 'sql' a string that is the command to
run a stored procedure. The raw command, as typed into ISQL or Q+e is:
declare @TASKID int
select @TASKID = 99
exec my_sp @TASKID, @mptime output, @mpdate output, 32
exec my_other_sp @somearg, @someotherarg, @mptime output, @mpdate output, 32
This is all buried in an object. The '32' is the operator id, as stored in
$self->opId(), a function returning the operator id. The non-fancy way to do
this is:
my $sql = "declare \@TASKID int\n" . "select \@TASKID = 99\n" . "exec my_sp
\@TASKID, \@mptime output, \@mpdate output, @{[$self->opId()]\n" . "exec
my_other_sp \@somearg, \@someotherarg, \@mptime output, \@mpdate output,
@{[$self->opId()]\n"
This works fine. The \n help readability in the output, the dot-concatination
helps reading the code. The @ is what sybase usses for its scalar variables
in SQL. The backslashes get the @ past the perl parser.
The problem is that I want to extract the common part of that to a string,
namely:
my $commonPart = "\@mptime output, \@mpdate output, @{[$self->opId()]\n";
The problem is that the self-opId part doesn't get past the parser. If I
delete that, then this:
my $sql = "declare \@TASKID int\n" .
"select \@TASKID = 99\n" .
"exec my_sp \@TASKID, " . $commonPart@;
"exec my_other_sp \@somearg, \@someotherarg, " . $commonPart;
works fine. I've now gotten into one of those "type-a-few -chars-try-it" loops
where it is now hopelessly screwed up using all permutations of \,@,",',eval,
etc. There is something, probably obvious, I am missing about quotes and
interpolations. Or else, I'm 100% wrong about how to really do this.
Would someone be so kind as to point me to either or multiple of:
a) the solution <grin>
b) the part(s) of the FAQ that I should RE-READ, since it didn't seem to
help the first time around. <sheepish grin>
c) Ditto for Programming Perl, Advanced Perl Programming or Effective Perl
Programing by Randal.
It also seems to me that if I were in C, a #define would do the trick. What is
the analogous concept in Perl, if it exists. I bet the answer is going to be
some variation of anonymous subroutines, but I'm so confused now that I need
someone to slap some sense into my programming head.
FAQ-Flame asbestos underwear at the ready...
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 24 Jun 1998 19:50:13 GMT
From: kjernigan@geocities.com
Subject: Can someone help me find a script?
Message-Id: <6mrl9l$bji$1@nnrp1.dejanews.com>
Hello,
I am working at http://www.totalconversions.com, and I am the CGI person
there, and I have been unable to get a perl banner script working. It uses SSI
to call it, and I can never get it to process the directive. Would anyone know
of a Perl banner script that does NOT use SSI to call it? If so, could you
please send me the link or the script. Thanks in Advance. I would prefer it if
you would e-mail, but I will try and check this newsgroup out often in search
for an answer. Also, would someone know of a Perl, counter that does NOT use
SSI to call it? Oh, I would like it if it did NOT use another out side program
for compiling the images. Thanks again!!
KENNY
kjernigan@geocities.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 24 Jun 1998 12:57:13 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Date Calculation Problems.
Message-Id: <MPG.ffaf9f6c941311b9896c7@nntp.hpl.hp.com>
In article <35915824.0@news2.mcmail.com>, Col <colin.riddle@scotmail.com>
says...
...
> 1998122112:39:01
>
> is there any way that I can split this into different variables, eg $year
> $month $day etc. I know that you can split things on certain preset
> separators eg splitting on &'s or \'s or something, but is it possible to
> spilt on a number of characters?
perldoc -f substr
is best, though you *can* do it with a regex like /(....)(..) etc.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 24 Jun 1998 19:55:04 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Flames....
Message-Id: <6mrlio$gu7$1@marina.cinenet.net>
T. Ames (ames0009@tc.umn.edu) wrote:
: On Wed, 24 Jun 1998 18:42:51 GMT, phenix@interpath.com (John Moreno)
: wrote:
:
: >That's probably because this isn't a help desk or even a simulation of
: >it.
:
: This is the biggest myth of all. I know you'd like to think this is a
: place where experts can come to pat each other on the back, but that
: is simply not the reality of this group.
I consider myself a moderately good Perl programmer, perhaps in the lower
reaches of 'expert' by some definitions. My own posts to clpm break down
approximately like this:
75% answers to questions posed by those with less expertise
10% answers to questions posed by those with similar expertise
10% questions
5% extratopical stuff like this post (though it's more than
5% today...)
Each category also subsumes general discussion about perl topics related
to the original question.
Of the questions I ask, perhaps 2/3 are of the form "I have goal X, and
have accomplished it using [code], but that looks ugly...is there a better
way I'm missing?" The remaining 1/3 are the embarrassing ones -- "I know
X is in the doc somewhere, but I just can't find it. I've looked [list of
places], but no luck. Pointer, please?" But phrased that way, such
questions have never got me more than very gently flamed (warmed?).
Others with expertise similar to or greater than mine seem to follow much
the same pattern. Hardly a mutual back-patting society.
: What is a helpdesk? Gee, I think it is a place where people go to get
: help.
...with a paid employee behind the desk, and paying customers in front of
it. That's the critical difference.
: Are you seriously
: suggesting that people come here for some other reason? You can call
: it "discussing the finer points of perl" or whatever you like, but
: that is merely a semantic issue.
No it's not. Some of my favorite threads start off with (e.g.) "Why does
Perl express X using funny syntax Y?" This isn't (directly) connected
with any given application or problem. It's pursuit of knowledge in the
pure sense. As usual, this allegedly 'pure' knowledge frequently leads to
practical benefits sooner or later, but that's not what drives such
discussions.
: People come here for help with perl,
: from the novice to the expert, and in that sense, Yes, it is a
: simulation of a helpdesk.
Then I'm owed a lot of back pay, and my bill pales in comparison with a
few other posters'. If it's a simulation of *anything* in the real world,
it's a user's group, without outside funding or support. Everyone is here
on a volunteer basis because we want to share information about a product
we all use. We are all de facto peers in terms of both our ability to
contribute (unlimited) and our rewards for doing so (purely intangible).
The helpdesk model implies a division of functions (helpers and help
recipients) and an external structure of costs and rewards (pay for
helpers, charges for recipients) that doesn't apply here.
: >The "right" manner is fairly broad, and those who ask outside the
: >boundaries of "right' deserver hellfire and brimstone.
:
: I'll define "right" for you: the way that YOU want. That seems to be
: exactly what you are saying.
Not true; it's group consensus. Just today, on another thread, Tom C.
transgressed the social conventions here in the eyes of at least one other
frequent poster, and was immediately, pointedly, and publically taken to
task for having done so. And Tom apparently considered the reprimand a
significant enough event that he responded in conciliatory, explanatory
terms. It ain't much, but mutual criticism is the only system of checks
and balances we have.
: I love it when people complain about posters taking up there precious
: time with their FAQable questions -- yet some always seem to have the
: time to flame people, rather than just ignoring posts they think are
: beneath them.
I believe the hope is that if we take the time to drive off an idiot
today, we will reach time break-even through not seeing dozens of
additional idiotic posts from that person (and perhaps many others scared
off by the flaming) within a few weeks. Think of it as an investment.
---------------------------------------------------------------------
| 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: Wed, 24 Jun 1998 20:42:29 GMT
From: ames0009@tc.umn.edu (T. Ames)
Subject: Re: Flames....
Message-Id: <359160cd.13303764@news.tc.umn.edu>
On 24 Jun 1998 19:55:04 GMT, cberry@cinenet.net (Craig Berry) wrote:
>: What is a helpdesk? Gee, I think it is a place where people go to get
>: help.
>
>...with a paid employee behind the desk, and paying customers in front of
>it. That's the critical difference.
>
Money has nothing to do with it. It is a "mutual helpdesk." What
many people seem to be forgetting is that no one is forcing anyone to
answer anything! Some of us are merely pointing out that going out of
your way to flame someone isn't very constructive and creates a
hostile atmosphere.
>: Are you seriously
>: suggesting that people come here for some other reason? You can call
>: it "discussing the finer points of perl" or whatever you like, but
>: that is merely a semantic issue.
>
>No it's not. Some of my favorite threads start off with (e.g.) "Why does
>Perl express X using funny syntax Y?" This isn't (directly) connected
>with any given application or problem. It's pursuit of knowledge in the
>pure sense. As usual, this allegedly 'pure' knowledge frequently leads to
>practical benefits sooner or later, but that's not what drives such
>discussions.
"Help" doesn't imply "practicality." You can get help in your pusuit
of abstract knowledge just as you can get "how-to" help. That doesn't
alter the fact that people come here for help.
>: People come here for help with perl,
>: from the novice to the expert, and in that sense, Yes, it is a
>: simulation of a helpdesk.
>
>Then I'm owed a lot of back pay, and my bill pales in comparison with a
>few other posters'. If it's a simulation of *anything* in the real world,
>it's a user's group, without outside funding or support. Everyone is here
>on a volunteer basis because we want to share information about a product
>we all use. We are all de facto peers in terms of both our ability to
>contribute (unlimited) and our rewards for doing so (purely intangible).
>The helpdesk model implies a division of functions (helpers and help
>recipients) and an external structure of costs and rewards (pay for
>helpers, charges for recipients) that doesn't apply here.
>
Once again, money has nothing to do with it. The help is mutual - you
yourself said that you both answer and ask questions -- isn't that a
division of functions?
>: I love it when people complain about posters taking up there precious
>: time with their FAQable questions -- yet some always seem to have the
>: time to flame people, rather than just ignoring posts they think are
>: beneath them.
>
>I believe the hope is that if we take the time to drive off an idiot
>today, we will reach time break-even through not seeing dozens of
>additional idiotic posts from that person (and perhaps many others scared
>off by the flaming) within a few weeks. Think of it as an investment.
I agree with you on this: if a poster repeatedly asks FAQable
questions, then they ought to told that they are violating the norms
of the group. And sure, flame them. But that is not really what I am
addressing here -- rather, it seems that many people are automatically
flaming a FAQable question by first-time posters, assuming a "spare
the rod, spoil the child" posture. I think this is a little severe,
that's all. And I think it ultimately does more damage to the group
than just ignoring them.
------------------------------
Date: 24 Jun 1998 15:32:25 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Flames....
Message-Id: <6mrnop$e9e$1@Mercury.mcs.net>
In article <8ciulqzpq2.fsf@gadget.cscaper.com>,
Randal Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Leslie" == Leslie Mikesell <les@MCS.COM> writes:
>
>Leslie> It's odd that there is such a remarkable similarity in the
>Leslie> names of these O'Reilly shills and the regular people on
>Leslie> c.l.p.m. then. Hmmm, what about the pictures? Maybe it is
>Leslie> the posters here that are the imposters... Can someone who
>Leslie> goes to the tutorials report back on how often the 'read the
>Leslie> FAQ' and 'go to the right forum' phrases are uttered?
>
>I'm not sure if this was tongue-in-cheek. You are missing a smiley.
>
>Are you saying that you expect the same level of "the customer is
>always right" service that I constantly give my paying clients as when
>I'm answering Usenet posts for free (and actually at a cost of my
>time)?
>
>Have you gone mad?
Apparently so. I didn't think it was necessary to be paid to
be polite.
>This is a completely invalid comparison.
In what way should your personality be determined by your fees?
>As a volunteer answer person, I have every right to request that the
>people that ask questions go through a certain minimum amount of work
>on their own.
Do hospital volunteers and Boy Scout leaders have the right to
be mean to people who need the most help? I agree, of course that
they have no obligation to offer any at all.
>But I do think you've hit the nail on the head. Some posters here in
>clpm expect 1-900-support-line level service for FREE. Duh! Not
>gonna happen, folks. These are *volunteers* answering the questions.
Nobody is forced to answer anything. If the dumb questions go
unanswered for a while someone who just learned the answer will
likely post it, and if they get it wrong an expert will find it
interesting to correct them. Things have worked that way since
the old days when Peter Honeyman commented that 'usenet is like
shouting "car for sale" in a crowded theater'.
>They have every right to be snippy when the 47th posting of the day in
>the wrong group shows up in the unread window, when a few days reading
>of the same group would have shown them the error of their ways. "You
>must be THIS tall to post to Usenet." Get a grip.
But by doing so, you set the example that this is the forum for
whining, and the best you can ever hope is that someone will follow
your example. And you deny the person willing to answer the chance
to do it.
Les Mikesell
les@mcs.com
------------------------------
Date: Wed, 24 Jun 1998 20:56:24 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Flames....
Message-Id: <1db4ypv.2lejgzo3d0lN@roxboro0-044.dyn.interpath.net>
T. Ames <ames0009@tc.umn.edu> wrote:
> phenix@interpath.com (John Moreno) wrote:
>
> >That's probably because this isn't a help desk or even a simulation of
> >it.
> >
> This is the biggest myth of all. I know you'd like to think this is a
> place where experts can come to pat each other on the back, but that
> is simply not the reality of this group. What is a helpdesk? Gee, I
> think it is a place where people go to get help. Are you seriously
> suggesting that people come here for some other reason? You can call
> it "discussing the finer points of perl" or whatever you like, but
> that is merely a semantic issue. People come here for help with perl,
> from the novice to the expert, and in that sense, Yes, it is a
> simulation of a helpdesk.
I come here looking for interesting problems to solve, but I don't count
as "expert" except to people who don't know anything, so I guess I don't
count. And of course I'd really like to know what questions Tom C is
Randal Schwartz, Abigail, and Tom Phoenix are interested in having
answered.
>
> >And maybe it's because they like discussing the fine points of perl, but
> >don't generally need help.
> >
> >> An oracle that will only deign to answer questions if they are posed in
> >> just the right manner -- otherwise "hellfire and brimstone."
> >
> >The "right" manner is fairly broad, and those who ask outside the
> >boundaries of "right' deserver hellfire and brimstone.
> >
> I'll define "right" for you: the way that YOU want. That seems to be
> exactly what you are saying.
Yes, it's the way I want (how else - NOT they way I want?), but what I
want isn't that difficult, simply evidence that the person has attempted
to answer the question on his own and NOT just by trial and error.
Looked in the manual, looked in the FAQ.
> >No, it's not childish - it simply shows that you aren't serious and so
> >don't deserve a serious answer.
>
> The key here is the adjective "serious." Rather than, "they don't
> deserve an answer," which is perfectly fine -- No one is forcing you
> to answer anything -- you imply that they do deserve something else
> (insults, flames, etc -- which I assume fall under the category of
> "non-serious answers")
Exactly.
> I love it when people complain about posters taking up there precious
> time with their FAQable questions -- yet some always seem to have the
> time to flame people, rather than just ignoring posts they think are
> beneath them.
I said nothing about either bandwidth nor time (but there's a difference
between my deciding to kill some time and somebody else asking me to do
so). And again you seem to be missing the point - there are no
"questions" that are beneath them, it's people who don't want to be
bothered working for their answers who should be considered "beneath
them" and I'm sure everybody would be glad to ignore them if they'd just
get out of the way (they could always post to alt.test, I doubt if
anybody would complain about them hanging around there).
Again - I challenge you: Wait a week or so and then post a very simple
question while saying that you've looked in the manual and the faq. You
will probably get both document names/section and extractions as well as
the answer put in different words. But I do not believe that you will
get flamed or called a idiot or anything worse than a terse reply.
--
John Moreno
------------------------------
Date: Wed, 24 Jun 1998 16:28:00 -0400
From: "Michael S. Brito, Jr." <mike@newfangled.com>
Subject: foreach not reading array?
Message-Id: <35916147.460513C6@newfangled.com>
Why do I get this error when I run this script???? It sends the e-mail
and make's it to the 'Location' line and spits out this error:
mike... Recipient names must be specified
/home/mike/dead.letter... Saved message in /home/mike/dead.letter
Location:http://208.159.33.19/project/thanks.html
<-------- Script Starts Here ------------->
#!/usr/bin/perl -w
# Grab all the addresses in the file "email.txt" and slap 'em in mem.
$email = "email.txt";
open(EMAIL,$email) or
die "error opening $email: $!\n";
@email = <EMAIL>;
close(EMAIL);
# Grab all the text in "sendlist.txt" & save it for later to be sent as
a message body
$filename = "sendlist.txt";
$T = $/;
$/ = "";
open(INF,$filename) or
die "error opening $filename: $!\n";
$indata = <INF>;
close(INF);
$/ = $T;
# Define the "sendmail" location
$mailprog = '/usr/sbin/sendmail';
# Suck the addresses out of the array one by one & send them an email
using
# the info below and the message body provided by $indata
foreach $address (@email) {
open (MAIL, "|$mailprog $address") || die "Cant open $mailprog: $!\n";
print MAIL "From: mike\@newfangled.com\n";
print MAIL "Reply-to: mike\@newfangled.com\n";
print MAIL "Subject: Mailing List\n\n";
print MAIL "$indata\n";
close(MAIL);
}
# send the admin to the confirmation page
print "Location:http://208.159.33.19/project/thanks.html\n\n";
<---------- EOF ------------->
Here is some other info you might need:
My Info:
Perl, version 5.003 with EMBED
Red Hat Linux release 4.1 (Vanderbilt)
Kernel 2.1.99 on an i586
CGI.pm Library Version 2.36
Executable Path: /usr/bin/perl
-----------------------------------------------------------
Michael S. Brito, Jr., Web Developer
Newfangled Graphics Co. Inc.
mike@newfangled.com
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=(#####censored######)
-----------------------------------------------------------
------------------------------
Date: Wed, 24 Jun 1998 16:37:55 -0400
From: "Michael S. Brito, Jr." <mike@newfangled.com>
Subject: Re: foreach not reading array?
Message-Id: <3591639A.7ACE9726@newfangled.com>
I know i composed my question horribly but i'm kinda in a rush,
sorry!!!!!!! Newbie mistake!!!!!!!
-----------------------------------------------------------
Michael S. Brito, Jr., Web Developer
Newfangled Graphics Co. Inc.
mike@newfangled.com
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=(#####censored######)
-----------------------------------------------------------
------------------------------
Date: 24 Jun 1998 20:37:58 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <6mro36$nmr$2@client3.news.psi.net>
Mark Lehrer (mark@satch.markl.com) wrote on MDCCLVIII September MCMXCIII
in <URL: news:m3k966vjqw.fsf@satch.markl.com>:
++ pudge@pobox.com (Chris Nandor) writes:
++
++ > # Then what is the solution? Don't use Perl? No. Write a good free manual?
++ > # Yes.
++ >
++ > Huh? THERE IS A GOOD FREE PERL MANUAL. Even by the FSF definitions
++ > of "free" and, I assume, of "manual". It is probably better than
++ > every other manual, free or proprietary, for any other software
++ > package of this size.
++
++ What is the URL? I have seen three responses now, none with how to
++ find it. I especially need documentation on how to link in a .a with
++ the perl executable.
http://www.perl.com/CPAN/src/latest.tar.gz
or as perl-5.004_04.tar.gz from your local GNU mirror.
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: Wed, 24 Jun 1998 13:39:34 -0700
From: "James Isaacson" <jcisaac@pacbell.com>
Subject: Re: Help with site command in NET::FTP
Message-Id: <6mro4j$874@gw.PacBell.COM>
I have tried the quot first and then the command method.
The real issue is that neither the quot or command waits for the site
command to finish, therefore the script continues and fails. Is there a
waitfor or prompt method i could use? The site command in question
outputs about 5 lines of text and takes a second or two.
Thanks
Jim
>>$ftp->command('site cm') or die "Unable to send command";
>
>Hmm. Haven't used the command method myself. I've had excellent luck
>sending commands to ftp servers with quot, though.
>
>$ftp->quot('site cm') or die . . . etc.;
>
>You should then be able to check $ftp->message for any return code the
>server gives you.
>
------------------------------
Date: Wed, 24 Jun 1998 20:35:07 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help: PERL Library path
Message-Id: <Pine.GSO.3.96.980624132925.14091F-100000@user2.teleport.com>
On Wed, 24 Jun 1998, Ping Cui wrote:
> The question is: Can I put the standard Perl library manually into
> any of these directories?
>
> I put all the library files manually into /usr/local/lib/perl5 and I got
> an error like this:
>
> Can't locate Getopt/Long.pm in @INC at tmp9.pl line 4.
Based upon the evidence, you can't manually put the files there. :-)
You should generally leave Getopt/Long.pm and other modules where they
were installed. If that's not working, your perl binary or your modules
are miscompiled or misinstalled, and you may as well recompile and
reinstall them.
Then again, if I've misunderstood you, you may merely need to properly use
'use lib' to find your modules.
> By the way, my Perl version is 5.002.
Ah, so you have a good reason to compile and install 5.004_04. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 24 Jun 1998 22:17:24 +0100
From: "Karl M. Joch" <k.joch@kmjeuro.com>
Subject: Looking for Perl Application, PLEASE HELP
Message-Id: <6mrn2h$rtv$1@orudios.magnet.at>
i use a freebsd server with mysql as database and apache for the www and i
am NOT A GOOD programmer.
but i need a software to
make invoices from the sql database
do small debit/credit account checks
handling the stock of the goods
does somebody know a freeware or shareware written in perl witch i can use
as base programm to add the changes for VAT aso witch are neccecary here in
austria.
THANKS for your help.
would be great to email a cc of your answer to webadmin@proline.at
karl
------------------------------
Date: Wed, 24 Jun 1998 20:49:09 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl question: newbiw help please!
Message-Id: <Pine.GSO.3.96.980624134756.14091H-100000@user2.teleport.com>
On 24 Jun 1998 crump@shell1.cybercom.net wrote:
> Subject: Perl question: newbiw help please!
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
> # Print out HTMl and call second script
> exec("script2.pl $var1 $var2 $var3");
> print "The second script has been started...<BR>\n";
Turn on warnings when you run your program, and double-check the docs for
exec. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 24 Jun 1998 22:44:04 +0200
From: Clive McAdam <clive@webhost.coza>
Subject: Running a Perl/CGI form script from the command line
Message-Id: <35916514.D27F9091@webhost.coza>
I have a form processing perl script that writes the form values to a
file.
All works well when I call it from the browser
ie.
http://www.wherever.com/cgi-bin/add.cgi?name=joe&lastname=soap&email=joe.soap@somewhere.com
When I make a slight mod to the code and change
@pairs=split(/\&/,$ENV{'QUERY_STRING'});
to
@pairs=split(/\&/,<STDIN>);
in order to run it from the command line, it expects me to enter the
command like this:-
./add.cgi
name=joe&lastname=soap&email=joe.soap@somewhere.com
over two separate lines.
How do I get to run this from the command line so that I can run it like
this:-
./addnew.cgi name=joe&lastname=soap&email=joe.soap@somewhere.com
All on one line?
Regards
Clive
(To reply via email please insert a period "." between the "o" and the
"z" in clive@webhost.coza )
------------------------------
Date: Wed, 24 Jun 1998 15:49:57 -0400
From: HU <hurban@snet.net>
Subject: Searching through a file
Message-Id: <35915865.F70C2DEE@snet.net>
New to Perl, I have a question maybe someone can answer.
I have some code to search through a CPP file finding functions but I
cannot get to find anything that is more then two lines, I thought I
would search for a newline followed by at least a pair of parens
followed but a \n\{ but this never works.
What would be a better expression or can I not search over multiple
lines in Perl using <>.
open (fIfile, $sIfile);
while(<fIfile>)
{
chomp();
if (/\n*.\(*.\)*\n\{/)
{
print("begin\n");
print($_);
print("\nend\n");
}
}
close (fIfile);
------------------------------
Date: 24 Jun 1998 20:34:20 GMT
From: cadams@ro.com (Chris Adams)
Subject: Re: system() and security again
Message-Id: <6mrnsc$cjv$1@news.ro.com>
According to Tom Christiansen <tchrist@mox.perl.com>:
>In comp.lang.perl.misc,
> Marc.Haber-usenet@gmx.de (Marc Haber) writes:
>:> @cmds = "who";
>:> system { $cmds[0] } @cmds;
>:
>:That seems like a trick. Can anyone explain what this does?
>
>The manpage?
Which manpage would that be? The current version from CPAN is
http://www.perl.com/CPAN/src/5.0/perl5.004_04.tar.gz, and that does not
docuemnt anything like what you have above.
143:sprocket:~$ perl -v
This is perl, version 5.004_04 built for alpha-linux
Copyright 1987-1997, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
144:sprocket:~$ perldoc -f system
=item system LIST
Does exactly the same thing as "exec LIST" except that a fork is done
first, and the parent process waits for the child process to complete.
Note that argument processing varies depending on the number of
arguments. The return value is the exit status of the program as
returned by the wait() call. To get the actual exit value divide by
256. See also L</exec>. This is I<NOT> what you want to use to capture
the output from a command, for that you should use merely backticks or
qx//, as described in L<perlop/"`STRING`">.
Because system() and backticks block SIGINT and SIGQUIT, killing the
program they're running doesn't actually interrupt your program.
@args = ("command", "arg1", "arg2");
system(@args) == 0
or die "system @args failed: $?"
Here's a more elaborate example of analysing the return value from
system() on a Unix system to check for all possibilities, including for
signals and core dumps.
$rc = 0xffff & system @args;
printf "system(%s) returned %#04x: ", "@args", $rc;
if ($rc == 0) {
print "ran with normal exit\n";
}
elsif ($rc == 0xff00) {
print "command failed: $!\n";
}
elsif ($rc > 0x80) {
$rc >>= 8;
print "ran with non-zero exit status $rc\n";
}
else {
print "ran with ";
if ($rc & 0x80) {
$rc &= ~0x80;
print "core dump from ";
}
print "signal $rc\n"
}
$ok = ($rc != 0);
When the arguments get executed via the system shell, results will
be subject to its quirks and capabilities. See L<perlop/"`STRING`">
for details.
--
Chris Adams - cadams@ro.com
System Administrator - Renaissance Internet Services
I don't speak for anybody but myself - that's enough trouble.
------------------------------
Date: 24 Jun 1998 19:56:02 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <6mrlki$chr@fridge.shore.net>
Matt Knecht <hex@voicenet.com> wrote:
: Scratchie <upsetter@ziplink.net> wrote:
:>
:>There's nothing wrong with referrals, terse or otherwise. It's the
:>gratuitous insults that bother some of us.
: Not to drag another analogy into the fray, but...
: A child only touches a hot stove once.
: Similarly, I believe it's hoped that an author will only post
: misappropriatly once when flamed.
Big deal. If you politely show him an easier way to get an answer (than
Usenet) he probably won't post inappropriately again, either (see Tom
Phoenix's posts for an example).
But of course some people don't find that as satisfying as a well-penned
put-down.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: 24 Jun 1998 20:42:07 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <6mroav$3a1$1@ns1.arlut.utexas.edu>
Olga <katzman@students.uiuc.edu> writes:
>
> So you've never asked a "stupid" question?
Did you actually read my post?
> On 24 Jun 1998, Stuart McDow wrote:
> > If at some points in my life someone hadn't told me I was being
> > stupid, I'd probably still be stupid.
I neglected to add that I'm very grateful to those people who pointed
out to me that I was being stupid when I was, in fact, being
stupid. Very grateful indeed.
> I don't think insulting people is much of a public service
You've missed my point. When someone in need of finding a clue,
pointing that fact out to them is a good thing. Or would you rather
protect their feelings and have them go clueless indefinitely?
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
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 2967
**************************************