[12898] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 308 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 30 05:07:17 1999

Date: Fri, 30 Jul 1999 02:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 30 Jul 1999     Volume: 9 Number: 308

Today's topics:
    Re: [Summary] Korn Shell or Perl? (brian d foy)
    Re: Comparing Scalars (Jarle H. Knudsen)
    Re: Creating dynamic GIF-s from CGI-script (Bart Lateur)
    Re: crypt returns different values since ISP upgrade. <rbush@freeway.net>
    Re: ebcdic packed numbers (Bart Lateur)
    Re: File upload problem Newbie!! <Paul.Foran@analog.com>
    Re: Getting Height and Width of GIF/JPEG in PERL? (Abigail)
        Guaranteed $300k (Clifton)
    Re: How to read the submit button as a name or value <cassell@mail.cor.epa.gov>
    Re: How to trim a String (Abigail)
    Re: How to: run a DOS batch in perl/cgi? (Bart Lateur)
    Re: How to: run a DOS batch in perl/cgi? (Anno Siegel)
        Newbie alert !! <cajun@rattler.cajuninc.com>
    Re: Newbie alert !! (Sam Holden)
    Re: Newbie alert !! <swiftkid@bigfoot.com>
    Re: NEWSFLASH: Supremes rule anti-advert-ware illegal <gellyfish@gellyfish.com>
        parameter doesn't show up <maria.zevenhoven@kolumbus.fi>
    Re: perldoc -q : not giving expected results <cassell@mail.cor.epa.gov>
    Re: perldoc -q : not giving expected results (Bart Lateur)
    Re: Premature end of script headers??? delta635241@my-deja.com
    Re: Printing lines BTW two strings in file (NOT!) <cassell@mail.cor.epa.gov>
    Re: Printing lines BTW two strings in file (NOT!) <cassell@mail.cor.epa.gov>
        proposed software release <dalleyjo@pilot.msu.edu>
    Re: proposed software release (brian d foy)
    Re: Re: How to read the submit button as a name or valu (Abigail)
    Re: two forms interact with one script? <nslatius@dds.nl>
    Re: Using perl to ftp non interactively (I.J. Garlick)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 30 Jul 1999 04:44:48 -0400
From: brian@pm.org (brian d foy)
Subject: Re: [Summary] Korn Shell or Perl?
Message-Id: <brian-ya02408000R3007990444480001@news.panix.com>

In article <37a148c0@news3.us.ibm.net>, mwang@mindspring.com (Michael Wang) posted:

> brian d foy <brian@pm.org> wrote:
> >
> >$_ = "local yp";
> >foreach my $i ( split )
> >   {
> >   open FILE, $i eq 'local' ? "/etc/passwd" : "ypcat passwd |"
> >      or next;
> >   
> >   while( defined( my $line = <FILE> ) )
> >      {
> >      ....
> >      }
> >      
> >   close FILE;
> >   }
> 
> Thank you for showing the code. It is close to the shell style, it is cool.
> However I still can not apply the code to the mixture of "file"
> such as "/etc/passwd" or "ypcat passwd |", and list keys(%beeper_byname).

gees.  are you going to learn some Perl or not?  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.  you just have to have some notion of computer
programming.

i didn't see any mention of %beeper_byname in your shell script, so
i didn't include it in my translation.

again, if you don't like Perl, don't use it, but quit whining about
your personal shortcomings in using it.

> Let me simply state my question again. I need Perl code which does the same
> as what shown above, but does not have "out of memory" problem when
> applied to large amount of data. I appreciate your help. 

ah, the true motivation comes out!  you're just a leech!  you thought you
could get somebody else to do your work for you. send a check and i'll 
write the code, but now that i know you're a deceptive parasite i have
absolutely no desire to help you.  had you said all of this before you
would have most likely gotten a completely satisfactory answer right
away.  see how much trouble your deception has caused?

what happened to your love of the Korn shell?  why not just use that?
i'm guessing that you don't know how do it in shell either.

-- 
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>
release the eagle!


------------------------------

Date: Fri, 30 Jul 1999 07:35:14 GMT
From: no.unsolicited.mail.please@jarle.com (Jarle H. Knudsen)
Subject: Re: Comparing Scalars
Message-Id: <37a25556.3291773@goliath.newsfeeds.com>

On Thu, 29 Jul 1999 17:02:31 -0700, David Cassell
<cassell@mail.cor.epa.gov> wrote:

>She was probably expecting the Spanish Inquisition.  :-)

Nobody expects the Spanish Inquisition!

-- 
  Jarle H. Knudsen


  -----------== 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: Fri, 30 Jul 1999 08:16:14 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Creating dynamic GIF-s from CGI-script
Message-Id: <37a85c29.5427908@news.skynet.be>

Ron Savage wrote:

>And
>anywhere on your web site you can install a script, you can install a module
>(hint, hint).

Not if installing a module requires the use of a C compiler.

	Bart.


------------------------------

Date: Fri, 30 Jul 1999 08:25:57 +0000
From: Ray Bush <rbush@freeway.net>
Subject: Re: crypt returns different values since ISP upgrade.
Message-Id: <7nrnio$gre@newsops.execpc.com>

Daniel Ulrich wrote:
> 

CPU upgrade and this happens?  Perhaps /dev/random is implemnted
different?  I might have thought originally that this could maybe been
md5 passwords but you say format is still crypt.

> I have had the same problem. It seems that in my linx system it uses some
> type of ID number off of the CPU to generate it's encryption. I tested this
> several times. I even went out and got another CPU same brand and same type
> and it still did not recognize the passwords right. But when I swaped my
> original chip back in it worked just fine. My question is WHY?
> 
> Have Fun
> Shades__
> 
> Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu> wrote in message
> news:378CFC5B.42DA35CF@mcmahon.qal.berkeley.edu...
> > You're not using crypt() right, for two distinct reasons.
> >
> > First, the salt is supposed to be a two-character string; you've given it
> > one character. I tested this between NT and solaris running a couple
> > different versions of perl; NT and solaris returned different strings for
> > crypt('4runner',7) (although, interestingly, several different solaris
> > machines, and different versions of perl under solaris, returned the same
> > string). However, if you use a 2-character salt, the strings returned are
> > all the same; for example, on both NT and Solaris:
> >
> > perl -e "print crypt('4runner','ee');"

Beware also that perl will let you use just about any character here
for the salt this is not necessarily so of the unix crypt/password
routings.

> > eebws7QYy.gjw
> >
> > Second, by always setting the salt to any given value (in this case, '7'),
> > you're disabling part of the routine. If you check out some of the
> password
> > programs floating around (notably the one in the old camel book), you'll
> > note that the salt is generated out of some dynamic routine, often tied to
> > the time the program is run.  The crypt() routine puts the salt in the
> first
> > two characters of the hash, which is why crypt('foo','xx') will always
> > return a string starting with xx.
> >
> > Assume $user contains the password the user typed in, and $passwd contains
> > the crypt()ed password from the file. The following code will work
> > regardless of the crypt() command that created the hash:
> >
> > if (crypt($user, substr($passwd, 0, 2)) eq $passwd) {
> >     # The password given was correct.
> > } else {
> >     # The password given was incorrect.
> > }
> >
> >
> > robyoung wrote:
> >
> > > Upon investigation, I found that the encrypted password values in the
> > > members log file was not the same as what Perl was now generating .  The
> > >
> > > encryption algorythm has not changed.  As you know, an encrypted
> > > password routine must reproduce the same values every time to be
> > > effective.
> >
> >
> >
> > --
> > -------------------------------------------------------------
> > Andrew Perrin - NT/Unix/Access Consulting -
> aperrin@mcmahon.qal.berkeley.edu
> >
> >         http://www.geocities.com/SiliconValley/Grid/7544/
> > -------------------------------------------------------------
> >
> >
> 
>   -----------== 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: Fri, 30 Jul 1999 08:16:12 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: ebcdic packed numbers
Message-Id: <37a75b65.5232539@news.skynet.be>

Uri Guttman wrote:

>perl's bigint modules should satisfy that need without any extra effort.

Math::Bigint? With decimal points?

	Bart.


------------------------------

Date: Fri, 30 Jul 1999 09:03:52 +0100
From: Paul Foran <Paul.Foran@analog.com>
Subject: Re: File upload problem Newbie!!
Message-Id: <37A15C68.35B0A14D@analog.com>

Abigail wrote:

> Paul Foran (Paul.Foran@analog.com) wrote on MMCLVIII September MCMXCIII
> in <URL:news:37A05998.2C01C06D@analog.com>:
> == Hi all,
> ==   Can somebody get me started on this one as I am new to Perl. I need to
>
> Here are the first two lines:
>
> #!/opt/perl/bin/perl -w
> use strict;
>
> == be able to upload a Data file to a server via a HTML form. The datafile
> == is delimited table from MS Access. I need towrite to srcipts that will
> == accept the file being uploaded and to also get MSQL to read this table
> == into an exsisting table within MSQL.
> ==
> == Any solutions , thanks alot
>
> You mean, completely written programs, based on the 0 characters you
> contributed? Sure, but are you going to pay the rates?
>
> Here's a suggestion: learn Perl. Study the specifics of your problem.
> Write code. Fail. Learn from your failures. Meditate over the FAQ.
> Hug a tree. Write more code. Don't crosspost to comp.lang.perl.modules.
>
> Then, if you get stuck with a specific Perl problem, that's not a FAQ,
> or explained in the manual, you post your question here.
>
> 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 ==-----

ABIGAIL,
HEY I did not say the COMPLETE PROGRAM. READ THE CONTENT OF THE MY POST.
"SOMETHING TO GET ME STARTED" to point me int the right direction. This is a
newgroup right??



------------------------------

Date: 30 Jul 1999 02:13:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <slrn7q2k3n.fmt.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCLIX September MCMXCIII in
<URL:news:x7wvviojwz.fsf@home.sysarch.com>:
^^ >>>>> "A" == Abigail  <abigail@delanet.com> writes:
^^ 
^^   A> Bullocks. Windows doesn't create stupid coders, and another OS certainly
^^   A> doesn't prevent stupidity either. Redmondware doesn't have the monopoly
^^   A> at bad html either.
^^ 
^^ no, but its epidemic spread has unleashed the hordes of html
^^ 'programmers' out there many of which use redmondware to create their
^^ pages which are breaking whatever 'standards' the web has. why do you
^^ think there is a script called the demoronizer (updated by our larry
^^ rosler)?
^^ 
^^ do you like to read pages on your unix browser which has chars showing
^^ up as '?' ? i get very pissed off at that, more than blink or other
^^ tags. i can ignore blink but i can't read ? (even though it is usually a
^^ ' or `).


*sigh* And why is this the fault of M$? Long before MSIE was available,
Netscape already had the misfeature of ignoring the HTML standards and
displaying out of range code points on Windows and Mac machines.

Had Netscape just realized that standards are good, you wouldn't have
had this problem.


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: 30 Jul 1999 17:59:48 GMT
From: solomonclifton@hotmail.com (Clifton)
Subject: Guaranteed $300k
Message-Id: <8E1314EF7solomoncliftonhotmai@news.cyber.net.pk>

To Whom It May Concern:
	Earn a Million dollars! Make money quick! Send a dollar to six people!  
Sure we all have read these ridiculous ads where destitute lurches have 
sought out to scheme America into sending them money, with the only 
intention of gaining capita for themselves.  But I have found something 
real and I want to share it with you and I will explain why.  When I 
thought about how I would address something that I had came across, I did 
not know what approach to take.  What I mean is, how can I get someone to 
believe what I speaking of is true and concrete.  Well the truth of the 
matter is that I can not. All I can do is alert those out there who are 
willing to read and take a chance.  My name is Clifton and I am an ordinary 
person just like you.  I have worked many part-time jobs in the past and 
have struggled to give myself a higher education.  There came a point in my 
life where I was tired of struggling for worthless paychecks, and I found 
interest in the stock market and investments.  So I went to the library, 
read many different books until I stumbled upon something disturbing-
something that was too good to be true.  And no it was not the Roth IRA or 
any other savings plan where you're going to be 65 before you see your 
first million dollars.  Who wants to be an old man with an account full of 
money that you're too old to enjoy?  So I consulted friends in the business 
school of the college I attended as well as other brokerage consultants.  
To make a long story short, I have came across something phenomenal.  There 
is an investment strategy has came about with guaranteed outputs that 
multiply the initial investment by thousands.  And when I say investments, 
I mean pocket money!  Like $30 or $50 that will result in $300,000 to 
$500,000 on January 1, 2000.  I know it sounds like bullshit…believe me!  I 
was the biggest critic, but I stopped being a critic when my investment 
paid off for 1999.  My criticism came to a halt when I went from $7.00/ 
hour to a bank account balance of $658,239,492.67 in two months!  The key 
to making it in life is knowledge and strategy.  If you take a millionaire 
businessmen, strip him of all his money, and throw him back into society at 
the bottom; he will most likely end his life a wealthy man despite his 
loss.  Because of his knowledge of the business world and inherited 
strategy.  I am sure you are asking: If this is true, why would Clifton 
share this secret with me?  The answer is simple once you read the 
information I am referring to.  But as for now, think realistically Amway 
and other network-martyring groups only output real money for the people 
who started the business and not the people on the bottom who join later!  
I know this is not clear, but bare with me!  This can change your life!  
And I guarantee, under penalty of lawsuit, that this step is a guaranteed 
step towards a great sum of money for little or no money down!  I am not 
asking you to buy anything from me, nor am I out for profit.  I will send 
you a packet for free with contact information and detailed summations of 
how to make this work!  All I am asking for is the postage and handling 
fees to send you this information.  This fee is only $1.00.  With a very 
strong guarantee!  And also with no need to purchase anything in order to 
receive your check.  And if you do not feel this information to be real, I 
will send you $5.00!  So what is it that you have to lose? Nothing at all 
because if the information if false I am paying you five times your 
investment. (hint)  Now the information that I have provided here is 
evidential enough to file a lawsuit against myself, and these are no 
statements you will find present in any Internet scam!  What you are 
getting here is a guarantee, something that you can't even get in a 
department store for a buck.  No checks or money orders, this is very 
simple!  Just place a one-dollar bill and fold it in a piece of paper and 
send it to the address following this message.  I guarantee that you will 
receive this information via The US Postal Service within 2-3 weeks at the 
very most.  I am giving you more word that this is a real way to make real 
money, for the price of a un-guaranteed lottery ticket. I guarantee you 
that you will not be disappointed.  This is real!  This letter is in no way 
to persuade you to do anything, but it is my attempt to give back to the 
community that I was once a part of.

One (1) $1.00 bill via the US Postal Service to 
Clifton Solomon
Eigenmann Suite 473
Bloomington, In. 47406  


------------------------------

Date: Fri, 30 Jul 1999 00:24:18 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to read the submit button as a name or value
Message-Id: <37A15322.1EAAA8C5@mail.cor.epa.gov>

Vox wrote:
[big snip]
> %% read(STDIN, $input, $ENV{'CONTENT_LENGTH'})
>
> >Stop! Do not use such code. Why don't you use CGI.pm?
> 
> >Abigail
> 
> What do you mean by 'Do not use such code'.  It works fine for getting the
> input from users and what is CGI.pm?

You mean 'it works fine as far as I know'.  But since you
don't check the read() or do the verification on it, how will
you know when something goes wrong?

CGI.pm is a very nice Perl module which will do everything
for you but wave goodbye to Matt Wright.  If it's not on
your machine, get it [from ActiveState if you're on win32,
from CPAN otherwise].  If it's not on your ISP's machine,
buy their sysadmins a case of imported beer and ask them
nicely to install it for you.  Pointing out that it will
help them avoid nasty security holes from krufty code 
wouldn't hurt either.  CGI.pm comes with very nice docs 
filled with helpful examples.  Once you start using it,
you'll thank Abigail for pointing you in that direction.
 
HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: 30 Jul 1999 02:17:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to trim a String
Message-Id: <slrn7q2kav.fmt.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCLIX September MCMXCIII in
<URL:news:x7pv1aoj4r.fsf@home.sysarch.com>:
;; 
;; true. i forgot that happened to me recently. it was at first confusing
;; and then very annoying. i would figure he would filter on the proper
;; headers rather than any text anywhere. maybe he will see this but i
;; doubt he will fix his filter. what bugs me the most is he will cc me but
;; i can't always cc him back.


So, write a filter and bounce his mail ;-)



Abigail
-- 
sub A::TIESCALAR{bless\my$x=>A};package B;@q=qw/Hacker Another
Perl Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => 'A';print "$shoe $shoe $shoe $shoe\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: Fri, 30 Jul 1999 07:02:25 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to: run a DOS batch in perl/cgi?
Message-Id: <37a84d76.1665490@news.skynet.be>

Abigail wrote:

>Where does Tim says he wants to run an *MSDOS* .bat file?
>
>If you read the above quote again, he writes:
>
>      ... and then the .bat file will run ...
>
>No mentioning of MSDOS.

Hint: there is a subject line.

	Bart.


------------------------------

Date: 30 Jul 1999 08:52:27 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to: run a DOS batch in perl/cgi?
Message-Id: <7nrp4b$2ou$1@lublin.zrz.tu-berlin.de>

Abigail <abigail@delanet.com> wrote in comp.lang.perl.misc:
>Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMCLVIII
>September MCMXCIII in <URL:news:7nprf2$1j8$1@lublin.zrz.tu-berlin.de>:
>:: Abigail <abigail@delanet.com> wrote in comp.lang.perl.misc:
>:: >Bart Lateur (bart.lateur@skynet.be) wrote on MMCLVII September MCMXCIII
>:: >in <URL:news:37a31487.1973345@news.skynet.be>:
>:: >[] Tim Nettleton wrote:
>:: >[] 
>:: >[] >I have need to run a batch file that requests nslookup and ping informat
>:: >[] >on several hosts.  I would like to have a form on a page that someone ca
>:: >[] >just type in the IP or domain and then the .bat file will run in the
>:: >[] >CGI-BIN.  I have a unix server and a NT server.
>:: >[] >
>:: >[] >Is this possible?
>:: >[] 
>:: >[] Not on Unix. :-)
>:: >
>:: >
>:: >What part of what he wants to do will not be possible on Unix?
>:: 
>:: Running the msdos .bat file?
>
>
>Where does Tim says he wants to run an *MSDOS* .bat file?
>
>If you read the above quote again, he writes:
>
>      ... and then the .bat file will run ...
>
>No mentioning of MSDOS.
>
>
>Now, I know how to execute a file called .bat on Unix. Perhaps you and
>Bart don't....

And if the text between the lines were printed in red 17 point boldface
you'd refuse to read it.  Such single-mindedness is admirable and
appreciated for its educational value.

Anno


------------------------------

Date: Fri, 30 Jul 1999 01:00:45 -0700
From: 96Vette <cajun@rattler.cajuninc.com>
Subject: Newbie alert !!
Message-Id: <37A15BAD.32AF9496@rattler.cajuninc.com>

I've got a database (really just a text file) that the definition of the
database has been changed (more fields added at the end).

Current database example:

|Mary|601 Elm Street|Nowhere, CA|99999|555-111-2222|
|Joe|432 Pine Street|Downtown, CA|88888|555-222-3333|

Pretty trivial except the real database has several thousand records.

The database definition has been expanded to include five more blank
fields at the end of each record.  Making the new database example look
like this:

|Mary|601 Elm Street|Nowhere, CA|99999|555-111-2222||||||
|Joe|432 Pine Street|Downtown, CA|88888|555-222-3333||||||


It would seem that this would be a trivial matter for a perl script.
I'm pretty sure this will involve the "." operator, but I'm not sure how
to go about it.

Thanks,
Mike




------------------------------

Date: 30 Jul 1999 08:21:36 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Newbie alert !!
Message-Id: <slrn7q2o4u.ild.sholden@pgrad.cs.usyd.edu.au>

On Fri, 30 Jul 1999 01:00:45 -0700,
   96Vette <cajun@rattler.cajuninc.com> wrote:

If you choose a subject that relates to the question you might
actually get an answer.

>Current database example:
>
>|Mary|601 Elm Street|Nowhere, CA|99999|555-111-2222|
>|Joe|432 Pine Street|Downtown, CA|88888|555-222-3333|
>
>The database definition has been expanded to include five more blank
>fields at the end of each record.  Making the new database example look
>like this:
>
>|Mary|601 Elm Street|Nowhere, CA|99999|555-111-2222||||||
>|Joe|432 Pine Street|Downtown, CA|88888|555-222-3333||||||
>
>
>It would seem that this would be a trivial matter for a perl script.
>I'm pretty sure this will involve the "." operator, but I'm not sure how
>to go about it.

perl -lni -e 'print $_,"|||||"' database.file

Since this is perl there are about ten million other ways of doing it,
about half of which are probably 'better' as measured by some metric (some
of which are better as measured by all metrics, in all likelyhood).

You can read the documentation that comes with perl to find out what it
all does. The perlrun documentation might be a good place to start...

Of course this is also trivial to do with sed.  Just as easy with any
reasonable text editor.

-- 
Sam

About the only thing most people know about black holes is they are
black, and now we have stuffed that up
	-- Dr Paul Francis (after reporting finding 'pink' holes)


------------------------------

Date: Fri, 30 Jul 1999 13:14:24 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Newbie alert !!
Message-Id: <7nsq7p$oo011@news.cyber.net.pk>

: |Mary|601 Elm Street|Nowhere, CA|99999|555-111-2222|
:
: The database definition has been expanded to include five more blank
: fields at the end of each record.  Making the new database example look
: like this:
:
: |Mary|601 Elm Street|Nowhere, CA|99999|555-111-2222||||||
:
: It would seem that this would be a trivial matter for a perl script.
: I'm pretty sure this will involve the "." operator, but I'm not sure how
: to go about it.

perldoc -f split




------------------------------

Date: 30 Jul 1999 09:33:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NEWSFLASH: Supremes rule anti-advert-ware illegal
Message-Id: <37a16354@newsread3.dircon.co.uk>

lt lindley <ltl@rgsun5.viasystems.com> wrote:
> Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> 
> :>Spooky - no sooner had I posted that than 207.87.178.66 showed up in my
> :>server log <shiver>
> 
> Inside joke?
> 
> ksh: nslookup
>> set q=ptr
>> 66.178.87.207.in-addr.arpa
> *** ... can't find 66.178.87.207.in-addr.arpa: Non-existent host/domain
>> 
> 
> Or is there another method to find the source of that mysterious address?
> 

Er <http://207.87.178.66> ;-}

/J\
-- 
"In last week's show Lee Mack suggested that David Copperfield was a
smarmy fucking twat. Well done Lee" - Channel 4 Continuity Announcer


------------------------------

Date: Fri, 30 Jul 1999 11:19:09 +0200
From: "Maria Zevenhoven" <maria.zevenhoven@kolumbus.fi>
Subject: parameter doesn't show up
Message-Id: <7nrn0k$j5r$1@news.kolumbus.fi>

I made this thing to test, but it doesn't work:

#!/usr/bin/perl

print "Content-type: text/plain\n\n";
print '<html>';
print "<br><h1>Kalenteri 0.01b</h1>\n";
print "<br>";

read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
print "Parameter: $in";

with perl -w I get the following:

<html><br><h1>Kalenteri 0.01b</h1>
Use of uninitialized value at kalenteri.cgi line 8.
<br>Parameter:


so what went wrong?





------------------------------

Date: Fri, 30 Jul 1999 00:15:38 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perldoc -q : not giving expected results
Message-Id: <37A1511A.8D539834@mail.cor.epa.gov>

Mike G. wrote:
> 
> I presume that an example of searching the faq would be :
>   perldoc -q hash
[snip]
> Am I missing something about what args perldoc needs?
> 
> version 5.004_04

You got *anything* out of perldoc -q with 5.004_04 ?
Wow.  I'm impressed.  None of my 5.004_04 stuff ever
supported perldoc -q .  If you upgrade to 5.005, this 
will probably work better.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: Fri, 30 Jul 1999 08:16:09 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: perldoc -q : not giving expected results
Message-Id: <37a55992.4765402@news.skynet.be>

Mike G. wrote:

>I presume that an example of searching the faq would be :
>  perldoc -q hash
>
>Yet, no matter what I put in place of hash, I always get the same two answers.

There must be something wrng with your install/version of perldoc. I get
the following entries (file, title and contents) of:

  How can I free an array or hash so my program shrinks?
  Why does defined() return true on empty arrays and hashes?
  How do I process an entire hash?

and a lot more.

	Bart.


------------------------------

Date: Fri, 30 Jul 1999 08:16:50 GMT
From: delta635241@my-deja.com
Subject: Re: Premature end of script headers???
Message-Id: <7nrn1b$1ph$1@nnrp1.deja.com>

In article <379F3822.E8CA2C19@guideguide.com>,
  John Imrie <jimrie@guideguide.com> wrote:
>
>  [Wed Jul 28 08:04:37 1999] access to
/my/dir/app.cgi failed for
>  my.client.com,
>  reason: Premature end of script headers
>



check permission  file

you must have : r-rwxr-xr-x

and try again


hope this help :-)


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Fri, 30 Jul 1999 00:09:52 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Printing lines BTW two strings in file (NOT!)
Message-Id: <37A14FC0.DA2B6CBC@mail.cor.epa.gov>

John Hagen wrote:
> 
> Good evening,

Guten aben.

> I have a perl script that does not print lines between two strings in  a file,
> as I expected it would. In fact, it does not print anything at all.

See below for why.

[snip] 
> I decided on an explicit method of referencing the lines in @eks_file because I
> need the offsets into the file to use with splice after this script undergoes
> more development.

I don't follow this one.  splice() is nice, but there are
approaches you might want to trim your array down to size first,
so you don't have to get at indices directly.
 
> Please take a look at my script and data. How is my script broken?
> 
> And, is there a better way to do this? Could I do this better with a multiline
> match and grep? If so, how?

> #! /usr/bin/perl

#!/usr/bin/perl -w
use strict;

>  open(EKS_FILE, $ARGV[0]) || die "Sorry, cannot open input file $ARGV[0]";

Okay, I like that part.  You checked the return.  I would have
put $! in the die() so I could see why the OS choked on the 
open() .
 
>  @eks_file=<EKS_FILE>;
> 
>  foreach $i ( 0 .. $#eks_file ) {
> 
>      if ( $eks_file[$i] =~ /BALANCING CONDITIONS/ ) {

Okay, we have to have 'BALANCING CONDITIONS' in the line.
 
>          while ( $eks_file[$i] !~ /\*\*\*\*/ ) {

And we have to *not* have '****' in the same line.

Oh wait.  There are no lines in your data which meet both
conditions simultaneously!

You'll want to read about the range operator ( .. ) so
you can see a simple way to snag the lines between your 
start and end lines.  AAMOF, you might look at a post by
Randal Schwartz earlier today in this ng, which showed how
to do this while not capturing the start or end lines
either.

[snip of rest of code and data]

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: Fri, 30 Jul 1999 00:13:18 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Printing lines BTW two strings in file (NOT!)
Message-Id: <37A1508E.B06BD1F5@mail.cor.epa.gov>

chris dawson wrote:
[snip]
> >  @eks_file=<EKS_FILE>;
> 
> Suppose you were to put
>         print $eks_file[0], "\n";
> in here. (idiots guide to debugging tip #1)
> 
> I was under the impression that <EKS_FILE> returned the next line, not
> the whole file.

Oops.  <> is context sensitive.  The poster did correctly
slurp in all the lines of the file into @eks_file .  Of course,
for very large files this isn't a good idea, but that's another
story.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: Fri, 30 Jul 1999 03:30:23 -0400
From: Joel <dalleyjo@pilot.msu.edu>
Subject: proposed software release
Message-Id: <37A1548F.26AD691@pilot.msu.edu>

Hello all. I am fairly new to Perl, though it has quickly and
convinvingly become me favorite language and
the most useful tool on my Linux system.  I am wrapping up version 1.0
of a program I call "The Goods".
Basically, it authenticates users and fetches lists of files in private
directories ( as long as the web server
can read them ) and presents them for download. The reason I felt
compelled to write this program
instead of using .htaccess was that I don't necessarily want members of
"The Goods" to have user
accounts on my system. Plus, I have ftp turned off.
My question is should I somehow copyright the program? Should I simply
put a disclaimer at the top?
I fully intend to give it away, but I would like to hear advice
concerning the legalities of releasing stuff.

Thanks to all.

- Joel





------------------------------

Date: Fri, 30 Jul 1999 04:46:37 -0400
From: brian@pm.org (brian d foy)
Subject: Re: proposed software release
Message-Id: <brian-ya02408000R3007990446370001@news.panix.com>

In article <37A1548F.26AD691@pilot.msu.edu>, joel@dalleyjo.user.msu.edu posted:

> the most useful tool on my Linux system.  I am wrapping up version 1.0
> of a program I call "The Goods".
> Basically, it authenticates users and fetches lists of files in private
> directories ( as long as the web server
> can read them ) and presents them for download. The reason I felt
> compelled to write this program
> instead of using .htaccess was that I don't necessarily want members of
> "The Goods" to have user
> accounts on my system. Plus, I have ftp turned off.

sounds like a job for mod_perl.

> My question is should I somehow copyright the program? Should I simply
> put a disclaimer at the top?

it's already copyrighted.

> I fully intend to give it away, but I would like to hear advice
> concerning the legalities of releasing stuff.

then talk to a lawyer.  legal advice from a non-lawyer is not legal
advice.

-- 
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: 30 Jul 1999 02:16:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Re: How to read the submit button as a name or value
Message-Id: <slrn7q2k94.fmt.abigail@alexandra.delanet.com>

Vox (v0xman@yahoo.com) wrote on MMCLIX September MCMXCIII in
<URL:news:uXao3.42463$jl.29878042@newscontent-01.sprint.ca>:
** 
** %% To get the users input and configure it I do the code below:
** %%
** %% read(STDIN, $input, $ENV{'CONTENT_LENGTH'})
** 
** >Stop! Do not use such code. Why don't you use CGI.pm?
** 
** 
** What do you mean by 'Do not use such code'.  It works fine for getting the
** input from users and what is CGI.pm?


It works fine, till it breaks at the most inconvenient time - for instance
when giving a demo before a client.

Read up what read() does. 


As for CGI.pm: "man CGI".



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: Fri, 30 Jul 1999 10:35:01 +0200
From: Niek Slatius <nslatius@dds.nl>
Subject: Re: two forms interact with one script?
Message-Id: <37A163B4.AD41C5D1@dds.nl>

The problem is I (still) don't use any type of Unix OS and thus I don't have the
proper perl environment to test things for my self. The only thing I do is start
up NOTEPAD and copy paste the things I need from other scripts that I have
encountered and adjust thing to my specific needs. I haven't encountered any good
PERL documentation/ tutorials on the web so far and my at my local liberary every
PERL book seem to have been stolen :-(. Although I haven't checked out the links
yet that I was sent by this newsgroup automaticly and I will do so right now ;-).

Thanks for your support!

Niek

Jonathan Stowe wrote:

> On Thu, 29 Jul 1999 20:37:50 +0200 Niek Slatius wrote:
> > This is the perl code:
> > ----------------------------------------------------------------------
> > #!/usr/bin/perl
> >
>
> You really should want to use :
>
> #!/usr/bin/perl -w
>
> use strict;
>
> > # insert code for parsing incoming formcode to be handled in perl
> > require "formparse.pl";
> >
>
> use CGI qw(:standard);
>
> > elseif($FORM{'name2'})
>
> that should be elsif
>
> >
> > BTW... what's CGI.pm? Some debugging tool? (I'm a newbie, forgive me)
> >
>
> It is a module that comes standard with all recent Perl distributions.
>
> You can find out more about with:
>
>    man CGI
>
> or
>
>    perldoc CGI
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
> Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>



------------------------------

Date: Fri, 30 Jul 1999 07:54:31 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Using perl to ftp non interactively
Message-Id: <FFoBAv.C9E@csc.liv.ac.uk>

In article <x7d7xdtos5.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> writes:
> 
> do you like reinventing wheels? other than the command line parsing
> stuff, it could done far more simply using Net::FTP. and it would handle
> all of the protocol not just the subset you wrote.

He's doing it again Uri. Several people have already taken him to task
this week but he doesn't seem to have groked the arguments.

What's worse we can't kill file him because he is passing out such duff
info that the gurus around here have to keep correcting him. (not that I
am anywhere close to a guru, before anyone thinks I am getting to big for
my boots)

One consolation is that if he keeps this up at this rate by the middle of
next week he will have a worse name in the Perl community than either Matt
or Serena, if that's possible.

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

In Africa some of the native tribes have a custom of beating the ground
with clubs and uttering spine chilling cries.  Anthropologists call
this a form of primitive self-expression.  In America we call it golf.



------------------------------

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 308
*************************************


home help back first fref pref prev next nref lref last post