[12913] in Perl-Users-Digest
Perl-Users Digest, Issue: 323 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 31 17:07:16 1999
Date: Sat, 31 Jul 1999 14:05:08 -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 Sat, 31 Jul 1999 Volume: 9 Number: 323
Today's topics:
? path to SendMail on NT ??? <mike@shupp.com>
Re: ? path to SendMail on NT ??? (I R A Darth Aggie)
Re: [Summary] Korn Shell or Perl? (brian d foy)
Re: Capturing the next line (Abigail)
CGI---network,download question chris18@my-deja.com
Re: CGI---network,download question (Abigail)
Re: General question about CHMOD (Abigail)
Help opening a file <Ian.Nicholson@ukgateway.net>
Installing Perl Modules <kims@emmerce.com.au>
LINUX APACHE PERL chris18@my-deja.com
Re: LINUX APACHE PERL <llornkcor@llornkcor.com>
Re: Modifying file permissions from a pl script <kmonte@columbus.rr.com>
Re: NEWSFLASH: Supremes rule anti-advert-ware illegal (Bob Trieger)
Opening a text File (Newbie) <Ian.Nicholson@ukgateway.net>
perl problem, cgi <help@xellent.co.uk>
Re: perl problem, cgi <kims@emmerce.com.au>
Re: perl problem, cgi (Larry Rosler)
Re: perl problem, cgi (Abigail)
Re: perl problem, cgi (Abigail)
Re: perl problem, cgi (Abigail)
Re: pipes vs csv (brian d foy)
Re: pipes vs csv (Abigail)
Please help with classified script <niteshde@twd.net>
Re: Please help with classified script (Abigail)
Re:ebcdic packed numbers <shogue@securenet.net>
Re: Use of uninitialized value at ...... warning with h (Anno Siegel)
why are you so harsh to this guy ? <schmickl@magnet.at>
Win32: how to get OLE object from CLSID <u233@my-deja.com>
Re: Write to file!!! Need help!!! (Anno Siegel)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 31 Jul 1999 14:01:25 -0400
From: Mike Shupp <mike@shupp.com>
Subject: ? path to SendMail on NT ???
Message-Id: <37A339F3.C55E7907@shupp.com>
( NT newbie )
installing a perl forms processor script; the very unhelpful ISP (I
just found out the server is NT) says "just drop it in the cgi-bin, it
will work"
the script does runs, but no e-mail is sent;
what should this path be (or will this even work
at all):
$mailprog = '/bin/sendmail';
( PLEASE REPLY BY E-MAIL! )
--
________________________________________
Mike Shupp e-mail: mike@shupp.com
tel: (703) 536-4222 fax: (209) 633-5075
web: http://www.shupp.com
------------------------------
Date: 31 Jul 1999 20:33:27 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: ? path to SendMail on NT ???
Message-Id: <slrn7q6ngu.65l.fl_aggie@thepentagon.com>
On Sat, 31 Jul 1999 14:01:25 -0400, Mike Shupp <mike@shupp.com>, in
<37A339F3.C55E7907@shupp.com> wrote:
[posted && cc'd]
+ installing a perl forms processor script; the very unhelpful ISP (I
+ just found out the server is NT) says "just drop it in the cgi-bin, it
+ will work"
They lie. Ask them if they have sendmail installed. 20 quatloos say they
say "sendwhat?"
+ the script does runs, but no e-mail is sent;
How are you invoking sendmail? Most of the scripts I've seen do it thusly:
open(MAIL,'|/usr/lib/sendmail -ot'); # untested, from memory
When this sort of open fails, it doesn't cause an error. Try:
open(MAIL,'|/usr/lib/sendmail -ot') or die "sendmail: $!";
+ what should this path be (or will this even work at all):
+ $mailprog = '/bin/sendmail';
Most people don't keep sendmail in /bin. Doesn't matter, since most
NT machines don't have sendmail installed. This will probably have
to be re-worked to use the SMTP connection. Or you can ask your service
provider to install it for you.
But SendMailNT isn't free...
James
------------------------------
Date: Sat, 31 Jul 1999 15:26:08 -0400
From: brian@pm.org (brian d foy)
Subject: Re: [Summary] Korn Shell or Perl?
Message-Id: <brian-3107991526080001@sri.dialup.access.net>
In article <37a314df@news3.us.ibm.net>, mwang@mindspring.com (Michael
Wang) wrote:
>brian d foy <brian@pm.org> wrote:
>>all of this can be
>>easily done with tie. either open a file or pipe and retreive the next
>>line from it, or iterate through the DBM file. the FETCH decides where
>>to get the next value.
>
>I used tie, well I use dbmopen which I think is the same as tie. That is how
>I get %beeper_byname:
>dbmopen(%::beeper_byname, $beeper_byname, 0666);
dbmopen is only one implementation of a tied variable.
>I do not know how "FETCH" will solve the problem.
did you read about tied packages? but then, you don't have to
know how tie() will help you, because there are ten other ways to
do it in Perl.
>>i didn't see any mention of %beeper_byname in your shell script, so
>>i didn't include it in my translation.
>
>The problem specification was changed (not by me). %beeper_byname was in your
>Perl-to-Perl translation at the beginning.
see the first shell script that you posted. that was when you changed
the problem. you're going to have to keep up...
>>again, if you don't like Perl, don't use it, but quit whining about
>>your personal shortcomings in using it.
>
>I like Perl, and I do use it. I do not have personal shortcomings in using
>it in general.
perhaps your shortcomings are learning to do new things then. as you
see above, you have failed to suss out the hints i (and others)
have given you. i told you to use tie(), but you don't seem to have
done any homework on what tie() does. you should have seen that it
allows you to abstract the notions of FETCHing and STOREing a value.
this allows you to abstract your stream. the perltie man page will
probably not be read by you though.
> Your comments indicate ("send a check") that it takes a lot effort
> to find the solution for the problem. So again it is not a "personal
> shortcomings".
i don't know where you made that leap of logic. your problem is that
you are a leech. you're trying to get someone else to do your work
for you. this problem is not hard - maybe a half hour of coding, but
i'm not going to spend that half hour doing your work for free. it's
still your personal problem because you seem unwilling to expend the
effort to learn how to do it. you're blaming the langauge because
you don't know what to do and won't make the effort to learn, and that's
not fair to Perl.
>My love for Korn shell is still there. Sure I can do in Shell, and it
>has no "out of memory" problem and it is about 3 times faster in real time.
>I have attached the code below, but what is exactly your point here?
it's only faster for that case, and you have neglected to benchmark
the control situations. how will this act under the large data
sets that you are expecting? benchmarks on small sets make no sense
for your problem.
my point is that i don't think you have a clue about what is going on,
and are not absorbing the advice that you are getting. furthermore,
you seem to want to leech off other people's work to complete your
task. you do this by trolling. that's why you aren't getting any
more examples from me.
>I know I can do in Shell, but I need Perl solution since this is only
>a piece of code in a larger Perl program.
this is another problem of your benchmark. you already have to incur
the perl overhead. you should only be benchmarking the algorithms.
had you been more truthful at the beginning, you would have saved
yourself a lot of trouble.
but then, it doesn't really matter. welcome to the killfile.
--
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: 31 Jul 1999 15:13:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Capturing the next line
Message-Id: <slrn7q6m5l.i94.abigail@alexandra.delanet.com>
Catherine (cath@myspace.force9.co.uk) wrote on MMCLX September MCMXCIII
in <URL:news:37A2DC4E.A17A64A3@myspace.force9.co.uk>:
%% Hi, I'm a beginner in PERL,
As we can tell, as you cannot even spell Perl correctly!
%% When I've found a word in a file, how can I capture the next line of
%% that word and save that into a variable? Please help!
What is "the next line of that word" ?
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sat, 31 Jul 1999 17:03:55 GMT
From: chris18@my-deja.com
Subject: CGI---network,download question
Message-Id: <7nva9n$eiq$1@nnrp1.deja.com>
hello
This is my need
I am running LINUX , APACHE.
I want to write a download script which will run on the server for
managing downloads. It should not just redirect to the requred file ,
In fact it should breakup the file and send it to the user.
I have configured my
eth0:0 2.2.2.0
eth0:1 2.2.2.1
eth0:2 2.2.2.2
etc
I want the script to correctlt select the reqd IP based on request and
then start download
PLEASE SOMEBODY TELL ME WHAT PERL MODULES I HAVE TO USE AND HOW ???
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 31 Jul 1999 15:17:40 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: CGI---network,download question
Message-Id: <slrn7q6me3.i94.abigail@alexandra.delanet.com>
chris18@my-deja.com (chris18@my-deja.com) wrote on MMCLX September
MCMXCIII in <URL:news:7nva9n$eiq$1@nnrp1.deja.com>:
@@ hello
@@
@@ This is my need
@@
@@ I am running LINUX , APACHE.
And LINUX and APACHE start for which acronymes?
@@ I want to write a download script which will run on the server for
@@ managing downloads. It should not just redirect to the requred file ,
@@ In fact it should breakup the file and send it to the user.
@@
@@
@@ I want the script to correctlt select the reqd IP based on request and
@@ then start download
@@
@@ PLEASE SOMEBODY TELL ME WHAT PERL MODULES I HAVE TO USE AND HOW ???
Don't shout. But whatever you want to do, you never *have* to use Perl
modules. Although they are often convenient. But the description of what
you want to do to way to vague to determine what you need.
First make up your mind what you want, and how you want to do it. Then
we can talk about modules.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 31 Jul 1999 15:21:28 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: General question about CHMOD
Message-Id: <slrn7q6ml8.i94.abigail@alexandra.delanet.com>
Donboy (webmaster@roleplayinggames.net) wrote on MMCLX September MCMXCIII
in <URL:news:dKFo3.10823$Li1.27946446@news-read1.qis.net>:
~~ Hey everyone. I don't normally post on this discussion group, but I've got
~~ a question that I can't seem to otherwise find an answer to.
And you question has nothing to do with Perl. Absolutely nothing.
Ask elsewhere.
Abigail
--
perl -wlne '}print$.;{' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sat, 31 Jul 1999 20:13:02 +0100
From: "Ian Nicholson" <Ian.Nicholson@ukgateway.net>
Subject: Help opening a file
Message-Id: <7nvi5t$bb0$1@lure.pipex.net>
The following exert from a programming example produces an error stating
that the file or directory does not exist, although I have created an empty
file "survey_results.txt" in the same folder as the perl script.
I have also attempted to declare the full path to the file with the same
result.
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
my $results = 'survey_results.txt';
my %data = ();
my $thing = '';
my $val = 0;
open(RESULTS, $results) or die "Can't open results file: $!";
while (<RESULTS>) {
($thing, $val) = split(' ');
$data{$thing} = $val;
}
close(RESULTS);
I am running under windows '95 with the DOM installed.
I am new to Perl, as you can probably guess, and would greatly appreciate
any assistance.
------------------------------
Date: Sun, 1 Aug 1999 04:24:18 +1000
From: "Kim Saunders" <kims@emmerce.com.au>
Subject: Installing Perl Modules
Message-Id: <933445484.397360@draal.apex.net.au>
Hello all,
Ok, generally when one installs a module, you unzip it, CD to it's new dir,
and then do
perl Makefile.PL
make
make install
(in general, it obviously varies somewhat).
Is there any way that I can tell it where I want them? (like in home dir if
you don't have root access), other than manually copying them to the right
place?
Kims
------------------------------
Date: Sat, 31 Jul 1999 16:57:23 GMT
From: chris18@my-deja.com
Subject: LINUX APACHE PERL
Message-Id: <7nv9tg$e8r$1@nnrp1.deja.com>
I want to know about the complete administration of a webserver running
on LINUX , APACHE using cgi-perl.
can anyone tell me where I can find faqs , docs etc
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 31 Jul 1999 13:16:32 -0600
From: ljp <llornkcor@llornkcor.com>
Subject: Re: LINUX APACHE PERL
Message-Id: <wklnbw7hpr.fsf@llornkcor.com>
http://www.linux.org
http://www.apache.org
http://www.perl.com
chris18@my-deja.com writes:
>I want to know about the complete administration of a webserver running
>on LINUX , APACHE using cgi-perl.
>
>can anyone tell me where I can find faqs , docs etc
>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
--
llornkcor rocknroll
SpiritShip MultiMedia Recording Studio
www.llornkcor.com
(0 0)
+=======================----oOO--(_)--OOo----=========================+
__ _
/ / (_)__ __ ____ __
/ /__/ / _ \/ // /\ \/ /
/____/_/_//_/\_,_/ /_/\_\
The choice of a GNU generation...
------------------------------
Date: Sat, 31 Jul 1999 14:57:50 -0400
From: "Kenn Monte" <kmonte@columbus.rr.com>
Subject: Re: Modifying file permissions from a pl script
Message-Id: <xHHo3.765$x65.5316@viper>
<arpith@hotmail.com> wrote in message news:7nushu$5qi$1@nnrp1.deja.com...
> Hi,
>
> How will I be able to modify the file permissions of a file from a perl
> script ? Will this work: print `chmod 777 txtfile`;
>
> It didn't for me. is it supposed to ?
It should have.
>
> Is there any other way of making a certain file writable etc. Can you
> please give me an example.
another way, other than those mentioned in the other two responses would be:
system("chmod 777 txtfile");
>
> Thanks a lot,
>
> Arpith.
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Sat, 31 Jul 1999 17:04:06 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: NEWSFLASH: Supremes rule anti-advert-ware illegal
Message-Id: <7nv9rv$p10$1@holly.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
David Cassell <cassell@mail.cor.epa.gov> wrote:
>When Ernie Brouwer [a brand-spanking-new poster AFAIK]
>dropped in his Jabberwocky parody, was he chewed up and spit
>out? No. Tom's posting is relevant to ongoing conversations
>in this newsgroup [as well as elsewhere in the Perl world],
>so I think it is legit.
Tom was burnt to a crisp last year for a similar post. "White hat, Black
hat" or something like that. Although, I think the main reason that
post set everyone off is because it was cross-posted between 3 or more
newsgroups.
------------------------------
Date: Sat, 31 Jul 1999 20:00:04 +0100
From: "Ian Nicholson" <Ian.Nicholson@ukgateway.net>
Subject: Opening a text File (Newbie)
Message-Id: <7nvhdk$am6$1@lure.pipex.net>
The following exert from a programming example produces an error stating
that the file or directory does not exist, although I have created an empty
file "survey_results.txt" in the same folder as the perl script.
I have also attempted to declare the full path to the file with the same
result.
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
my $results = 'survey_results.txt';
my %data = ();
my $thing = '';
my $val = 0;
open(RESULTS, $results) or die "Can't open results file: $!";
while (<RESULTS>) {
($thing, $val) = split(' ');
$data{$thing} = $val;
}
close(RESULTS);
I am running under windows '95 with the DOM installed.
I am new to Perl, as you can probably guess, and would greatly appreciate
any assistance.
------------------------------
Date: Sat, 31 Jul 1999 18:18:45 +0100
From: "Webexchange Team" <help@xellent.co.uk>
Subject: perl problem, cgi
Message-Id: <7nvbad$sv5$1@nclient11-gui.server.virgin.net>
I'm currently developing a site for a competition (I'm 16 by the way) and
I've got a "add links" page where people fill in a html form with the site
address, description of the site (text area), their name and their email.
My problem is that I need to have all that info on one line in a data file,
which I can do but if the person hits the enter key while writing the
description of the site, then the data file has the new lines in the same
places, which ruins the file and makes it unusable. Any ideas how to remove
the enter character (or whatever it is) from the string that is mucking up
my file?
Lyndon Leggate
lyndon@earthling.net
(ps I'm sending this email through someone else computer which is why it
appears to come from webexchange team)
------------------------------
Date: Sun, 1 Aug 1999 04:21:45 +1000
From: "Kim Saunders" <kims@emmerce.com.au>
Subject: Re: perl problem, cgi
Message-Id: <933445335.635981@draal.apex.net.au>
Webexchange Team wrote in message
<7nvbad$sv5$1@nclient11-gui.server.virgin.net>...
>I'm currently developing a site for a competition (I'm 16 by the way) and
Good for you, nobody here cares how old you are. I'm 17 and do perl CGIs
full time from a job posted in this very newsgroup.
>My problem is that I need to have all that info on one line in a data file,
>which I can do but if the person hits the enter key while writing the
>description of the site, then the data file has the new lines in the same
>places, which ruins the file and makes it unusable. Any ideas how to
remove
>the enter character (or whatever it is) from the string that is mucking up
>my file?
$var =~ s/[\r\n]//g;
will kill all the newlines from $var. What is does is substisutes (what the
s stants for) all \n's or \r's (or a combination of both) with nothing
(which is equivalent to removing them, of course). Depending on the OS, a
newline is \n, \r or \n\r, which is VERY annoying (that's the reason you get
a staircase in UNIX from a DOS text file.
As an aside, someone please explain to me the reason behind this aweful
state of affairs, orther than purely to make life difficult, i'd be
interested to know.
KimS
------------------------------
Date: Sat, 31 Jul 1999 12:19:27 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl problem, cgi
Message-Id: <MPG.120cec05788c1434989d86@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <933445335.635981@draal.apex.net.au> on Sun, 1 Aug 1999
04:21:45 +1000, Kim Saunders <kims@emmerce.com.au> says...
> Webexchange Team wrote in message
> <7nvbad$sv5$1@nclient11-gui.server.virgin.net>...
...
> Good for you, nobody here cares how old you are. I'm 17 and do perl CGIs
> full time from a job posted in this very newsgroup.
That's a surprise. Jobs aren't supposed to be posted in this newsgroup.
> >My problem is that I need to have all that info on one line in a data file,
> >which I can do but if the person hits the enter key while writing the
> >description of the site, then the data file has the new lines in the same
> >places, which ruins the file and makes it unusable. Any ideas how to
> remove
> >the enter character (or whatever it is) from the string that is mucking up
> >my file?
>
>
> $var =~ s/[\r\n]//g;
>
> will kill all the newlines from $var. What is does is substisutes (what the
> s stants for) all \n's or \r's (or a combination of both) with nothing
> (which is equivalent to removing them, of course).
It might aid readability to replace the newlines by spaces, so words
from the previous lines don't run into words from the succeeding lines.
That can be done using your approach, but there is a better way to deal
with single-character manipulations, the 'translate' operator.
$var =~ tr/ \r\n\t\f/ /s;
efficiently converts any sequence of white-space characters into a
single space.
> Depending on the OS, a
> newline is \n, \r or \n\r, which is VERY annoying (that's the reason you get
> a staircase in UNIX from a DOS text file.
>
> As an aside, someone please explain to me the reason behind this aweful
> state of affairs, orther than purely to make life difficult, i'd be
> interested to know.
You really don't want to know the history of greed, indifference and
stupidity. Just be happy that when reading or writing files, Perl
translates the internal representation "\n" to and from whatever is
appropriate for the operating environment. One seldom needs to be
explicit about what the actual physical line termination is.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 31 Jul 1999 15:05:37 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl problem, cgi
Message-Id: <slrn7q6lng.i94.abigail@alexandra.delanet.com>
Webexchange Team (help@xellent.co.uk) wrote on MMCLX September MCMXCIII
in <URL:news:7nvbad$sv5$1@nclient11-gui.server.virgin.net>:
\\ I'm currently developing a site for a competition (I'm 16 by the way) and
And your age is relevant because of... ?
\\ I've got a "add links" page where people fill in a html form with the site
\\ address, description of the site (text area), their name and their email.
\\ My problem is that I need to have all that info on one line in a data file,
\\ which I can do but if the person hits the enter key while writing the
\\ description of the site, then the data file has the new lines in the same
\\ places, which ruins the file and makes it unusable. Any ideas how to remove
\\ the enter character (or whatever it is) from the string that is mucking up
\\ my file?
Yes, the manual describes several operators that will do that for you.
Go and read the manual.
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 31 Jul 1999 15:07:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl problem, cgi
Message-Id: <slrn7q6lrf.i94.abigail@alexandra.delanet.com>
Kim Saunders (kims@emmerce.com.au) wrote on MMCLX September MCMXCIII in
<URL:news:933445335.635981@draal.apex.net.au>:
## Depending on the OS, a
## newline is \n, \r or \n\r, which is VERY annoying (that's the reason you get
## a staircase in UNIX from a DOS text file.
No, you got that wrong. A newline is always a \n, it's the bytesequence
\n translates to that differs. But a newline is always a \n, be it on
Unix, Mac or Windows.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 31 Jul 1999 15:10:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl problem, cgi
Message-Id: <slrn7q6m03.i94.abigail@alexandra.delanet.com>
Larry Rosler (lr@hpl.hp.com) wrote on MMCLX September MCMXCIII in
<URL:news:MPG.120cec05788c1434989d86@nntp.hpl.hp.com>:
$$
$$ It might aid readability to replace the newlines by spaces, so words
$$ from the previous lines don't run into words from the succeeding lines.
$$ That can be done using your approach, but there is a better way to deal
$$ with single-character manipulations, the 'translate' operator.
$$
$$ $var =~ tr/ \r\n\t\f/ /s;
$$
$$ efficiently converts any sequence of white-space characters into a
$$ single space.
It isn't "better" in my book, as that would require me to remember what
characters are whitespace characters. There's a \s in regexes for a reason.
$var =~ s/\s+/ /g;
And if that isn't as efficient as tr///, Ilya can put something on his
TODO list. ;-)
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sat, 31 Jul 1999 14:59:33 -0400
From: brian@pm.org (brian d foy)
Subject: Re: pipes vs csv
Message-Id: <brian-3107991459330001@sri.dialup.access.net>
In article <7nuro6$s8n$1@nntp8.atl.mindspring.net>,
<joeyandsherry@mindspring.com> wrote:
>Is there an advantage or disadvantage of using pipes versus commas as field
>delimiters in flat text files? I have been successfully using commas, but
>have run into a few problems here and there, and was thinking that pipes
>would eliminate this potential.
use the DBI interface with DBD::CSV. that way you can get on
with the task at hand rather than worrying about the database
details. :)
--
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: 31 Jul 1999 15:33:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: pipes vs csv
Message-Id: <slrn7q6nba.i94.abigail@alexandra.delanet.com>
joeyandsherry@mindspring.com (joeyandsherry@mindspring.com) wrote on
MMCLX September MCMXCIII in <URL:news:7nuro6$s8n$1@nntp8.atl.mindspring.net>:
;;
;; Is there an advantage or disadvantage of using pipes versus commas as field
;; delimiters in flat text files? I have been successfully using commas, but
;; have run into a few problems here and there, and was thinking that pipes
;; would eliminate this potential.
There's nothing magical about pipes versus commas. One has byte
representation 0x7C, the other 0x2C.
The only difference is that you don't have to escape commas when used in
a regex, while you have to escape pipes.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sat, 31 Jul 1999 15:28:26 -0400
From: Paul <niteshde@twd.net>
Subject: Please help with classified script
Message-Id: <37A34E5A.3B4D3BE8@twd.net>
sorry if this is the wrong group
Hello,
for the last 2 days I've been trying to get a classified ad script to
run on a website. (btw, the script generates all HTML pages that are
needed ie: ad category pages, ad submission form...)
ad category pages are generated and displayed when the "view ads" button
is clicked on, and the "post an ad" page is generated and displayed when
an ad is to be posted;
*the problem* is when the form button "post ad" is pressed after
entering ad info on the ad submission page... the following results
occur:
in internet explorer: a blank page is loaded.
in netscape navigator: an error message stating "The document contained
no data. Try again later, or contact the server's administrator" is
displayed.
i don't have experience programming in Perl, only intermediate to
advanced experience writing HTML, so i'd have no idea if there was
something written incorrectly in the script. (it's from a company called
e-classifieds i believe)
i have assigned every file's and directories' rights correctly, tried
both ".pl" and ".cgi" extensions, and all paths have been set
accordingly. i even edited the script with only "notepad" and have
uploaded the script in the ASCII format.
if someone could Please help me out here i'd be very thankful.
-paul
------------------------------
Date: 31 Jul 1999 15:36:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Please help with classified script
Message-Id: <slrn7q6nhp.i94.abigail@alexandra.delanet.com>
Paul (niteshde@twd.net) wrote on MMCLX September MCMXCIII in
<URL:news:37A34E5A.3B4D3BE8@twd.net>:
##
## i don't have experience programming in Perl, only intermediate to
## advanced experience writing HTML, so i'd have no idea if there was
## something written incorrectly in the script. (it's from a company called
## e-classifieds i believe)
Ah, yes, so you just ask a question here, and based on symptoms like
"a blank pages is loaded" you expect this group to know?
If you have problems with a specific program, contact your vendor,
or the authors.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 31 Jul 1999 18:38:51 GMT
From: "Sylvain Hogue" <shogue@securenet.net>
Subject: Re:ebcdic packed numbers
Message-Id: <01bedb83$40e68340$311071d8@vilaval>
>I have a ebcdic to ascii converter that works well on everything but
packed
>numbers (signed and unsigned). Does anyone have a tip or code that
converts
>this field type?
>Norm <frech@primary.net>
I made an error in my previuos post, I correted my scipt and tested it on
reals packed fields and it is worked
Then my function to convert pack field to number
the function accept a string of 8 bytes ( generaly it is the size of this
kind of field) containing the pack field and return a number.
sub packed_to_decimal($number)
{
my $packed=shift;
$amount=0;
for($r=0,$q=13;$r<7;$r++,$q-=2)
{
#handle the first 7 bytes of the field
$temp=vec($packed,$r,8);
$temp1=int($temp/16); # previously i forgot that the number is hex
$temp2=$temp%16; # then a convert it to decimal
$temp=$temp2+($temp1*10);
$amount+=($temp*(10**$q));
}
# $amount must have = 1231
$last=vec($packed,7,8); # the last bytes
$amount+=int($last/16); # add the last digit
# $amount is now 12315
$signe=$last%16;
if($signe==13) # finish by letter D =negative
{
$amount*=-1; # make negative the amount is -12315
}
return $amount; # return the result
}
bla..
bla bla...
$n=packed_to_decimal($pack_filed);
print $n;
Sylvain Hogue
------------------------------
Date: 31 Jul 1999 19:53:18 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Use of uninitialized value at ...... warning with hash of hash
Message-Id: <7nvk7e$4vg$1@lublin.zrz.tu-berlin.de>
David Cassell <cassell@mail.cor.epa.gov> wrote in comp.lang.perl.misc:
>I already answered this one via e-mail. I didn't realize that
>he had posted this as well.
Shame on him. It's bad manners.
Anno
------------------------------
Date: Sat, 31 Jul 1999 20:34:27 +0200
From: Thomas Schmickl <schmickl@magnet.at>
Subject: why are you so harsh to this guy ?
Message-Id: <37A341B3.94AF970F@magnet.at>
Tad McClellan schrieb:
> : what kind of sort is sort() function ? (selection sort, quick sort !?)
>
> perl -ne 'print "$ARGV: $_" if /quick/i and /sort/i' *.pod
>
> perldelta.pod: =head2 Quicksort is internally implemented
> perlmodlib.pod: (though having 23 called Sort::Quick is only marginally better :-).
> perltoc.pod: =item Quicksort is internally implemented
>
> You could have answered that one yourself too.
>
> Stop it!
>
> Your time is NOT more valuable than everyone else's.
>
> Spend _some_ of yours before asking others to spend their's.
> ...
> Perl is a very poor programming language. Only those who can
> read can program in Perl.
>
> Give up on Perl and go learn Visual Basic instead.
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
Do you really have to be so unpolite to this guy ???
To me it seems that he simply had a question, he couldnt answer by himself.
Maybe he is just a beginner in perl, who couldnt just type
" perl -ne 'print "$ARGV: $_" if /quick/i and /sort/i' *.pod " ?
What the question was about, you could have easily detect by his self-explanatory
subject in the mail header. So if your time is that expansive, why have you read his
posting ? Have you got a few frustrations you wanted to loose.
ciao, and my your problems disapear like smoke in the sky
thomas.
------------------------------
Date: Sat, 31 Jul 1999 20:06:11 GMT
From: Rodney Schuler <u233@my-deja.com>
Subject: Win32: how to get OLE object from CLSID
Message-Id: <7nvkve$lkd$1@nnrp1.deja.com>
I am trying to drive two different versions of an application, so I
cannot use the normal OLE class name "MSDEV.APPLICATION", as that has
different CLSID's associated with it depending on which version I
installed most recently. I know the CLSID's for the two versions of
"MSDEV.APPLICATION" that I which to drive, but I don't know how to
create instances given just the CLSID.
Please make your answer painfully clear, as I have been hacking perl
for only 10 hours so far.
Thanks in advance.
--
Rodney Schuler
rodney@eai_dot_com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 31 Jul 1999 17:58:27 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Write to file!!! Need help!!!
Message-Id: <7nvdg3$4qg$1@lublin.zrz.tu-berlin.de>
Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc:
>better off just saying to him to drop the quotes around "@array" when he
>is printing it.
Still better to tell him not to read files into an array unless it's
required. It certainly isn't when the plan is to copy the file line
by line.
Anno
------------------------------
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". 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 V9 Issue 323
*************************************