[9407] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3002 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 27 11:27:12 1998

Date: Sat, 27 Jun 98 07:03:12 -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           Sat, 27 Jun 1998     Volume: 8 Number: 3002

Today's topics:
        new2perl - stuck at square 1 <bunyip@bit.net.au>
    Re: new2perl - stuck at square 1 (Bob Trieger)
        Newbie: Accessing Oracle tables through Perl <ed@infomatrix.demon.co.uk>
        PERL is spitting out rubbish <ozslot@alphalink.com.au>
    Re: PERL is spitting out rubbish <rra@stanford.edu>
    Re: searching with Perl ? (M.J.T. Guy)
        Was: Re: filenames between UNIX and win95 (Robert Friberg)
    Re: What a Crappy World (Franz Kaufmann)
    Re: What module to download a gif? (Bob Trieger)
        Win95 - How to add on Modules ??? <r.r@worldnet.att.net>
    Re: Win95 - How to add on Modules ??? (Andreas J. Koenig)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 27 Jun 1998 22:10:14 +1000
From: "bunyip" <bunyip@bit.net.au>
Subject: new2perl - stuck at square 1
Message-Id: <6n2mv1$8jm$1@hermes.bit.net.au>

When trying to invoke a PERL script either from a hyperlink or as the ACTION
for a form, I'm simply returned an empty HTML page. This seems to happen
with any script I use so I expect its not related to the scripts themselves
but more likely the environment.

It would seem my ISP (running NT server) has setup the extension .pl to be
associated with something because I don't just get the file bounced back at
me as would happen by default for an unknown file extension.

ISP swears his own scripts work ok on the NT server but wondered whether
anyone could spot my problem from these symptoms?

Thanks




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

Date: Sat, 27 Jun 1998 12:50:19 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: new2perl - stuck at square 1
Message-Id: <6n2pu3$9a1$3@ligarius.ultra.net>

[ posted and mailed ]

"bunyip" <bunyip@bit.net.au> wrote:
-> When trying to invoke a PERL script either from a hyperlink or as the ACTION
-> for a form, I'm simply returned an empty HTML page. This seems to happen
-> with any script I use so I expect its not related to the scripts themselves
-> but more likely the environment.
-> 
-> It would seem my ISP (running NT server) has setup the extension .pl to be
-> associated with something because I don't just get the file bounced back at
-> me as would happen by default for an unknown file extension.
-> 
-> ISP swears his own scripts work ok on the NT server but wondered whether
-> anyone could spot my problem from these symptoms?

Do your scripts work from the command line? If so, this isn't a perl problem 
and you'd have much better luck consulting the documentation or a newsgroup 
devoted to cgi or your webserver.

news:comp.infosystems.www.authoring.cgi
news:comp.infosystems.www.servers.ms-windows
news:microsoft.public.inetserver.iis

HTH

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
  and let the jerk that answers know that his
  toll free number was sent as spam. "


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

Date: Sat, 27 Jun 1998 12:20:27 +0100
From: "Ed Os" <ed@infomatrix.demon.co.uk>
Subject: Newbie: Accessing Oracle tables through Perl
Message-Id: <898946412.1807.0.nnrp-11.d4e43bec@news.demon.co.uk>

This question may have been dealt with before so I apologise for any the
repetition.

I am new to Perl and I need to access an Oracle table and retrieve records
which need to be written to a file in a specific format. Could someone point
me in the right direction please or indicate how this could be achieved.




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

Date: Sat, 27 Jun 1998 19:10:06 +1000
From: David Hamilton <ozslot@alphalink.com.au>
Subject: PERL is spitting out rubbish
Message-Id: <3594B6ED.EA9C2EBF@alphalink.com.au>

I was wondering whether anyone can help me.  When I try tor run a
program from which the following exerpt is taken, PERL claims to be
having troubles such as:

syntax error at s.cgi line 26, near "$a "
syntax error at s.cgi line 32, near "If "
syntax error at s.cgi line 35, near "}"

What syntax is it talking about?  Here is an exerpt (line numbers down
the side). Not all brackets have been closed of in this small portion.

24-                  If ($semail =~ /@/) {
25-                 srand(time ^ $$);
26-                 $a = int(rand(15));
27-                 $b = int(rand(15));
28-                 $c = int(rand(15));
29-                 If ($a==$b) {
30-                 If ($b==$c) {
31-                 $d=int(rand(12));
32-                 If ($d > 1) {
33-                 &TryAgain;
34-                 }
35-                 }
36-                 }

Thanks.



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

Date: 27 Jun 1998 02:27:59 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: PERL is spitting out rubbish
Message-Id: <m3pvfv5h40.fsf@windlord.Stanford.EDU>

David Hamilton <ozslot@alphalink.com.au> writes:

> I was wondering whether anyone can help me.  When I try tor run a
> program from which the following exerpt is taken, PERL claims to be
> having troubles such as:

> syntax error at s.cgi line 26, near "$a "
> syntax error at s.cgi line 32, near "If "
> syntax error at s.cgi line 35, near "}"

> What syntax is it talking about?  Here is an exerpt (line numbers down
> the side). Not all brackets have been closed of in this small portion.

> 24-                  If ($semail =~ /@/) {
> 25-                 srand(time ^ $$);
> 26-                 $a = int(rand(15));

if is all-lowercase and Perl is case sensitive.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 27 Jun 1998 10:50:21 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: searching with Perl ?
Message-Id: <6n2ipd$65e$1@pegasus.csx.cam.ac.uk>

F.Quednau <quednauf@nortel.co.uk> wrote:
>s/1/2/g 
>Replaces 1 with 2. Funny enough, the perlre page doesn't seem to explicitly
>state what g does, but I think I read between the lines that it is the global
>match operator.

perlre.pod doesn't mention /g, but it does explain, right at the beginning,
why it doesn't mention it:

     The matching operations can have various modifiers.  The
     modifiers which relate to the interpretation of the regular
     expression inside are listed below.  For the modifiers that
     alter the behaviour of the operation, see the section on m//
     in the perlop manpage and the section on s// in the perlop
     manpage.

Essentially, if you want to know what s/// does, you have to look it
up in perlop.    Logical enough.


Mike Guy


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

Date: Sat, 27 Jun 1998 11:51:50 GMT
From: robban@insult.com (Robert Friberg)
Subject: Was: Re: filenames between UNIX and win95
Message-Id: <3594d528.12780234@news.appman.com>


Ronald Kimball wrote 1998/06/09:
> Robert Friberg <robban@it-tkonsul.com> wrote:
> > Tony Giordano <giordano@pobox.com> wrote <357C8DF7.DA72BA30@pobox.com>...
> > > This doesn't work
> > > c:\temp\file.txt
> > > because the \t is sent as a tab.
> > > c:    emp\file.txt
> > 
> >    $filename = quotemeta $filename;

> $filename = "c:\temp\file.txt";
> $filename = quotemeta $filename;
> print "$filename\n";
> __END__
> c\:\  emp\
> ile\.txt


> Well, that was helpful.  Might I suggest
> $filename = 'c:/temp/file.txt';

[snip]

   Helpful? What would Ronald know about it? Did he even read
   the original post? May I suggest that he spares those 
   degrading remarks until he knows what he's talking about.
   His attempt to point out someone else as more stupid than
   himself only proves how few candidates there may possibly be.
   
   However, those less experienced, of which there are far more 
   than just a few on c.l.p.m, might get the wrong picture. I'm
   working hard on my bad reputation and wouldn't want anyone to
   think I got it for free! So that's why I'm wasting my time
   flaming this jerk.

   Here is the original post by Tony Giordano:

   > I am writing a script that gets a filename from an HTML form and
   > then copies that file from the client computer (Windows) to the
   > server (Solaris).  By problem is that the backslashes used by
   > Windows sometimes creates special characters.

   [snip] 

   Tony's not really telling us much, let alone showing us any
   code. He seems to have the basic concepts of what's really
   happening mixed up, ("gets a filename.. and then copies that
   file from the client"), yet he obiously manages to get hold of
   the filename including the directory path in his script; he
   must have used a module or decoded the formdata himself. He can't
   be entirely lost.

   Tony's problem is that SOMETIMES the backslashes create special
   characters. He needs to learn when and why.

      $filename = 'c:\temp\file.txt';
      open HND, ">$filename" || die "$!\n"; #Ok
      $foo = "$filename"; #Ok but stupid
      $newfile = "$basedir$filename"; #Ok
      for (@files){
         print "File already exists!\n" if /$filename/;  #Wrong!
      }
      @lines = `cat $filename`; #Ok
 
   My best guess is that he's using $filename in a patternmatch
   or substitution. In that case my suggestion,

      $filename = quotemeta $filename;

   might be what he needs. My intention was to show Tony there is 
   a function called quotemeta that he should know about, as a
   complement to the other helpful pointers he received.
   
   Here's Ronalds demonstration of how my line of code can
   be used:

   > $filename = "c:\temp\file.txt";
   > $filename = quotemeta $filename;
   > print "$filename\n";

   Why on earth does he put crap into $filename in the first
   place? How can he assume Tony is doing the same when the
   data is coming from an html form? Ronalds mistake was taking my
   example line of perl, dropping the assumed context and placing it
   between two of his own lines of perl. The three lines together add
   up to gibberish  AND THEN THE MORON SAYS I'M NOT BEING HELPFUL
   BECAUSE HIS THREE LINES OF CODE MAKE NO SENSE AT ALL!!!!.
   
   Ronalds final remark:
   > Well, that was helpful.  Might I suggest
   > $filename = 'c:/temp/file.txt';

   What is Ronald suggesting Tony do with this line of code? Should
   he first call the user of the client computer and ask for the
   name of the chosen file and then hardcode it into the script?
   Maybe his script should support only one filename? Or he could
   have a different script for each possible filename!! Is that
   what Ronald means?

     
^~v^~v^~v^~v^~v^~v^~v^~v^~v^~v^~v^~v^~v^~v
*
*   Robert Friberg
*   robban@insult.com =~ s/i/it-ko/;
*   C/Perl/Delphi/SQL developer
*


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

Date: Sat, 27 Jun 98 14:45:53 gmt
From: ws97-868@wsrz1.wiso.uni-erlangen.de (Franz Kaufmann)
Subject: Re: What a Crappy World
Message-Id: <6n2pj1$e0$2@rznews.rrze.uni-erlangen.de>

On 24 Jun 1998 20:38:46 GMT, Tom Christiansen says...
>
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, 
>    Scratchie <upsetter@ziplink.net> writes:
>:Sometimes. Or sometimes you insult them for being so incredibly 
ignorant
>:that they didn't immediately know *which* of the 1000 pages of
>:documentation related to their problem, or that they dared try to 
program
>:in perl without knowing exactly how every app in /usr/bin works.
>
>The inability to run a simple search in a textfile or ten is 
>a crippling disability, what which probably disqualifies one
>from programming altogether.
>
>--tom
>-- 
>    X-Windows: It was hard to write; it should be hard to use.
>        --Jamie Zawinski

Hello Mr I-know-everything!

I do this reply although I presume you know already what I want to say,as 
you are gifted with omniscience.You are very fast with judging people to 
be "crippled" and inept as a programmer.Just assume the following:If your 
free documentation is so sufficient,why doesn4t everybody just print it 
out and not bother with all kinds of commercial manuals?If I4m right,you 
are at least co-author for one of the more notorious ones.If people 
didn4t buy this book ,YOU WOULDN4T HAVE EARNED THE MONEY FOR IT.
So "ignorant" users cart their money into your throat.
Secondly,it seems that you have forgotten,what it is like to be 
confronted with a unix-like system.Not everyone has been born early 
enough for unix to be the first contact.
Thirdly,if they would sell nuclear power plants together with manuals,no 
one would say "just read the manual and everything will be O.K".A power 
plant,as is perl,is just too complex.
People learn step by step.WHO ARE YOU TO GOVERN WHAT THEY SHOULD TRY AND 
WHAT NOT?If you are so brilliant,why do you nother answering?Why are ther 
FOUR newsgroups for something so dilligently and comprehensively 
documented as perl?I4m not saying that the distributed documentation is 
bad.
And ,being as impolite as you are yourself at times,don4t give me any rap 
about a wrong tone of voice I have struck in this message.



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

Date: Sat, 27 Jun 1998 12:44:25 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: What module to download a gif?
Message-Id: <6n2pj0$9a1$2@ligarius.ultra.net>

[ posted and mailed ]

phenix@interpath.com (John Moreno) wrote:
-> Bob Trieger <sowmaster@juicepigs.com> wrote:
-> 
-> > root.noharvest.\@not_even\here.com wrote:

-> > -> Probably more than 60% of my programs do NOT use die and yet they work
-> > -> 100% of the time, as intended.  Why should I _always_ use die?
-> > 
-> > Who said you should use die once, let alone always? And nobody's code works
->  as
-> > intended 100% of the time. That statement has invalidated anything else you
-> > could say.
-> 
-> I say, I say, this is being a little too general - I wrote some code
-> where I wanted some shit to happen and by God some shit happened.  Maybe
-> he is writing the same type of programs.  :)
-> 

So, if you are expecting some shit to happen and some shit happens, no matter 
what that shit is, you program has met your expectations? Hmmm, that is some 
deep shit.  :)

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
  and let the jerk that answers know that his
  toll free number was sent as spam. "


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

Date: Sat, 27 Jun 1998 07:50:13 -0400
From: "Rathnakar Yelandur" <r.r@worldnet.att.net>
Subject: Win95 - How to add on Modules ???
Message-Id: <6n2m9n$a48@bgtnsc03.worldnet.att.net>

Hey Guys,
   I have installed PERL 5.x on my Win95 system.
I would like to start adding other modules
e.g. "libnet :  libnet-1.0605.tar.gz"

I was able to download the modules ZIP  file
and extract the files to a localdirectory using
WINZIP.   After that - ???

Hey Perl Guru's -
Need your guidance...
or
Just point me in the right direction...

Thanks in Advance...
Rath




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

Date: 27 Jun 1998 14:39:15 +0200
From: koenig@kulturbox.de (Andreas J. Koenig)
Subject: Re: Win95 - How to add on Modules ???
Message-Id: <sfcyauj3tos.fsf@dubravka.in-berlin.de>

>>>>> On Sat, 27 Jun 1998 07:50:13 -0400,
      "Rathnakar Yelandur" <r.r@worldnet.att.net> said:

rathnakar>    I have installed PERL 5.x on my Win95 system.
rathnakar> I would like to start adding other modules
rathnakar> e.g. "libnet :  libnet-1.0605.tar.gz"

rathnakar> I was able to download the modules ZIP  file
rathnakar> and extract the files to a localdirectory using
rathnakar> WINZIP.   After that - ???

There's a document on CPAN for you: modules/INSTALL.html

-- 
andreas


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

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

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