[13888] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1298 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 8 14:38:05 1999

Date: Mon, 8 Nov 1999 11:37:52 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942089871-v9-i1298@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 8 Nov 1999     Volume: 9 Number: 1298

Today's topics:
        Help for CGI <goya@saglac.qc.ca>
    Re: Help for CGI (Michael Budash)
    Re: Help for CGI (Michael Budash)
    Re: Help for CGI <goya@saglac.qc.ca>
    Re: Help for CGI <goya@saglac.qc.ca>
    Re: Help for CGI <goya@saglac.qc.ca>
    Re: Help for CGI <rootbeer@redcat.com>
    Re: Help for CGI (Michael Budash)
        Help with HTML forms and MYSQL insert (Shawn Smith)
    Re: Help with HTML forms and MYSQL insert (Abigail)
    Re: Help with perl!!! <gellyfish@gellyfish.com>
    Re: Help! Simple Perl problem - newbie!! <gellyfish@gellyfish.com>
    Re: HELP!! Redirecting STDIN and STDOUT to UDP socket (Kragen Sitaker)
    Re: HELP: A slight update... (Simon Cozens)
        Help: Form returns &#8220; instead of " a left double q <nospam@aol.com>
    Re: Help: Form returns &#8220; instead of " a left doub (Abigail)
    Re: Help: Form returns &#8220; instead of " a left doub <flavell@mail.cern.ch>
    Re: Help: Form returns &#8220; instead of " a left doub <gellyfish@gellyfish.com>
        HELP: Insecure dependancy with mkdir () <jfeeney.nospam@nua.ie>
    Re: HELP: Insecure dependancy with mkdir () <gellyfish@gellyfish.com>
    Re: Help? What are Black Squares? <dave@dave.org.uk>
    Re: Help? What are Black Squares? <msm@manley.org>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 6 Nov 1999 19:23:33 -0500
From: "Laval Desbiens" <goya@saglac.qc.ca>
Subject: Help for CGI
Message-Id: <HC3V3.935$Bt3.57271@wagner.videotron.net>

I want to display some URL or htm page using an IF command.  How can I do
it...

Ex :
 if ($choice =1)
    { # the URL1} # Witch command to put there.
else
    {# the URL2}

Thanks




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

Date: Sat, 06 Nov 1999 16:45:58 -0800
From: mbudash@wcws.com (Michael Budash)
Subject: Re: Help for CGI
Message-Id: <mbudash-0611991645580001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <HC3V3.935$Bt3.57271@wagner.videotron.net>, "Laval Desbiens"
<goya@saglac.qc.ca> wrote:

> I want to display some URL or htm page using an IF command.  How can I do
> it...
> 
> Ex :
>  if ($choice =1)
>     { # the URL1} # Witch command to put there.
> else
>     {# the URL2}
> 
> Thanks

that's not really very much to go on, but, if i understand your question:

if ($choice =1)
     { print "Location: http://www.domain.com/page1.html\n\n"; }
else
     { print "Location: http://www.domain.com/page2.html\n\n"; }

hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@wcws.com


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

Date: Sat, 06 Nov 1999 16:48:29 -0800
From: mbudash@wcws.com (Michael Budash)
Subject: Re: Help for CGI
Message-Id: <mbudash-0611991648290001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article
<mbudash-0611991645580001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
mbudash@wcws.com (Michael Budash) wrote:

> In article <HC3V3.935$Bt3.57271@wagner.videotron.net>, "Laval Desbiens"
> <goya@saglac.qc.ca> wrote:
> 
> > I want to display some URL or htm page using an IF command.  How can I do
> > it...
> > 
> > Ex :
> >  if ($choice =1)
> >     { # the URL1} # Witch command to put there.
> > else
> >     {# the URL2}
> > 
> > Thanks
> 
> that's not really very much to go on, but, if i understand your question:
> 
> if ($choice =1)
>      { print "Location: http://www.domain.com/page1.html\n\n"; }
> else
>      { print "Location: http://www.domain.com/page2.html\n\n"; }
> 
> hth-

oops... since you're in a perl ng, this:

  if ($choice =1)

should be:

  if ($choice == 1)

or

  if ($choice eq '1')

depending on the type of scalar $choice is...
-- 
Michael Budash ~~~~~~~~~~ mbudash@wcws.com


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

Date: Sat, 6 Nov 1999 21:03:29 -0500
From: "Laval Desbiens" <goya@saglac.qc.ca>
Subject: Re: Help for CGI
Message-Id: <o45V3.985$Bt3.58621@wagner.videotron.net>

Thanks, I'm anxiuous to try it....

Michael Budash <mbudash@wcws.com> a écrit dans le message :
mbudash-0611991648290001@adsl-216-103-91-123.dsl.snfc21.pacbell.net...
> In article
> <mbudash-0611991645580001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
> mbudash@wcws.com (Michael Budash) wrote:
>
> > In article <HC3V3.935$Bt3.57271@wagner.videotron.net>, "Laval Desbiens"
> > <goya@saglac.qc.ca> wrote:
> >
> > > I want to display some URL or htm page using an IF command.  How can I
do
> > > it...
> > >
> > > Ex :
> > >  if ($choice =1)
> > >     { # the URL1} # Witch command to put there.
> > > else
> > >     {# the URL2}
> > >
> > > Thanks
> >
> > that's not really very much to go on, but, if i understand your
question:
> >
> > if ($choice =1)
> >      { print "Location: http://www.domain.com/page1.html\n\n"; }
> > else
> >      { print "Location: http://www.domain.com/page2.html\n\n"; }
> >
> > hth-
>
> oops... since you're in a perl ng, this:
>
>   if ($choice =1)
>
> should be:
>
>   if ($choice == 1)
>
> or
>
>   if ($choice eq '1')
>
> depending on the type of scalar $choice is...
> --
> Michael Budash ~~~~~~~~~~ mbudash@wcws.com




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

Date: Sat, 6 Nov 1999 23:16:11 -0500
From: "Laval Desbiens" <goya@saglac.qc.ca>
Subject: Re: Help for CGI
Message-Id: <O07V3.1085$Bt3.61790@wagner.videotron.net>

I tryed it without success...

I wanted that following the choice, to go directly to the URL without click
on it...  Look my code...

 if (($Automate eq "Plc5") && ($Theme eq "IN"))
  {print "CPA-PLC501.htm";}
 else
  {print "CPA-SLC501.htm";}

Only the text CPA-PLC501 appear if I select the first one...

Michael Budash <mbudash@wcws.com> a écrit dans le message :
mbudash-0611991648290001@adsl-216-103-91-123.dsl.snfc21.pacbell.net...
> In article
> <mbudash-0611991645580001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
> mbudash@wcws.com (Michael Budash) wrote:
>
> > In article <HC3V3.935$Bt3.57271@wagner.videotron.net>, "Laval Desbiens"
> > <goya@saglac.qc.ca> wrote:
> >
> > > I want to display some URL or htm page using an IF command.  How can I
do
> > > it...
> > >
> > > Ex :
> > >  if ($choice =1)
> > >     { # the URL1} # Witch command to put there.
> > > else
> > >     {# the URL2}
> > >
> > > Thanks
> >
> > that's not really very much to go on, but, if i understand your
question:
> >
> > if ($choice =1)
> >      { print "Location: http://www.domain.com/page1.html\n\n"; }
> > else
> >      { print "Location: http://www.domain.com/page2.html\n\n"; }
> >
> > hth-
>
> oops... since you're in a perl ng, this:
>
>   if ($choice =1)
>
> should be:
>
>   if ($choice == 1)
>
> or
>
>   if ($choice eq '1')
>
> depending on the type of scalar $choice is...
> --
> Michael Budash ~~~~~~~~~~ mbudash@wcws.com




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

Date: Sat, 6 Nov 1999 23:49:16 -0500
From: "Laval Desbiens" <goya@saglac.qc.ca>
Subject: Re: Help for CGI
Message-Id: <Sv7V3.1093$Bt3.62672@wagner.videotron.net>

I found the solution, let's see my code :

 if (($Automate eq "Plc5") && ($Theme eq "IN"))
 {
  open(FILE,"CPA-PLC501.htm");
  @page = <FILE>;
  close(FILE);
  print "@page";
 }
 ... etc...

Thanks again....
Laval Desbiens <goya@saglac.qc.ca> a écrit dans le message :
O07V3.1085$Bt3.61790@wagner.videotron.net...
> I tryed it without success...
>
> I wanted that following the choice, to go directly to the URL without
click
> on it...  Look my code...
>
>  if (($Automate eq "Plc5") && ($Theme eq "IN"))
>   {print "CPA-PLC501.htm";}
>  else
>   {print "CPA-SLC501.htm";}
>
> Only the text CPA-PLC501 appear if I select the first one...
>
> Michael Budash <mbudash@wcws.com> a écrit dans le message :
> mbudash-0611991648290001@adsl-216-103-91-123.dsl.snfc21.pacbell.net...
> > In article
> > <mbudash-0611991645580001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
> > mbudash@wcws.com (Michael Budash) wrote:
> >
> > > In article <HC3V3.935$Bt3.57271@wagner.videotron.net>, "Laval
Desbiens"
> > > <goya@saglac.qc.ca> wrote:
> > >
> > > > I want to display some URL or htm page using an IF command.  How can
I
> do
> > > > it...
> > > >
> > > > Ex :
> > > >  if ($choice =1)
> > > >     { # the URL1} # Witch command to put there.
> > > > else
> > > >     {# the URL2}
> > > >
> > > > Thanks
> > >
> > > that's not really very much to go on, but, if i understand your
> question:
> > >
> > > if ($choice =1)
> > >      { print "Location: http://www.domain.com/page1.html\n\n"; }
> > > else
> > >      { print "Location: http://www.domain.com/page2.html\n\n"; }
> > >
> > > hth-
> >
> > oops... since you're in a perl ng, this:
> >
> >   if ($choice =1)
> >
> > should be:
> >
> >   if ($choice == 1)
> >
> > or
> >
> >   if ($choice eq '1')
> >
> > depending on the type of scalar $choice is...
> > --
> > Michael Budash ~~~~~~~~~~ mbudash@wcws.com
>
>




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

Date: Sat, 6 Nov 1999 22:10:32 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help for CGI
Message-Id: <Pine.GSO.4.10.9911062205500.15797-100000@user2.teleport.com>

On Sat, 6 Nov 1999, Laval Desbiens wrote:

>   open(FILE,"CPA-PLC501.htm");

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

>   @page = <FILE>;
>   close(FILE);
>   print "@page";

You're not likely to want to put double-quote marks around an array whose
elements include newline characters, even though it may not make a
noticeable difference in some cases. 

I'd also like to suggest that you place your replies after the text you're
replying to, and cut that text down to the minimum needed to show what's
going on. See news.announce.newusers for more information. 

Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 06 Nov 1999 23:33:24 -0800
From: mbudash@wcws.com (Michael Budash)
Subject: Re: Help for CGI
Message-Id: <mbudash-0611992333240001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <O07V3.1085$Bt3.61790@wagner.videotron.net>, "Laval Desbiens"
<goya@saglac.qc.ca> wrote:

> Michael Budash <mbudash@wcws.com> a écrit dans le message :
> mbudash-0611991648290001@adsl-216-103-91-123.dsl.snfc21.pacbell.net...
> > In article
> > <mbudash-0611991645580001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
> > mbudash@wcws.com (Michael Budash) wrote:
> >
> > > In article <HC3V3.935$Bt3.57271@wagner.videotron.net>, "Laval Desbiens"
> > > <goya@saglac.qc.ca> wrote:
> > >
> > > > I want to display some URL or htm page using an IF command.  How can I
> do
> > > > it...
> > > >
> > > > Ex :
> > > >  if ($choice =1)
> > > >     { # the URL1} # Witch command to put there.
> > > > else
> > > >     {# the URL2}
> > > >
> > > > Thanks
> > >
> > > that's not really very much to go on, but, if i understand your
> question:
> > >
> > > if ($choice == 1) # note: my 2 posts combined here - mab
> > >      { print "Location: http://www.domain.com/page1.html\n\n"; }
> > > else
> > >      { print "Location: http://www.domain.com/page2.html\n\n"; }
> > >
> > > hth-
> >
>
> I tryed it without success...
> 
> I wanted that following the choice, to go directly to the URL without click
> on it...  Look my code...
> 
>  if (($Automate eq "Plc5") && ($Theme eq "IN"))
>   {print "CPA-PLC501.htm";}
>  else
>   {print "CPA-SLC501.htm";}
> 
> Only the text CPA-PLC501 appear if I select the first one...
> 

well, of course! it simply did what you told it to do: 'printed'
something. my example was for urls, not files...
-- 
Michael Budash ~~~~~~~~~~ mbudash@wcws.com


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

Date: Mon, 08 Nov 1999 06:27:15 GMT
From: SPAMshawns@unt.edu (Shawn Smith)
Subject: Help with HTML forms and MYSQL insert
Message-Id: <38276c36.39566868@news.unt.edu>

Hello all,

I want to call a perl script from a web page.  I want the script to
use the data from a few text boxes on the web page form and then
insert that data into a MYSQL database. 

I got it where I can do selects but I can't seem to get the insert to
work.  I dont' need help with the HTML forms; I need  help with the
Perl MYSQL insert script.

Can someone give me an example of how to do this?

My test db has a table called cars(make, model, year)

All the best,
Shawn Smith !UNT Proud!
My freeware: http://people.unt.edu/~shawns 
ICQ: 475-8706 AOL/Netscape IM: "mrgitdown"
"Whatever you do will be insignificant, but 
it is very important that you do it."
--Mahatma Gandhi 




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

Date: 8 Nov 1999 01:03:18 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Help with HTML forms and MYSQL insert
Message-Id: <slrn82ctkj.lh6.abigail@alexandra.delanet.com>

Shawn Smith (SPAMshawns@unt.edu) wrote on MMCCLX September MCMXCIII in
<URL:news:38276c36.39566868@news.unt.edu>:
%% 
%% I got it where I can do selects but I can't seem to get the insert to
%% work.  I dont' need help with the HTML forms; I need  help with the
%% Perl MYSQL insert script.


This is comp.lang.perl.misc, not comp.lang.sql.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== 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: 7 Nov 1999 14:01:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help with perl!!!
Message-Id: <8040ne$dfm$1@gellyfish.btinternet.com>

On Sun, 7 Nov 1999 11:48:15 -0000 Chris wrote:
> I heve two scripts attached if anyone would mind looking at them and helping
> me with them I would be gratefull also could it be anything to do with the
> security settings of the file it's printing to and from on the web.
> 

Firstly if you had read anything about Usenet etiquette you would have known
that its considered in extremely poor taste to post bastarding great
uuencoded files to a non-binary group - I guarantee that you have
automatically limited your audience by doing this.

I am not sure what you think is wrong with your program - of course there
are a lot of things wrong with it - but what do you think is wrong with it ?

Lets see :


#!/usr/local/bin/perl

*                    ^ no -w here wont catch typos

* You should have used strict here

&readparse;

* You should use some well maintained and documented
* reusable module to get the parameters

###############################################

$url=$value[0];
$forward=$value[1];
$email=$value[2];

open(UINFO,"<fils/$url.fil");{

*  You have failed to test whether the open was successful or not
*  you should flock in shared mode if someone else might be writing it

@test=UINFO;
close(UINFO);}

if (@test eq ":-:\n$forward") {

* Er.  This is comparing the number of items in the array
* to a string - it will always be false

print '

* You probably want to use a here document to do this.

* <snip html>

';
 }
 
 if (@test eq "") {

* again you are testing the number of elements in @test against
* a string - it will always be false

open(URLS,">fils/$url.fil");

* again you fail to test whether this is successful
* you should also be flocking this against simultaneous access

print URLS ":-:\n$forward";
close(URLS);

* <snip>

&email($to,$from,$sub,$message);

print '

* again you should have used a here document

';
 }

###############################################
sub readparse {

* <snip home grown parseing>
* You should have used a module

};

sub email {
local($to,$from,$sub,$letter) = @_;

* this should 'my' rather 'local'

$to=~s/@/\@/;
$from=~s/@/\@/;

* I'm not quite sure what you are trying to do here

open(MAIL, "|/var/qmail/bin/qmail-inject -t") || die
"Content-type: text/text\n\nCan't open /usr/lib/sendmail!";

* er you're not using /usr/lib/sendmail

}

I dont think I am even going to bother to look at the other one.

Let me get this straight - you have some form in which a user can enter
a URL, a domain to which they want it forwarded and their e-mail
address - there are files for each URL and these appear to contain simply:

:-:
www.somedomain.com

where the domain is the forwarding part.  If a file for that URL exists
and *if* it contains that same forwarding domain you want to blow them
out and if not you want to create the file with the forwarding info
right ?  You dont appear to want to check in all of the files if that
forwarding address has already been taken and you dont appear to care
if an existing file gets overwritten right ?

I didnt look in the other file to seek clarification.

Maybe you ought to tell us exactly what you think it should do and why
exactly it isnt working - in the meantime here is how you would have
written what you have there is you were paying attention :


#!/usr/bin/perl -wT

use strict;
use CGI qw(:standard);
use Fcntl qw(:flock);

$ENV{qw(PATH IFS)} = '' x 2;

my $url     = param('url');      # These presuppose that your form fields
my $forward = param('forward');  # are called url, forward, email
my $email   = param('email');


if ( open(UINFO,"fils/$url.fil") )
  {
    flock(UINFO,LOCK_SH) || die "Can't lock 'fils/$url.fil - $!\n";
    my $test= do { local $/; <UINFO> };
    close(UINFO);

    if ($test eq ":-:\n$forward") 
      {
        print <<EOFOO;
#
# removed the HTML
#
EOFOO
      }
  }
else
  { 
    open(URLS,">fils/$url.fil") || die "Can't open 'fils/$url.fil - $!\n";
    flock(URLS,LOCK_EX) || die "Can't flock 'fils/$url.fil - $!\n";
    print URLS ":-:\n$forward";
    close(URLS);

    my $from = 'kieran@bl-soft.com';
    my $sub  = 'Your Exclamation website is up and running';
    my $message =<<EOMSG;
#
# Removed message
#
EOMSG

   email($email,$from,$sub,$message);

   print <<EOBLAH;

#
# removed HTML
#

EOBLAH
 }

sub email 
 {
   my ($to,$from,$sub,$letter) = @_;

   open(MAIL, "|/var/qmail/bin/qmail-inject -t") || die
                   "Content-type: text/plain\n\nCan't open qmail-inject -$!\n";
   print MAIL <<EOMAIL;
To: $to
From: $from
Subject: $sub

$letter
EOMAIL

   return close(MAIL);
  }


HTH

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 4 Nov 1999 20:24:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help! Simple Perl problem - newbie!!
Message-Id: <7vsq15$7gn$1@gellyfish.btinternet.com>

On Thu, 4 Nov 1999 19:37:52 -0000 Daza wrote:
> Oh dear, I've lost the plot!
> 
> I'm learning Perl from a book and using a 'simple' example with forms. I'm
> on NT4 workstation with IE4. The HTML file looks like this:
> 
> <html>
> <body>
> <form action="H:\html.cgi" method="POST">
> Name: <input type="text" name="Name" size=15>
> <center>
> <input type="submit" name="OK">
> <input type="reset" name="Clear">
> </form>
> </body>
> </html>
> 
> The H:\html.cgi file looks like this:
> 
> print "Content-type: text/html\n\n";
> print "<HTML><BODY>HI</body></html>";
> 
> When I call up the form it looks fine. When I click the OK button I don't
> see the ?Name=xxxx at the end of the URL, and a new HTML page appears with
> the actual text (verbatim) from the cgi file. I expected to see  just "HI"
> 

I would suggest that you read the CGI FAQ at:

   <http://www.webthing.com/tutorials/cgifaq.html>

and possibly also the CGI specification at:

   <http://hoohoo.ncsa.uiuc.edu/cgi/>

Your problem has nothing to do with Perl whatsoever - you would see the
same results whatever language the program was written.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 07 Nov 1999 02:31:16 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: HELP!! Redirecting STDIN and STDOUT to UDP socket
Message-Id: <Uv5V3.49985$23.1898067@typ11.nn.bcandid.com>

In article <7vslov$73a$1@nnrp1.deja.com>,  <aikea@my-deja.com> wrote:
>I have scoured the newsgroups with no luck on this topic.
>
>Here is my scenario.   I have a UNIX shell script that currently re-
>directs STDOUT to a serial tty device (i.e. /dev/ttyS01) and STDIN to
>my program.

Via a pipe, I assume.

>The device that I am talking to also has the ability to
>talk UDP sockets.  So in short,  I would like to create a device that
>is really a perl program (I.E. /dev/perl_program) that will redirect my
>STDIN and STDOUT serial data to and from my program.

You might have more luck creating a Perl program you talk to through a
pipe.  If it can be a named pipe (man mkfifo) you can still do the
/dev/perl_program thing.  Otherwise you'll have to use nonportable
hacks like PerlFS, which lets you write a filesystem for Linux in Perl
-- see http://www.assurdo.com/PerlFS/ for more.

There's a bit of an impedance mismatch between UDP and pipes, though.
UDP is unreliable (permitting data loss, duplication, and out-of-order
delivery) and record-oriented.  This may not be an issue in your
environment; you're not too likely to suffer data loss, duplication, or
out-of-order delivery if you're connected to your device via a SLIP or
Ethernet link, and you can just package things up into
arbitrarily-sized packets.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 7 Nov 1999 07:31:08 GMT
From: simon@othersideofthe.earth.li (Simon Cozens)
Subject: Re: HELP: A slight update...
Message-Id: <slrn82aals.o1i.simon@othersideofthe.earth.li>

Jon Frisby (comp.lang.perl.misc):
>> regcomp.c:2688: macro `va_start' used with too many (2) args
>I'm still getting this problem, although Someone From Above smacked me with
>a clue stick and pointed me at gcc2 and ld2 which are now in my path, and
>the cygwin32 stuff is where it's supposed to be apparently...
>So in the above, s/gcc/gcc2/ for the output... :)

Yes, I was here not the other day. It looks like there's something
screwy going on with the way that Configure looks at the include files
under Cygwin and ends up getting the wrong definition. I ended up
editing the config file. It then build, but dynamic loading fell over in
strange ways that I've now forgotten. If you're willing to live on the
edge, which you don't want to do for production, development versions of
perl have a major update to the Cygwin build sequence, and it all builds
nicely now. I compiled up _62 without too much trouble.

Otherwise, you could either manfully hack at it, or get the binary
Cygwin port from the usual place. (However, I think that doesn't support
dynamic loading.)

Simon

-- 
"By golly, I'm beginning to think Linux really *is* the best thing since
sliced bread."
(By Vance Petree, Virginia Power)


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

Date: Sun, 7 Nov 1999 08:58:00 -0500
From: "Arthur Gibbs" <nospam@aol.com>
Subject: Help: Form returns &#8220; instead of " a left double quotation mark, is this unicode issue? MIME issue?
Message-Id: <8040i7$k79$1@birch.prod.itd.earthlink.net>

When my perl cgi scripts receives a form submission it posts the infomation
to a HTML file and then sends the results via E-mail.  The HTML looks great.
However the text e-mail includes unicode characters that my e-mail program
(outlook express) and others show as symbols.  So instead of "hi", I see
&#8220;Hi&#8221;

How can I convert those codes into something meaningful in e-mail?  Do I
need to convert them to ASCII or another charaset?  I don't want an e-mail
full of &#8220; codes that can't be decoded by text e-mail readers?

I looked at CPAN and couldn't find these longer 8220 type codes in any of
the unicode or parser modules?

Any body else dealing with this issue?  I have a table below that I guess is
what I'm talking about and these characters that need to be converted to
work in e-mail?

ALT-0130   &#8218;   ,    Single Low-9 Quotation Mark
ALT-0131   &#402;    f    Latin Small Letter F With Hook
ALT-0132   &#8222;   "    Double Low-9 Quotation Mark
ALT-0133   &#8230;   .    Horizontal Ellipsis
ALT-0134   &#8224;   ?    Dagger
ALT-0135   &#8225;   ?    Double Dagger
ALT-0136   &#710;    ^    Modifier Letter Circumflex Accent
ALT-0137   &#8240;   ?    Per Mille Sign
ALT-0138   &#352;    S    Latin Capital Letter S With Caron
ALT-0139   &#8249;   <    Single Left-Pointing Angle Quotation Mark
ALT-0140   &#338;    O    Latin Capital Ligature OE
ALT-0145   &#8216;   '    Left Single Quotation Mark
ALT-0146   &#8217;   '    Right Single Quotation Mark
ALT-0147   &#8220;   "    Left Double Quotation Mark
ALT-0148   &#8221;   "    Right Double Quotation Mark
ALT-0149   &#8226;   .    Bullet
ALT-0150   &#8211;   -    En Dash
ALT-0151   &#8212;   -    Em Dash

Please help via the newsgroup, so all can learn with me.  Thanks in advance
to the perl gurus of the world!!!

Arthur :)






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

Date: 7 Nov 1999 09:01:17 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Help: Form returns &#8220; instead of " a left double quotation mark, is this unicode issue? MIME issue?
Message-Id: <slrn82b58p.2i1.abigail@alexandra.delanet.com>

Arthur Gibbs (nospam@aol.com) wrote on MMCCLIX September MCMXCIII in
<URL:news:8040i7$k79$1@birch.prod.itd.earthlink.net>:
{} When my perl cgi scripts receives a form submission it posts the infomation
{} to a HTML file and then sends the results via E-mail.  The HTML looks great.
{} However the text e-mail includes unicode characters that my e-mail program
{} (outlook express) and others show as symbols.  So instead of "hi", I see
{} &#8220;Hi&#8221;


Well, then don't put them in there. *shrug* If you have a program
that outputs something (in this case email), and you don't like what
it outputs, then don't output it.

What is your Perl question? Or rather, do you have any question at all?



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: Sun, 7 Nov 1999 19:03:26 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Help: Form returns &#8220; instead of " a left double quotation mark, is this unicode issue? MIME issue?
Message-Id: <Pine.HPP.3.95a.991107184723.28368B-100000@hpplus01.cern.ch>

On Sun, 7 Nov 1999, Arthur Gibbs wrote:

>  Form returns &#8220; instead of " a left double quotation
>         mark

That's excellent news.  I thought it was going to take the Big Two quite
some time to get up to speed on this: we've only had the specification
out for several years already.  Whddyer mean, "instead of"? In HTML that
_is_ a "left double quotation mark". 

> However the text e-mail includes unicode characters that my e-mail program
> (outlook express) and others show as symbols. 

Symbols?

> So instead of "hi", I see &#8220;Hi&#8221;

I thought you were talking about HTML.

> How can I convert those codes into something meaningful in e-mail? 

What do you understand by "meaningful"? 

> Do I need to convert them to ASCII

ASCII is a 7-bit character code.  It doesn't contain any "clever"
quotes.  You're entirely free to use non-clever quotes.

> or another charaset?  I don't want an e-mail
> full of &#8220; codes that can't be decoded by text e-mail readers?

Then don't put them in.
 
> Any body else dealing with this issue?  I have a table below that I guess is
> what I'm talking about and these characters that need to be converted to
> work in e-mail?
> 
> ALT-0130   &#8218;   ,    Single Low-9 Quotation Mark
[etc.]

Your first column describes a proprietary coding, as propagated by a
company that has been ruled to have a monopoly.  You might consider
using an international standard instead.

> Thanks in advance to the perl gurus of the world!!!

This has nothing whatever to do with the Perl programming language.
I'd have exactly the same problem if I was writing in FORTRAN.

The question is, what are you trying to achieve?  If you want to put
into your email, characters that are not in the internationally-agreed
character set (say, iso-8859-1) then you have a problem, and what you
are exhibiting here is one way that one might attempt to solve it,
although email that is marked up in HTML is not well received by many
recipients. 

But you might be better advised to take up the bigger issue on a group
that deals with email (comp.mail.misc comes to mind, or maybe
comp.mail.mime).  Once you're clear on what you want to achieve, then
the Perl groups may be able to help you with actually programming it.

[f'ups narrowed]



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

Date: 7 Nov 1999 19:32:37 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help: Form returns &#8220; instead of " a left double quotation mark, is this unicode issue? MIME issue?
Message-Id: <804k4l$e03$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Arthur Gibbs <nospam@aol.com> wrote:
> When my perl cgi scripts receives a form submission it posts the infomation
> to a HTML file and then sends the results via E-mail.  The HTML looks great.
> However the text e-mail includes unicode characters that my e-mail program
> (outlook express) and others show as symbols.  So instead of "hi", I see
> &#8220;Hi&#8221;

Sure - I know nothing of unicode - but maybe you want to look at the way
that the module HTML::Entities does this - a simple translation table
will do the trick :



%translator = ( 8218   =>   ',',  #    Single Low-9 Quotation Mark
                402    =>    'f',  #    Latin Small Letter F With Hook
                8222   =>   '"',  #    Double Low-9 Quotation Mark
                8230   =>   '.',  #    Horizontal Ellipsis
                8224   =>   '?',  #    Dagger
                8225   =>   '?',  #    Double Dagger
                710    =>    '^', #    Modifier Letter Circumflex Accent
                8240   =>   '?',  #    Per Mille Sign
                352    =>    'S', #    Latin Capital Letter S With Caron
                8249   =>   '<',  #    Single Left-Pointing Angle Quotation Mark
                338    =>    'O', #    Latin Capital Ligature OE
                8216   =>   '\'', #    Left Single Quotation Mark
                8217   =>   '\'', #    Right Single Quotation Mark
                8220   =>   '"',  #    Left Double Quotation Mark
                8221   =>   '"',  #    Right Double Quotation Mark
                8226   =>   '.',  #    Bullet
                8211   =>   '-',  #    En Dash
                8212   =>   '-' );#   Em Dash

s/&#(\d+?);/$translator{$1}/g;

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 8 Nov 1999 13:27:50 -0000
From: "John Feeney" <jfeeney.nospam@nua.ie>
Subject: HELP: Insecure dependancy with mkdir ()
Message-Id: <806j3r$ovr$1@scotty.tinet.ie>

Hi all.

I decided to turn on tainting in a script (-T) and I'm getting an error
message about an insecure dependancy with mkdir. The piece of code in
question is as follows:

unless (-d $outdir) {
 mkdir ($outdir, 0755) || croak "cannot mkdir($outdir) : $!";
    }

However, when I log in as root and run the script, there's no problem. I've
read the perlsec page countless times but there's no reference to mkdir.
Does anybody know what's going on here? Any help in solving this problem or
advice on what to read up on will be greatly appreciated.

Thanks in advance,

John.






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

Date: 8 Nov 1999 14:00:20 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HELP: Insecure dependancy with mkdir ()
Message-Id: <3826d774_1@newsread3.dircon.co.uk>

John Feeney <jfeeney.nospam@nua.ie> wrote:
> Hi all.
> 
> I decided to turn on tainting in a script (-T) and I'm getting an error
> message about an insecure dependancy with mkdir. The piece of code in
> question is as follows:
> 
> unless (-d $outdir) {
>  mkdir ($outdir, 0755) || croak "cannot mkdir($outdir) : $!";
>     }
> 
> However, when I log in as root and run the script, there's no problem. I've
> read the perlsec page countless times but there's no reference to mkdir.
> Does anybody know what's going on here? Any help in solving this problem or
> advice on what to read up on will be greatly appreciated.
> 

if you've read perlsec you will know about 'untainting' data - you will need
to do that to $outdir ...

/J\
-- 
"We've even been asked to review a luxury hotel. I can't think why" -
Neil Hamilton


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

Date: Sat, 06 Nov 1999 09:00:48 +0000
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Help? What are Black Squares?
Message-Id: <7O0jOKmkydY8Kiln8NDSrS0dPnzN@4ax.com>

On Thu, 04 Nov 1999 16:27:05 GMT, "Reba Davis" <queen7@gte.net> wrote:

>Hi,
>
>Can someone tell me which key on the keyboard is used to display the
>"black" squares when one is looking at a CGI script when using Notepad.
>
>There have been times when I wanted to edit a script, but I don't know where
>the black squares are coming from.  They seem to appear between each piece
>of variable information for example.

You might find the article 'Why Does My File Have Funny Characters In
It?' at <http://www.mag-sol.com/Articles/> answers this question for
you.

hth

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

Date: Sun, 7 Nov 1999 19:45:58 -0600
From: "Michael S. Manley" <msm@manley.org>
Subject: Re: Help? What are Black Squares?
Message-Id: <805a7d$2al$1@eve.enteract.com>


Abigail wrote
>Reba Davis (queen7@gte.net) wrote
>``
>`` Can someone tell me which key on the keyboard is used to display the
>`` "black" squares when one is looking at a CGI script when using Notepad.
>
>Well, the black square key of course. Unfortunally, that key is not
>on *your* keyboard.


[disingenuous demonic discussion deleted]

Hm. Clpm has begun to read like rec.humor.oracle. Entertainment really is
all the same these days.

  MSM





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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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


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