[31843] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3106 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 30 18:09:24 2010

Date: Mon, 30 Aug 2010 15:09:07 -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           Mon, 30 Aug 2010     Volume: 11 Number: 3106

Today's topics:
        [CGI] How to set a 404 error? <rui.maciel@gmail.com>
    Re: [CGI] How to set a 404 error? <kkeller-usenet@wombat.san-francisco.ca.us>
        ActiveState Perl 5.10 on Windows XP - can't shell!!?? <perljunkie@gmail.com>
    Re: ActiveState Perl 5.10 on Windows XP - can't shell!! <ben@morrow.me.uk>
    Re: ActiveState Perl 5.10 on Windows XP - can't shell!! <perljunkie@gmail.com>
    Re: How to suppress methodName element in soap:Body of  <glex_no-spam@qwest-spam-no.invalid>
        perfmon and perl <hara.acharya@gmail.com>
    Re: perfmon and perl <ben@morrow.me.uk>
    Re: perfmon and perl <hara.acharya@gmail.com>
    Re: perfmon and perl <ben@morrow.me.uk>
    Re: perldoc (was: Re: FAQ 5.23...) <brian.d.foy@gmail.com>
    Re: perldoc (was: Re: FAQ 5.23...) <brian.d.foy@gmail.com>
    Re: perldoc (was: Re: FAQ 5.23...) <ben@morrow.me.uk>
    Re: report graphing <tzz@lifelogs.com>
    Re: Writing or copying file to another directory <jurgenex@hotmail.com>
    Re: Writing or copying file to another directory <paul@pstech-inc.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 30 Aug 2010 22:21:21 +0100
From: Rui Maciel <rui.maciel@gmail.com>
Subject: [CGI] How to set a 404 error?
Message-Id: <4c7c20d6$0$6200$a729d347@news.telepac.pt>

In a perl CGI script, is it possible to throw a 404 error?  If so, how is it done?


Thanks in advance,
Rui Maciel


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

Date: Mon, 30 Aug 2010 14:40:51 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: [CGI] How to set a 404 error?
Message-Id: <44ltk7x9bh.ln2@goaway.wombat.san-francisco.ca.us>

On 2010-08-30, Rui Maciel <rui.maciel@gmail.com> wrote:
> In a perl CGI script, is it possible to throw a 404 error?  If so, how is it done?

Read the CGI module docs under "CREATING A STANDARD HTTP HEADER".

--keith

-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



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

Date: Mon, 30 Aug 2010 12:32:05 -0700 (PDT)
From: Perl Junkie <perljunkie@gmail.com>
Subject: ActiveState Perl 5.10 on Windows XP - can't shell!!??
Message-Id: <5765cbe5-4cf0-4e47-9529-3be5a96db584@m1g2000yqo.googlegroups.com>

Searched high and low on this and have found absolutely nothing.  It's
so bizarre.  I've never actually heard of this happening anyway.
(It's Windows, so there's half of the problem there, IMO...)

Running ActiveState Perl v5.10 on Windows XP.  All of a sudden, for
seemingly no reason at all (of course none that I know about), I can't
shell out of Perl.  For instance:

C:\> perl -e "$dir = `dir`; print $dir;"

Prints nothing.  The `dir` doesn't happen.  I've tried using qx{} as
well.  I have Cygwin running on my machine and it works fine using
Cygwin Perl v5.10.  But not under ActiveState.  I checked with our
security group and as far as they know, no restrictions are being made
on system() or shell calls on software on our systems.  I tried
installing/upgrading to AS Perl v5.12 -- the latest -- but still can't
seem to shell.

Anyone else run into this?  It's so bizarre, I can't even conceive of
what would be blocking this.

-pj


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

Date: Mon, 30 Aug 2010 21:22:53 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: ActiveState Perl 5.10 on Windows XP - can't shell!!??
Message-Id: <thgtk7-aum2.ln1@osiris.mauzo.dyndns.org>


Quoth Perl Junkie <perljunkie@gmail.com>:
> Searched high and low on this and have found absolutely nothing.  It's
> so bizarre.  I've never actually heard of this happening anyway.
> (It's Windows, so there's half of the problem there, IMO...)
> 
> Running ActiveState Perl v5.10 on Windows XP.  All of a sudden, for
> seemingly no reason at all (of course none that I know about), I can't
> shell out of Perl.  For instance:
> 
> C:\> perl -e "$dir = `dir`; print $dir;"
> 
> Prints nothing.  The `dir` doesn't happen.  I've tried using qx{} as
> well.  I have Cygwin running on my machine and it works fine using
> Cygwin Perl v5.10.  But not under ActiveState.  I checked with our
> security group and as far as they know, no restrictions are being made
> on system() or shell calls on software on our systems.  I tried
> installing/upgrading to AS Perl v5.12 -- the latest -- but still can't
> seem to shell.

Do you have either COMSPEC or PERL5SHELL set to something weird in the
environment? Are you attempting to do any of this from a non-standard
terminal emulator (such as 4NT)?

What do you get if you run

    perl -le "system 'dir'; print ":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:"

Are you able to run perl under a C-level debugger, and find out what API
calls it's actually making? (Is there a Win32 equivalent of [ks]trace?)

Ben



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

Date: Mon, 30 Aug 2010 14:56:57 -0700 (PDT)
From: Perl Junkie <perljunkie@gmail.com>
Subject: Re: ActiveState Perl 5.10 on Windows XP - can't shell!!??
Message-Id: <c16a3ddc-7297-4a84-8bd3-fc0a56f94345@s15g2000yqm.googlegroups.com>

On Aug 30, 3:22=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Perl Junkie <perljun...@gmail.com>:
>
>
>
>
>
> > Searched high and low on this and have found absolutely nothing. =A0It'=
s
> > so bizarre. =A0I've never actually heard of this happening anyway.
> > (It's Windows, so there's half of the problem there, IMO...)
>
> > Running ActiveState Perl v5.10 on Windows XP. =A0All of a sudden, for
> > seemingly no reason at all (of course none that I know about), I can't
> > shell out of Perl. =A0For instance:
>
> > C:\> perl -e "$dir =3D `dir`; print $dir;"
>
> > Prints nothing. =A0The `dir` doesn't happen. =A0I've tried using qx{} a=
s
> > well. =A0I have Cygwin running on my machine and it works fine using
> > Cygwin Perl v5.10. =A0But not under ActiveState. =A0I checked with our
> > security group and as far as they know, no restrictions are being made
> > on system() or shell calls on software on our systems. =A0I tried
> > installing/upgrading to AS Perl v5.12 -- the latest -- but still can't
> > seem to shell.
>
> Do you have either COMSPEC or PERL5SHELL set to something weird in the
> environment? Are you attempting to do any of this from a non-standard
> terminal emulator (such as 4NT)?
>
> What do you get if you run
>
> =A0 =A0 perl -le "system 'dir'; print ":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:=
"
>

Result is:

:65280:65280:No such file or directory:The filename or extension is
too long:

But $! isn't alwaya reset.  I was getting "Bad filename descriptor" at
one point in time.  Interestingly, we used similar delimiters for a
similar command I also issued. :-)  Freaky how techs think. :-)

I'm still submarined.  (Man, I hate Windows, but there's no choice in
the matter here.)

-PJ


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

Date: Mon, 30 Aug 2010 15:53:37 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: How to suppress methodName element in soap:Body of envelope with SOAP::Lite
Message-Id: <4c7c1a52$0$48215$815e3792@news.qwest.net>

droesler wrote:
> Hi,
> 
> Is there a way to suppress the surrounding methodName element of the
> soap:Body section of the SOAP envelope?

No idea what that means. Soap:Envelope and Soap:Body should be
the first two elements in the request, the method should be within
the Soap:Body element. How is the Web service supposed to know what
method to run, if it's not sent in the request? Maybe the Web Service is 
poorly designed? Maybe it's a namespace issue?  Who knows...

At least show some of the XML in question.
Show what's expected by the service and what's being sent by
your client.

If the service is in .NET, you have to do more work in Soap::Lite.
Look around the Internet for steps to take.

Also, to help you debug things, you can see what's sent/received,
be enabling trace:

use SOAP::Lite +trace;

If all else fails, you might be able to take the expected XML
request, modify it to suit your needs, and POST it.


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

Date: Sun, 29 Aug 2010 21:20:46 -0700 (PDT)
From: king <hara.acharya@gmail.com>
Subject: perfmon and perl
Message-Id: <b79bdd19-8862-46b5-b09e-4a41ae600a1a@b4g2000pra.googlegroups.com>

Hi All,
I am using use Win32::PerfMon; in a 64 bit windows 7 system. Is htis
module only for 32 bit if so..where can I get a module for 64  bit os.
The module got installed but when running the programme, its showing
the below error. I didn't write any code but just trying to use the
module and see how it works so that I can use it.
"
Can't locate loadable object for module Win32::PerfMon in @INC (@INC
contains: C
:/Perl64/site/lib C:/Perl64/lib .) at perfmon-cstate.txt line 1
Compilation failed in require at perfmon-cstate.txt line 1.
BEGIN failed--compilation aborted at perfmon-cstate.txt line 1."

Basically not able to load the module.

What i want to do:
I want to add c-state residency counter to perfmon and find the c-
state residency of all the CPU cores.
 Is htis module only for 32 bit if so..where can I get a module for
64  bit os.
The module got installed but when running the programme, its showing
the below error. I didn't write any code but just trying to use the
module and see how it works so that I can use it.

Can anybody help me with a solution ?


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

Date: Mon, 30 Aug 2010 07:32:13 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: perfmon and perl
Message-Id: <dsvrk7-dng2.ln1@osiris.mauzo.dyndns.org>


Quoth king <hara.acharya@gmail.com>:
> Hi All,
> I am using use Win32::PerfMon; in a 64 bit windows 7 system. Is htis
> module only for 32 bit if so..where can I get a module for 64  bit os.
> The module got installed but when running the programme, its showing
> the below error. I didn't write any code but just trying to use the
> module and see how it works so that I can use it.

Where did you get the module from? Where did you get your Perl from? Are
you sure they're compatible with each other?

> "
> Can't locate loadable object for module Win32::PerfMon in @INC (@INC
> contains: C
> :/Perl64/site/lib C:/Perl64/lib .) at perfmon-cstate.txt line 1
> Compilation failed in require at perfmon-cstate.txt line 1.
> BEGIN failed--compilation aborted at perfmon-cstate.txt line 1."

Do you have a Win32\PerfMon.dll under either of those directories?

Ben



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

Date: Mon, 30 Aug 2010 10:27:51 -0700 (PDT)
From: king <hara.acharya@gmail.com>
Subject: Re: perfmon and perl
Message-Id: <17182c21-6b29-4c64-bad4-1df0ed36d4f3@x24g2000pro.googlegroups.com>

On Aug 30, 11:32=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth king <hara.acha...@gmail.com>:
>
> > Hi All,
> > I am using use Win32::PerfMon; in a 64 bit windows 7 system. Is htis
> > module only for 32 bit if so..where can I get a module for 64 =A0bit os=
 .
> > The module got installed but when running the programme, its showing
> > the below error. I didn't write any code but just trying to use the
> > module and see how it works so that I can use it.
>
> Where did you get the module from? Where did you get your Perl from? Are
> you sure they're compatible with each other?
>
> > "
> > Can't locate loadable object for module Win32::PerfMon in @INC (@INC
> > contains: C
> > :/Perl64/site/lib C:/Perl64/lib .) at perfmon-cstate.txt line 1
> > Compilation failed in require at perfmon-cstate.txt line 1.
> > BEGIN failed--compilation aborted at perfmon-cstate.txt line 1."
>
> Do you have a Win32\PerfMon.dll under either of those directories?
>
> Ben

I got the module from cpan. And its their in PPM all available
modules. I installed using PPM.
Yes I have copied perfmon.dll in lib directory.

But is not working still.
Any otherway to find c-stateresidency using perl and command line
option?

Regards


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

Date: Mon, 30 Aug 2010 21:15:08 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: perfmon and perl
Message-Id: <c3gtk7-aum2.ln1@osiris.mauzo.dyndns.org>


Quoth king <hara.acharya@gmail.com>:
> On Aug 30, 11:32 am, Ben Morrow <b...@morrow.me.uk> wrote:
> > Quoth king <hara.acha...@gmail.com>:
> >
> > > I am using use Win32::PerfMon; in a 64 bit windows 7 system. Is htis
> > > module only for 32 bit if so..where can I get a module for 64  bit os.
> > > The module got installed but when running the programme, its showing
> > > the below error. I didn't write any code but just trying to use the
> > > module and see how it works so that I can use it.
> >
> > Where did you get the module from? Where did you get your Perl from? Are
> > you sure they're compatible with each other?
> >
> > > "
> > > Can't locate loadable object for module Win32::PerfMon in @INC (@INC
> > > contains: C
> > > :/Perl64/site/lib C:/Perl64/lib .) at perfmon-cstate.txt line 1
> > > Compilation failed in require at perfmon-cstate.txt line 1.
> > > BEGIN failed--compilation aborted at perfmon-cstate.txt line 1."
> >
> > Do you have a Win32\PerfMon.dll under either of those directories?
> 
> I got the module from cpan. And its their in PPM all available
> modules. I installed using PPM.

Where *exactly* did the PPM come from? Have you added any custom PPM
repositories? Do you have good reason to believe it's a PPM for a 64bit
perl? (Are you actually using a 64bit perl? It's possible to run either
on a Win64 system.)

> Yes I have copied perfmon.dll in lib directory.

*You* have copied it? Where from? Where to, exactly: I presume you didn't
just copy PerfMon.dll directly under one of the lib\ directories? Wasn't
it installed properly by the PPM installer?

> But is not working still.
> Any otherway to find c-stateresidency using perl and command line
> option?

Sorry, no idea. I don't use Win32 if I can possibly avoid it.

Ben



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

Date: Mon, 30 Aug 2010 02:11:38 -0400
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: perldoc (was: Re: FAQ 5.23...)
Message-Id: <300820100211382481%brian.d.foy@gmail.com>

In article <4c79d2b3@news.>, Xiong Changnian <xiong108@xuefang.com>
wrote:

> Hi Keith,
> 
> On Sat, 28 Aug 2010 20:04:49 -0700, Keith Keller wrote:
> 
> > The Perl docs are basically POD, and the other tools you mention
> > (perldoc, perldoc.perl.org, others) are generated from a POD parser. 
> 
> Yes; that's rather my complaint. POD is a rudimentary markup; I class it 
> as plain text (or common workarounds such as *bold*). I suggest HTML and 
> SVG as the primary format for certain types of documentation. 

There's no advantage to HTML, which is also a plain text format.
DocBook would probably be better than HTML, but even it has its
limitations.

Pod can handle images just fine (Learning Perl, Intermediate Perl, and
Mastering Perl were written in Pod and used figures just fine). It's
just that we have almost no images in the core Perl docs. I think we
should have diagrams of more things, especially in the data structures
documentation.


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

Date: Mon, 30 Aug 2010 02:14:02 -0400
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: perldoc (was: Re: FAQ 5.23...)
Message-Id: <300820100214021161%brian.d.foy@gmail.com>

In article <bb1pk7-k8m1.ln1@osiris.mauzo.dyndns.org>, Ben Morrow
<ben@morrow.me.uk> wrote:


> what is needed here is
> someone with the determination and the necessary broad vision to push
> the changes through. Make no mistake, though: it would be a *lot* of
> work.

It is a lot of work, and you're welcome :)


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

Date: Mon, 30 Aug 2010 07:39:14 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: perldoc (was: Re: FAQ 5.23...)
Message-Id: <i90sk7-dng2.ln1@osiris.mauzo.dyndns.org>


Quoth brian d foy <brian.d.foy@gmail.com>:
> In article <bb1pk7-k8m1.ln1@osiris.mauzo.dyndns.org>, Ben Morrow
> <ben@morrow.me.uk> wrote:
> 
> > what is needed here is
> > someone with the determination and the necessary broad vision to push
> > the changes through. Make no mistake, though: it would be a *lot* of
> > work.
> 
> It is a lot of work, and you're welcome :)

I...

*None* of that was intended as a disparagement of anyone actively
involved in maintaining the Perl docs. I am well aware that it is both a
lot of work and relatively thankless, and I think I've made it clear in
the past that I have little time for people who complain about the
current docs without getting on and fixing the perceived problems.

It goes without saying, but perhaps should be said more often anyway:
thank you for the work you do to improve Perl's docs. It *is*
appreciated.

Ben



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

Date: Mon, 30 Aug 2010 08:13:50 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: report graphing
Message-Id: <87pqx0qm41.fsf@lifelogs.com>

On Thu, 26 Aug 2010 06:35:11 -0700 (PDT) androidUser78 <jtbutler1978@gmail.com> wrote: 

a> I am not sure where else to post this but I am running a LAMP
a> environment and my users now want historical graphical reporting. For
a> instance, normally the user would have a web interface and submit a
a> bunch of parameters to it and I would spit back a report. But now they
a> want this report to be graphical and they want it to keep historical
a> information of their parameters. So for instance at 9am they want to
a> see how many hits a site got (assume for example purposes we store in
a> the DB). Then at 9:10, the report is refreshed and they see how many
a> hits we have gotten since 9am, then 9:20, etc, etc. The interface and
a> backend stuff is already done but does anyone use or know of any tools
a> that would help me plot this stuff? I looked at Cacti but it seems
a> like it only takes a script that you need to enter into the web
a> interface.

If your data is not top-secret and you don't mind surrendering control,
Google Charts has a nice interface that you can drive from Perl or
directly from a web application.

Ted


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

Date: Sun, 29 Aug 2010 15:33:12 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Writing or copying file to another directory
Message-Id: <bsnl76dv3m4s76f5i54819ahr1kf3fnqhl@4ax.com>

Tad McClellan <tadmc@seesig.invalid> wrote:
>Jürgen Exner <jurgenex@hotmail.com> wrote:
>> "Paul E. Schoen" <paul@pstech-inc.com> wrote:
>
>>>I'd like to have things set up with the maximum possible level of security, 
>>>but still allow the necessary processes to take place. I found this document 
>>>about security: http://www.w3.org/Security/Faq/wwwsf1.html and it answered 
>>>some questions. The perl faq was not helpful except to say that the perl 
>>>source is not easily hidden.
>>
>> Well, that's not surprising considering that Perl doesn't require (or
>> offers) anything different compared to other programming languages.
>
>
>Other programming languages have taint checking?

Yes, you are right. There are a few Perl-specific features for
CGI-programming like the taint checking that you mentioned. Those most
certainly belong into a "CGI in Perl" FAQ / document / man-page /
tutorial / .... .

But access rights of the web server do not fall into that category.

jue


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

Date: Mon, 30 Aug 2010 11:14:57 -0400
From: "Paul E. Schoen" <paul@pstech-inc.com>
Subject: Re: Writing or copying file to another directory
Message-Id: <3WPeo.2131$rC7.815@newsfe10.iad>


"Jürgen Exner" <jurgenex@hotmail.com> wrote in message 
news:bsnl76dv3m4s76f5i54819ahr1kf3fnqhl@4ax.com...
> Tad McClellan <tadmc@seesig.invalid> wrote:
>>Jürgen Exner <jurgenex@hotmail.com> wrote:
>>> "Paul E. Schoen" <paul@pstech-inc.com> wrote:
>>
>>>>I'd like to have things set up with the maximum possible level of 
>>>>security,
>>>>but still allow the necessary processes to take place. I found this 
>>>>document
>>>>about security: http://www.w3.org/Security/Faq/wwwsf1.html and it 
>>>>answered
>>>>some questions. The perl faq was not helpful except to say that the perl
>>>>source is not easily hidden.
>>>
>>> Well, that's not surprising considering that Perl doesn't require (or
>>> offers) anything different compared to other programming languages.
>>
>>
>>Other programming languages have taint checking?
>
> Yes, you are right. There are a few Perl-specific features for
> CGI-programming like the taint checking that you mentioned. Those most
> certainly belong into a "CGI in Perl" FAQ / document / man-page /
> tutorial / .... .
>
> But access rights of the web server do not fall into that category.

OK, I think I understand it more clearly now. I tried to find a newsgroup 
specific to CGI but they appear to be inactive. I just thought it would be 
helpful to add a topic in the FAQ about where to look for information on 
server-side issues and security, since AFAIK perl is the predominate 
language used for that purpose. I have requested that the administrator of 
my account look at my website files on the server and let me know of any 
security issues.

My next step in this project will be to add an activity to the list based on 
the data that someone enters in the form provided for that purpose. It 
should be sorted by date, and then converted to HTML for the home page to 
display. It seems that a server-side script would be best for this purpose, 
and Perl may be the best choice, but I might also look into using C or Java 
because I am more familiar with the syntax. I might also be able to use 
JavaScript in the HTML form submission document to convert to HTML, but I 
would still need a server side script to write the file to the server.

I might do some searching for Perl scripts that already do most of what I 
need. But I also need to make sure they are well written, which is nearly 
impossible for me to determine since the language is still quite foreign to 
me. If you can give me some advice as to where I can find what I need, then 
I promise I won't bug you guys any more.

Thanks for all you have done so far.

Paul 



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 3106
***************************************


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