[12153] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5753 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 22 19:07:19 1999

Date: Sat, 22 May 99 16:00:15 -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, 22 May 1999     Volume: 8 Number: 5753

Today's topics:
    Re: Couldn't find a bundle file in Bundle-libnet-1.00 (Harry Bosma)
    Re: Couldn't find a bundle file in Bundle-libnet-1.00 <ebohlman@netcom.com>
    Re: Extracting form fields (Jen)
        File Upload using CGI.pm news@harvest-lodge.demon.co.uk
    Re: File Upload using CGI.pm (Matthew Bafford)
    Re: Formatting dates (Jen)
        Help With Reading Stuff From a POST function <mgeusenet@usa.net>
    Re: Help With Reading Stuff From a POST function <ebohlman@netcom.com>
        Help with text formatting --- Please! (Larry Buchanan)
    Re: is vnc video card independent ? <mattzag@compuserve.com>
    Re: man pages and FAQs: why posted? lvirden@cas.org
        Perl Tutorials <Gened@ohinter.net>
    Re: Perl Tutorials (Neil Edwards)
    Re: Premature end of Script header and Apache and Inter (Steve Grantz)
    Re: s/// <uri@sysarch.com>
    Re: Search and Fetch Newsgroup (Ran)
        Secure connection <akarpatchev@softhome.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 22 May 1999 21:33:34 GMT
From: hbosma@xs4all.nl (Harry Bosma)
Subject: Re: Couldn't find a bundle file in Bundle-libnet-1.00
Message-Id: <374721ba.41028487@news.xs4all.nl>

On 22 May 1999 14:47:32 -0000, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>Nah, the best way of installing modules for ActiveState is via their
>PPM (Perl Package Manager ) - this is documented in the HTML documents
>that are available throught the shortcut in your Start Menu. 

Thanks, it works great. What a waste of time trying to get CPAN
working, this is much easier.

Harry


Visit Healing Dreams:
http:/www.xs4all.nl/~hbosma/healing_dreams/


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

Date: Sat, 22 May 1999 22:42:50 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Couldn't find a bundle file in Bundle-libnet-1.00
Message-Id: <ebohlmanFC5oFE.91p@netcom.com>

Jonathan Stowe <gellyfish@gellyfish.com> wrote:
: Nah, the best way of installing modules for ActiveState is via their
: PPM (Perl Package Manager ) - this is documented in the HTML documents
: that are available throught the shortcut in your Start Menu.  You can
: do something like:

: C:\>ppm install XML-Parser

Actually, that's the worst possible example to use for a PPM novice.  The 
problem is that PPM itself makes use of XML::Parser, so when it tries to 
update expat.dll it barfs because it's already using expat.dll (the 
problem can be easily solved by *moving* (not just copying) expat.dll to 
the directory you're running PPM from, but that's probably a little too 
scary for someone new to PPM).



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

Date: Sat, 22 May 1999 20:21:11 GMT
From: jenmei@my-dejanews.com (Jen)
Subject: Re: Extracting form fields
Message-Id: <37471399.140224712@client.nw.news.psi.net>

Thanks! I've started reading up on it. It seems like what I need.

Jen

On 21 May 1999 10:38:59 +0100, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>You will want to use the LWP::UserAgent module that is part of the 
>libwww-perl module available from CPAN - it comes with fine documentation
>so I wont bore everyone else here with an example ...



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

Date: Sat, 22 May 1999 19:44:54 GMT
From: news@harvest-lodge.demon.co.uk
Subject: File Upload using CGI.pm
Message-Id: <374708a4.602647751@news.demon.co.uk>

I am trying to write a script which will allow users to upload a file
via the <INPUT type="file"......> html page.

Can anyone let me have an example of both the html and corresponding
perl to modify.

I have CGI.pm installed and available but have so far not managed to
find the file which I think is being uploaded.

Help Please

Steve


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

Date: Sat, 22 May 1999 22:06:58 GMT
From: dragons@dragons.duesouth.net (Matthew Bafford)
Subject: Re: File Upload using CGI.pm
Message-Id: <slrn7ke8kf.18h.dragons@dragons.duesouth.net>

On Sat, 22 May 1999 19:44:54 GMT, news@harvest-lodge.demon.co.uk <news@harvest-lodge.demon.co.uk>
held some poor sysadmin at gun point while typing in the following:
: I am trying to write a script which will allow users to upload a file
: via the <INPUT type="file"......> html page.
: 
: Can anyone let me have an example of both the html and corresponding
: perl to modify.
:
: I have CGI.pm installed and available but have so far not managed to
: find the file which I think is being uploaded.

You seem to have overlooked the part of the CGI.pm manual that explains
exactly how to do this.

Please reread:

perldoc CGI
man CGI

Especially the section:

       CREATING A FILE UPLOAD FIELD
       
: Help Please

HTH,

: Steve

--Matthew


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

Date: Sat, 22 May 1999 20:23:07 GMT
From: jenmei@my-dejanews.com (Jen)
Subject: Re: Formatting dates
Message-Id: <37471414.140347619@client.nw.news.psi.net>

Thanks! I found it. The problem was that I didn't realize it was part
of another file (TimeDate).

Jen

On 21 May 1999 11:12:06 +0100, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>You can use the Date::Format module (it is vailable from CPAN) however
>if all you want you want to do is produce the occasional 'dd/mm/yyyy' type
>date from a time value you could be just as well off making your own.



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

Date: Sat, 22 May 1999 13:15:28 -0700
From: "Matt G. Ellis" <mgeusenet@usa.net>
Subject: Help With Reading Stuff From a POST function
Message-Id: <7i73k8$h7g$1@remarQ.com>

Okay, here is the deal.

I'm TRYING to write a simple little script that will pharse the data that is
sent from a form using the POST method in to little strings, then do a
if/then type thing to go and look at the strings, then add a value to a
number (the totalcost) and then display it.  So it would apper to the user
that they pick out stuff from a few dropdown boxs and then the script tells
them how much this would cost.  Here is what i got so far.

#! /usr/bin/perl

read(STDIN, $buffer, $ENV{'CONTENT_LEGNTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
     {
 ($name, $value) = split(/=/, $pair);
 $value=~ tr/+/ /;
 $value=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
 $form{$name} = $value;
     }

 if ($form{'pages'} = '1to7') {

  $totalcost = 200 ;

 } elsif ($form{'pages'} = '8to14') {

  $totalcost = 400 ;

 } elsif ($form{'pages'} = '15to21') {

  $totalcost = 600 ;

 } elsif ($form{'pages'} = '22to28') {

  $totalcost = 800 ;

 } elsif ($form{'pages'} = '29ormore') {

  $totalcost = 1000 ;

 }


 if ($form{'graphics'} = 'yes') {

  $totalcost = $totalcost + 200 ;

 } elsif ($form{'graphics'} = 'no') {

  $totalcost = $totalcost + 0 ;

 }

So i have a from that has drop down boxes with names like pages and graphics
and values like 1to14 or yes.  The only problem is when i chage the data in
the drop down box (select andother value) the script still reads the top
value.  So even if 8to14 was submited the script thinks 1to14 was.

I have no idea what i am doing wrong.  Can anyone help me?

Matt G. Ellis
mgeusenet@usa.net

Also if you could please also forward the reply to that e-mail address so i
can read it, incase i don't get to check back soon.

THANKS!




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

Date: Sat, 22 May 1999 22:50:48 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Help With Reading Stuff From a POST function
Message-Id: <ebohlmanFC5osp.9J0@netcom.com>

Matt G. Ellis <mgeusenet@usa.net> wrote:
: #! /usr/bin/perl

Missing -w, it would have made perl complain about some of your mistakes 
later on.

<block>
: read(STDIN, $buffer, $ENV{'CONTENT_LEGNTH'});
: @pairs = split(/&/, $buffer);
: foreach $pair (@pairs)
:      {
:  ($name, $value) = split(/=/, $pair);
:  $value=~ tr/+/ /;
:  $value=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
:  $form{$name} = $value;
:      }
</block>

Please don't do this.  Use CGI.pm instead (or CGI::Lite if you're really 
worried about the size of CGI.pm).

:  if ($form{'pages'} = '1to7') {

:   $totalcost = 200 ;

That statement says "set $form{'pages'} to '1to7' and then set $totalcost 
to 200 if '1to7' isn't the empty string.  You need to look at the section 
on comparison operators in perlop.

:  } elsif ($form{'pages'} = '8to14') {

:   $totalcost = 400 ;

:  } elsif ($form{'pages'} = '15to21') {

:   $totalcost = 600 ;

:  } elsif ($form{'pages'} = '22to28') {

:   $totalcost = 800 ;

:  } elsif ($form{'pages'} = '29ormore') {

:   $totalcost = 1000 ;

:  }

Even with the comparisons fixed, endless lists of tests like this are 
clunky and error-prone.  Read perldata to learn how to use hashes.

:  if ($form{'graphics'} = 'yes') {

:   $totalcost = $totalcost + 200 ;

:  } elsif ($form{'graphics'} = 'no') {

:   $totalcost = $totalcost + 0 ;

Huh?

:  }


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

Date: 22 May 1999 22:40:10 GMT
From: Larry@buchanan.com (Larry Buchanan)
Subject: Help with text formatting --- Please!
Message-Id: <3747324a$0$226@nntp1.ba.best.com>

I have a project (handed to me on Friday) that I must have completed by Monday 
as the VC's are coming in to meet with my boss first thing Monday am. I was 
asked to have this perl rutine running and fully tested by Monday am. Here's 
the problem...

I need to ftp to another site, get a file and copy it locally, read the file 
in, parse it and incert the data into the appropriate feilds in an Oracle DB.

I can FTP the file with my current script, no problem. I then need to read the 
file and format the data properly. Here's a sample of the file...

time date stamp <cr>   <--- cr = carridge return <----- I need this stamp
<cr>
<cr>
name1: begining of paragraph message <cr>
continued message <cr>
continued message <cr>
continued message <cr>
continued message <cr>
<cr>
<cr>
name2: begining of paragraph message <cr>
continued message <cr>
continued message <cr>
continued message <cr>
continued message <cr>
<cr>
<cr>
EOF <---- Actually a blank line

There are 12 different paragraphs, the number of lines changes according to how 
much data is sent. What I need to do is strip the <cr>'s out so each paragraph 
becomes a single line, toss out the "name?:" or use it to locate the feild in 
the database where I can put the actual data from the paragraph in a single 
line. I think it would be best to have it formatted as" | paragraph1 all 1 line 
| paragraph 2 all 1 line | "    etc.

I am using SQL to place the data into the database, but am really struggling 
over properly formatting this data. I do appologize for intruding here, but if 
anyone has any help it would be greatly appriciated.

Larry - and yet another Larry.



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

Date: Sat, 22 May 1999 23:29:09 +0100
From: Matt <mattzag@compuserve.com>
To: Bruce Stephens <bruce@cenderis.demon.co.uk>, mattzag@compuserve.com, mattz@kbss.bt.co.uk
Subject: Re: is vnc video card independent ?
Message-Id: <37472FB5.E878083B@compuserve.com>

Bruce,

(If there are any de.comp.unix.linux.newusers
or de.comp.os.unix.linux.misc readers reading this
I am sorry but I speak or write no German but
I hope a fellow SuSE user maybe able to help too
and reply in english sorry).

I think I have hit on a SuSE fault on version 6.1
I also think it is something to do with SOCK_STREAM
var in the vncserver file perhaps its the location
of socket.h in lines 500 -> end of file. and lines
40 -> 50 and 130 -> 140ish (might as well be the
whole of vncserver file.

but as I am not a vnc expert or a perl guru or even
a suse expert as it maybe a know problem.
I will try to mail the suse support/beta teams too.

the file vncserver seems to surgest SunOS and 
socket.ph for some reason. Please see the following
grep..

vncserver:40:$xauthorityFile = "$ENV{HOME}/.Xauthority";
vncserver:131:system("xauth -f $xauthorityFile add $host:$displayNumber
 . $cooki
e");
vncserver:132:system("xauth -f $xauthorityFile add
$host/unix:$displayNumber . $
cookie");
vncserver:139:$cmd .= " -auth $xauthorityFile";
vncserver:498:    foreach $cmd ("uname","xauth","Xvnc","vncpasswd") {

Are you using Redhat or Slackware distr ?

Many thanks

Matt


Bruce Stephens wrote:
> 
> Matt <mattzag@compuserve.com> writes:
> 
> > I tried setting te following on my Linux Box
> >
> > export DISPLAY=:0
> > and
> > export DISPLAY=:0:0
> >
> > As these where the display settings on my NT box
> > (actually display <Ip address>:0:0)
> > Started the vncserver on the linux box
> > and the attempted to start the vncviewer on NT
> > but again I get the 'X' blank display on the NT
> > box.
> 
> This will only work if you're not starting X on your Linux box.  More
> typically, you'll have X running (and that'll provide :0), and
> vncserver will be another X server, :1.
> 
> > Is there something I should set up in the
> >  .vnc/xstartup file like startx ?
> 
> No!  Definitely not.
> 
> > PROMPT:~ # vncserver
> > xauth:  creating new authority file /root/.Xauthority
> > xauth: (argv):1:  bad display name "PROMPT:" in "add" command
> > xauth:  creating new authority file /root/.Xauthority
> > xauth: (argv):1:  bad display name "PROMPT/unix:" in "add" command
> >
> > New 'X' desktop is PROMPT:
> >
> > Starting applications specified in /root/.vnc/xstartup
> > Log file is /root/.vnc/PROMPT:.log
> >
> > Fatal server error:
> > Server is already active for display
> >         If this server is no longer running, remove /tmp/.X-lock
> >         and start again.
> >
> > xrdb: Can't open display 'PROMPT:'
> > xsetroot:  unable to open display 'PROMPT:
> 
> All this suggests that something's wrong.  This "PROMPT:" shouldn't be
> there.  The log I get is:
> 
> bruce% vncserver                                                              ~
> 
> You will require a password to access your desktops.
> 
> Password:
> Verify:
> 
> New 'X' desktop is cenderis.demon.co.uk:1
> 
> Creating default startup script /home/bruce/.vnc/xstartup
> Starting applications specified in /home/bruce/.vnc/xstartup
> Log file is /home/bruce/.vnc/cenderis.demon.co.uk:1.log
> 
> Perhaps it can't determine your hostname, or something?
> 
> Does "uname -n" do the right thing?


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

Date: 22 May 1999 20:04:12 GMT
From: lvirden@cas.org
Subject: Re: man pages and FAQs: why posted?
Message-Id: <7i72js$4ou$1@srv38s4u.cas.org>


According to Dale Henderson  <dhenders@cpsgroup.com>:
:     now if perl had it's own section (say 3p or 3perl).

Would it really make sense for perl, tcl, etc. each to have their own
section?

-- 
<URL: mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
<*> O- <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Sat, 22 May 1999 17:03:21 -0400
From: Gene Dolgin <Gened@ohinter.net>
Subject: Perl Tutorials
Message-Id: <F4F13.2628$_c.2711@jump.innerx.net>

I want to jump into learning perl.  Right now, I have two books, "Perl
in a Nutshell" and "Learning perl"  What would be some other
books/tutorials for me to look at.  I am interested in cgi and database
programming mostly.  Sql database is my DB of choice.

Thanks
Gene



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

Date: Sat, 22 May 1999 21:58:17 GMT
From: neiled@clara.net (Neil Edwards)
Subject: Re: Perl Tutorials
Message-Id: <374727ad.21779512@news.clara.net>

On Sat, 22 May 1999 17:03:21 -0400, Gene Dolgin <Gened@ohinter.net>
wrote:

>I want to jump into learning perl.  Right now, I have two books, "Perl
>in a Nutshell" and "Learning perl"  What would be some other
>books/tutorials for me to look at.  I am interested in cgi and database
>programming mostly.  Sql database is my DB of choice.
>
>Thanks
>Gene


The first online tutorial I ever read was roberts perl tutorial, I
thought it was great and learned a lot from it. The url is:

http://www.netcat.co.uk/rob/perl/win32perltut.html

hope you like it as much as I did.


- - - -
Neil Edwards Krystal Klear Mods
http://www.valveworld.com/krystal/ 
Get Paid to surf the net:
http://www.alladvantage.com/go.asp?refid=BIU877 


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

Date: Sat, 22 May 1999 21:25:20 GMT
From: sgrantz@visi.com (Steve Grantz)
Subject: Re: Premature end of Script header and Apache and Internal Server Error
Message-Id: <4hF13.236$j65.30559@ptah.visi.com>

Meowmee (meowmee@my-dejanews.com) wrote:
: HI!
: 
: I am about to pull my hair out on this one.  I keep getting "Premature
: end of script header" in every of my Perl script/packages I have.  I

Are the scripts outputting an http 'Content-type' header to start with?

-Steve


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

Date: 22 May 1999 15:17:34 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: s///
Message-Id: <x7so8o7w35.fsf@home.sysarch.com>

>>>>> "JF" == Jody Fedor <JFedor@datacom-css.com> writes:

  JF> Is there better information on s/// than perldoc or "Pearl
  JF> Programming"?  Is there a place that has lots of examples and then
  JF> explains what each one is and how it works?


"Pearl Programming" is not a good book. in fact it doesn't even
exist. you might be refering to programming perl or more affectionately,
the camel (also camel 2 or blue or teal camel).

please spell the language name correctly. if you can't remember how, it is
in the name of this newsgroup.

have you looked at perlre? and perlop? try reading the perl cookbook or
mastering regular expressions.

and these are silly questions deserving of jeremy's penitence. 

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 22 May 1999 21:03:37 GMT
From: ran@netgate.net    (Ran)
Subject: Re: Search and Fetch Newsgroup
Message-Id: <7i7639$12u$1@remarQ.com>

In <37433CF4.BEC7875E@mail.nih.gov>, Ying Hu <yhu@mail.nih.gov> writes:
>Hi:
>Which win32 module is with the function that can search newsgroups
>and/or download some pieces of news from newsgroups by the subject?
>For example, the perl script can search the Subject of comp.soft-sys.sas
>with ANOVA key word and download the news (with ANOVA)
>from the newsgroup.

It's not a win32 module,  but there's a collection of scripts called 
"NNTP grep and fetch it" around somewhere.  A web search for "nntpgrafi"
should turn it up.  It may be tucked away in one of the obscure corners 
of CPAN. 

Ran




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

Date: Sat, 22 May 1999 22:35:24 +0200
From: "Andrei Karpatchev" <akarpatchev@softhome.net>
Subject: Secure connection
Message-Id: <374714aa.0@pfaff.ethz.ch>

I'm new in your society...
With a Perl-script I can generate an "on-fly" document. But is it possible
to transmit it to the users' browser in the secure mode. I mean, like
https:\\... (that a lock symbol on the browser is locked), that some
confidential information could be transfered. Where I can read about such
stuff?
Thanks in advance.



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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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