[32434] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3701 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 27 09:09:26 2012

Date: Sun, 27 May 2012 06: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           Sun, 27 May 2012     Volume: 11 Number: 3701

Today's topics:
    Re: coding question <ben@morrow.me.uk>
    Re: confused about POD <hjp-usenet2@hjp.at>
    Re: confused about POD <ben@morrow.me.uk>
    Re: Help with install from CPAN <ben@morrow.me.uk>
    Re: Help with install from CPAN <dave@invalid.invalid>
    Re: Help with install from CPAN <dave@invalid.invalid>
    Re: Help with install from CPAN <ben@morrow.me.uk>
    Re: Help with install from CPAN <ben@morrow.me.uk>
    Re: How does a script language work in a server <jurgenex@hotmail.com>
    Re: How does a script language work in a server <ben@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 26 May 2012 00:19:16 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: coding question
Message-Id: <kkg599-s5g.ln1@anubis.morrow.me.uk>


Quoth rvaedex23@gmail.com:
> I am not very familiar with perl.  Although, I do have shell scripting
> experience.
> I thought this would be easier to do this in perl.
> 
> I have a file that doesn't have a field delimiter between the columns
> and I want to add a colon between each column.  I can identify the
> columns by hard coding the range:
> such as "col1 to col 10" "col11 to col24" etc...
> 
> I am stuck.  Any advise would help.  Thanks.

What have you tried?

Something like

    perl -ple's/(.{10})(.{14)/$1:$2/'

might be what you're looking for.

Ben



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

Date: Sat, 26 May 2012 10:21:06 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: confused about POD
Message-Id: <slrnjs14ji.1h8.hjp-usenet2@hrunkner.hjp.at>

On 2012-05-25 21:41, ccc31807 <cartercc@gmail.com> wrote:
> On May 25, 4:03 pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
>> Well, the obvious script "that someone else might have written" is of
>> course pod2html. Maybe you should start by explaining why that isn't
>> adequate for your needs (I can think of a couple of reasons, but my
>> reasons are probably not the same as your reasons).
>
> The simple answer is that it doesn't do what I want it to.
>
> For example, suppose I have the directory listing shown below because
> it's rather lengthy.
>
> Further suppose I run the following command at the command prompt,
>
>> generate_html_from_embedded_pod_in_perl_source_files *.pm *.plx *.cgi
>
> expecting it to generate a sub-directory (perhaps called
> 'documentation') with the following files:
>  - index.html
>  - CCC_LOCATIONS.html
>  - console.html
>  - SQL.html
>  - etc.
>
> I want a separate html file for every perl source file.

Since pod2html works on a single file anyway, you get that naturally.
You just have to invoke pod2html on every file, for example like this:

for i in scripts/* lib/**/*.pm
do
    mkdir -p ${i%/*}
    pod2html --htmlroot=http://example.org/doc/ 
             --infile=$i
	     --outfile=echo ${i%%.pm}.html
	     --podroot=lib
done

(zsh syntax, untested)

> I want the index.html to list and link to each html file

pod2html doesn't do this - you'd have to build the index in the loop
shown above.

It does, however, create links between the pages.

> and each html file to extract all the POD embedded in each plx, pm, or
> cgi file.

It does do this (one file at a time).

> pod2html doesn't do this.

Well, AFAICS it does everything except for a trivial loop and and index.

Now for the reasons why I don't like pod2html:

 * It adds annoying verbage to links, for example a sentence like
   "This method returns a list of L<Foo::Bar> objects." becomes "this
   method returns a list of <a href=".../Foo/Bar.html">the Foo::Bar
   manpage</a> objects". This is hard-coded and not configurable.
 * Sometimes it's hard to get your links to point where you want them
   (sorry, no current example, but I've wrestled with that in the past).
   (This may in fact be a problem with the POD format)
 * The HTML output is really inflexible, there isn't even support for 
   including a style sheet.

> If nothing does this, it's okay.

There are at least two website which automatically convert large amounts
of POD into (rather pretty) HTML: 

http://search.cpan.org
http://perldoc.perl.org

I think the source code for both is available.

	hp


-- 
   _  | Peter J. Holzer    | Deprecating human carelessness and
|_|_) | Sysadmin WSR       | ignorance has no successful track record.
| |   | hjp@hjp.at         | 
__/   | http://www.hjp.at/ |  -- Bill Code on asrg@irtf.org


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

Date: Sat, 26 May 2012 09:48:16 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: confused about POD
Message-Id: <gvh699-0h11.ln1@anubis.morrow.me.uk>


Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
> On 2012-05-25 21:41, ccc31807 <cartercc@gmail.com> wrote:
> >
> > I want the index.html to list and link to each html file
> 
> pod2html doesn't do this - you'd have to build the index in the loop
> shown above.
>
<snip>
> 
> Now for the reasons why I don't like pod2html:
> 
>  * It adds annoying verbage to links, for example a sentence like
>    "This method returns a list of L<Foo::Bar> objects." becomes "this
>    method returns a list of <a href=".../Foo/Bar.html">the Foo::Bar
>    manpage</a> objects". This is hard-coded and not configurable.

So does Pod::Man, used by default by command-line perldoc; the practice
originated there, since man doesn't support hyperlinks. (IMHO a simple
'...returns a list of Foo::Bar(3pm) objects' as is usual with manpage
cross-refernces would have been better, but there we go.) This is
documented in the perlpod manpage, and POD authors are supposed to
either make their sentences make sense with the additions or use the
L<...|...> syntax to suppress them. (I do the latter, and yes, it's
extremely annoying.)

Modern POD formatters don't add them, since it has been deemed Not
Helpful, but until perldoc's default format changes to something
Pod::Simple-based PODpages still need to be written on the assumption
they may be added.

>  * Sometimes it's hard to get your links to point where you want them
>    (sorry, no current example, but I've wrestled with that in the past).
>    (This may in fact be a problem with the POD format)
>  * The HTML output is really inflexible, there isn't even support for 
>    including a style sheet.

Pod::Simple::HTML generates much better, and much more customisable,
HTML; and Pod::Simple::HTMLBatch will convert a whole tree and make you
an index.

Ben



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

Date: Sat, 26 May 2012 00:13:42 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Help with install from CPAN
Message-Id: <6ag599-s5g.ln1@anubis.morrow.me.uk>


Quoth "Dave Saville" <dave@invalid.invalid>:
> On Mon, 21 May 2012 12:09:10 UTC, Shmuel (Seymour J.) Metz 
> <spamtrap@library.lspace.org.invalid> wrote:
> > In <fV45K0OBJxbE-pn2-vlLdewbMVVxb@localhost>, on 05/21/2012
> >    at 10:07 AM, "Dave Saville" <dave@invalid.invalid> said:
> > 
> > >Subject: Help with install from CPAN
> > 
> > What happens if you download a package from CPAN manually and try
> > installing it? What is your setup? 
> > 
> > You might try 5.10; That's what I'm currently running on eCS and I can
> > install CPAN packages with it.
> > 
> 
> I installed 5.10 from Paul's site into root of a drive that also had 
> Paul's environment on it. Once again nothing works CPAN wise. Usually 
> "make test" runs no tests - they all come back "no subtests run".  If 
> you try the tests individually they sometimes run OK, sometimes fail 
> and sometimes hang needing a CTRL-C.
> 
> On top of this I have the same problem as 5.8.2 in that the supplied 
> modules are too old to update. Choose a module, does not really matter
> which, say A.
> 
> A won't install because it requires B.
> B won't install because C is too low a level.
> C won't install because A .......................
> 
> These are modules like Test* Module::Build etc. All you need to get up
> tp date - except you can't. :-(

This shouldn't happen. That doesn't mean it doesn't, but IME it doesn't
happen very often, even on a fresh install of 5.10.

I would recommend you try installing the most recent versions of these
modules by hand (in this order):

    ExtUtils::MakeMaker
    Test::More
    Test::Harness
    Module::Build
    CPAN

plus their dependencies. If you haven't found it yet,
http://deps.cpantesters.org will give you a complete list of
dependencies of a given module, and will tell you which were core in a
given version of perl. (I'm afraid MB and CPAN have rather a lot of
non-5.10-core deps. If you feel like it you could try poking around on
search.cpan.org to find an older (but not too old :) ) version with
fewer deps.)

You could also try installing App::cpanminus, which is an alternative to
CPAN.pm which aims to do things the simplest way possible. I have
started using it exclusively instead of CPAN.pm, and had far fewer
problems; but I'm not using any platforms as (relatively) esoteric as
OS/2. If you have a command like curl which will make an HTTP request
and print the result to stdout, or if you've installed LWP, which
provides a command called GET, you can run

    GET http://cpanmin.us | perl - App::cpanminus

to install cpanminus using itself. (Of course you can also just download
that file using a web browser and run it from the local disk.)

> Doing a similar install of 5.14 yeilds the same mess - From a fresh 
> install I can't even install Astro::Sunrise which is working happily 
> on my 5.8.2 server from when it was installed on 5.8.0!

Where does it fail, out of interest? With a perl as recent as 5.14 I
would be very surprised if anything's out-of-date enough to cause a
problem. You may be seeing genuine portability problems, rather than
just package management problems.

> Now you see why I am still using 5.8.2. It might be old and 
> unsupported, but it actually works - as long as I don't need a new 
> module - which I do :-(

That's always the way, unfortunately. And sticking a box in the corner
and not touching it doesn't work, because all software has security bugs
and once they're found you're in trouble if you don't upgrade. Who'd be
a sysadmin...

Ben



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

Date: Sat, 26 May 2012 12:58:14 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Help with install from CPAN
Message-Id: <fV45K0OBJxbE-pn2-RRd5xNd5zpfN@localhost>

On Fri, 25 May 2012 23:13:42 UTC, Ben Morrow <ben@morrow.me.uk> wrote:

<snip>

> I would recommend you try installing the most recent versions of these
> modules by hand (in this order):
> 
>     ExtUtils::MakeMaker 6.63

perl Makefie.pl runs clean
make runs clean
and then

[T:\tmp\ExtUtils-MakeMaker-6.63_02]make test
U:/PERL5/BIN/PERL.EXE "-Iblib/arch" "-Iblib/lib" 
"-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00compile.t ............. No subtests run
t/arch_check.t ............ No subtests run
t/backwards.t ............. No subtests run
t/basic.t ................. No subtests run
t/build_man.t ............. No subtests run
t/cd.t .................... No subtests run
t/config.t ................ No subtests run
t/dir_target.t ............ No subtests run
t/echo.t .................. No subtests run
t/FIRST_MAKEFILE.t ........ No subtests run
t/fix_libs.t .............. No subtests run
t/fixin.t ................. No subtests run
t/hints.t ................. No subtests run
Could not execute (U:/PERL5/BIN/PERL.EXE -w t/INST.t): open3: 
IO::Pipe: Can't sp
awn-NOWAIT: Invalid seek at 
/perl5/lib/5.14.2/TAP/Parser/Iterator/Process.pm lin
e 168
make: *** [test_dynamic] Error 29

That last thing I have seen before and *might* be the old drive letter
problem



-- 
Regards
Dave Saville


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

Date: Sat, 26 May 2012 14:09:20 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Help with install from CPAN
Message-Id: <fV45K0OBJxbE-pn2-qughwNEGnE5U@localhost>

On Fri, 25 May 2012 23:13:42 UTC, Ben Morrow <ben@morrow.me.uk> wrote:

<snip>

> I would recommend you try installing the most recent versions of these
> modules by hand (in this order):
> 
>     ExtUtils::MakeMaker
>     Test::More
>     Test::Harness
>     Module::Build
>     CPAN

Having seen that ExtUtils::MakeMaker seem to pass all test run 
standalone except those that reinvoke the test method that fails with 
"no subtests run" I did a "make install" anyway. This has changed 
nothing. So I started onTest::More. There are so many tests I knocked 
up my own quick and dirty tester

use strict;
use warnings;
opendir T, 't' or die "Can't open t $!";
my @tests = grep /\.t$/, readdir T;
closedir T;
foreach (@tests)
{
  print "\n============ $_ ============\n";
  print `perl -Mblib t/$_`;
}
print "\n Completed tests\n";

I then did a "grep -v ^^ok" to strip the ok responses. Problem is I 
don't know enough to know if the errors below are real/matter or 
whatever. The testers site you quoted says they all should pass.

============ 00compile.t ============
1..14
============ 00test_harness_check.t ============
1..1
============ bad_plan.t ============
1..2
============ bail_out.t ============
1..3
============ BEGIN_require_ok.t ============
1..2
============ BEGIN_use_ok.t ============
1..2
============ buffer.t ============
1..20
============ circular_data.t ============
1..11
============ cmp_ok.t ============
1..20
============ c_flag.t ============
1..1
============ dependents.t ============
1..0 # SKIP Dependents only tested when releasing
============ diag.t ============
1..7
============ died.t ============
1..3
============ dont_overwrite_die_handler.t ============
1..2
============ eq_set.t ============
1..4
not ok 4 # TODO eq_set() doesn't really handle references
#   Failed (TODO) test at t/eq_set.t line 32.
============ exit.t ============
# Building up a map of exit codes.  May take a while.
# Done.
1..270
============ explain.t ============
1..5
============ extra.t ============
1..5
============ extra_one.t ============
1..2
============ fail-like.t ============
1..4
============ fail-more.t ============
1..80
not ok 69 # TODO cmp_ok() gives the wrong "expected" for undef
#   Failed (TODO) test at t/fail-more.t line 446.
#          got: '#   Failed test 'undef ne empty string'
# #   at t/fail-more.t line 437.
# #          got: undef
# #     expected: anything else
# '
#     expected: '#   Failed test 'undef ne empty string'
# #   at t/fail-more.t line 437.
# #          got: undef
# #     expected: ''
# '
============ fail.t ============
1..2
============ fail_one.t ============
1..2
============ filehandles.t ============
1..1
============ fork.t ============
1..1
============ harness_active.t ============
1..4
============ import.t ============
1..2
============ is_deeply_dne_bug.t ============
1..2
============ is_deeply_fail.t ============
1..100
============ is_deeply_with_threads.t ============
1..0 # Skip no working threads
============ missing.t ============
1..2
============ More.t ============
1..54
============ new_ok.t ============
1..13
============ note.t ============
1..2
============ no_plan.t ============
1..7
============ no_tests.t ============
1..3
============ overload.t ============
1..19
============ overload_threads.t ============
1..5
not ok 4 - Just checking todo as an overloaded value # TODO not really
todo, testing overloaded reason
#   Failed (TODO) test 'Just checking todo as an overloaded value'
#   at t/overload_threads.t line 53.
============ plan.t ============
1..4
============ plan_bad.t ============
1..12
============ plan_is_noplan.t ============
1..1
============ plan_no_plan.t ============
not ok 5 # TODO & SKIP Just testing todo_skip
1..6
============ plan_shouldnt_import.t ============
1..1
============ plan_skip_all.t ============
1..0 # SKIP Just testing plan & skip_all
============ pod-coverage.t ============
1..0 # SKIP Test::Pod::Coverage 1.08 required for testing POD coverage
============ pod.t ============
1..0 # SKIP Test::Pod 1.00 required for testing POD
============ require_ok.t ============
1..8
============ simple.t ============
1..3
============ skip.t ============
1..17
============ skipall.t ============
1..2
============ tbm_doesnt_set_exported_to.t ============
1..1
============ threads.t ============
1..0 # Skip: no working threads
============ thread_taint.t ============
1..1
============ todo.t ============
1..36
not ok 1 - Expected failure # TODO Just testing the todo interface.
#   Failed (TODO) test 'Expected failure'
#   at t/todo.t line 21.
not ok 2 - Another expected failure # TODO Just testing the todo 
interface.
#   Failed (TODO) test 'Another expected failure'
#   at t/todo.t line 22.
not ok 5 - Yet another failure # TODO Just testing the todo interface.
#   Failed (TODO) test 'Yet another failure'
#   at t/todo.t line 34.
not ok 7 - ok # TODO testing that error messages don't leak out of 
todo
#   Failed (TODO) test 'ok'
#   at t/todo.t line 43.
not ok 8 - like # TODO testing that error messages don't leak out of 
todo
#   Failed (TODO) test 'like'
#   at t/todo.t line 45.
#                   'this'
#     doesn't match '(?^:that)'
not ok 9 - is # TODO testing that error messages don't leak out of 
todo
#   Failed (TODO) test 'is'
#   at t/todo.t line 46.
#          got: 'this'
#     expected: 'that'
not ok 10 - isnt # TODO testing that error messages don't leak out of 
todo
#   Failed (TODO) test 'isnt'
#   at t/todo.t line 47.
#          got: 'this'
#     expected: anything else
not ok 11 - Fooble->can('yarble') # TODO testing that error messages 
don't leak out of todo
#   Failed (TODO) test 'Fooble->can('yarble')'
#   at t/todo.t line 49.
#     Fooble->can('yarble') failed
not ok 12 - The class isa yarble # TODO testing that error messages 
don't leak out of todo
#   Failed (TODO) test 'The class isa yarble'
#   at t/todo.t line 50.
#     The class isn't a 'yarble' it's a ''
not ok 13 - use Fooble; # TODO testing that error messages don't leak 
out of todo
#   Failed (TODO) test 'use Fooble;'
#   at t/todo.t line 51.
#     Tried to use 'Fooble'.
#     Error:  Can't locate Fooble.pm in @INC (@INC contains: 
T:/tmp/Test-Simple-0.98/blib/arch T:/tmp/Test-Simple-0.98/blib/lib 
/perl5/lib/site_perl/5.14.2/os2 /perl5/lib/site_perl/5.14.2 
/perl5/lib/5.14.2/os2 /perl5/lib/5.14.2 /perl5/lib/site_perl/5.10.0 
/perl5/lib/site_perl .) at (eval 11) line 2.
# BEGIN failed--compilation aborted at (eval 11) line 2.
not ok 14 - require Fooble; # TODO testing that error messages don't 
leak out of todo
#   Failed (TODO) test 'require Fooble;'
#   at t/todo.t line 52.
#     Tried to require 'Fooble'.
#     Error:  Can't locate Fooble.pm in @INC (@INC contains: 
T:/tmp/Test-Simple-0.98/blib/arch T:/tmp/Test-Simple-0.98/blib/lib 
/perl5/lib/site_perl/5.14.2/os2 /perl5/lib/site_perl/5.14.2 
/perl5/lib/5.14.2/os2 /perl5/lib/5.14.2 /perl5/lib/site_perl/5.10.0 
/perl5/lib/site_perl .) at (eval 12) line 2.
not ok 15 # TODO & SKIP Just testing todo_skip
not ok 16 # TODO & SKIP Just testing todo_skip
not ok 17 # TODO & SKIP Just testing todo_skip
not ok 19 - Just testing todo # TODO testing $TODO with an incorrect 
exported_to()
#   Failed (TODO) test 'Just testing todo'
#   at t/todo.t line 89.
not ok 20 - Testing todo_start() # TODO Expected failures
#   Failed (TODO) test 'Testing todo_start()'
#   at t/todo.t line 95.
not ok 21 - Testing todo_start() with more than one failure # TODO 
Expected failures
#   Failed (TODO) test 'Testing todo_start() with more than one 
failure'
#   at t/todo.t line 96.
not ok 24 - fail 1 # TODO Nesting TODO
#   Failed (TODO) test 'fail 1'
#   at t/todo.t line 107.
not ok 25 - fail 2 # TODO failure level 1
#   Failed (TODO) test 'fail 2'
#   at t/todo.t line 110.
not ok 26 - fail 3 # TODO failure_level 2
#   Failed (TODO) test 'fail 3'
#   at t/todo.t line 114.
not ok 27 - fail 4 # TODO failure level 1
#   Failed (TODO) test 'fail 4'
#   at t/todo.t line 118.
not ok 28 - fail 4 # TODO Nesting TODO
#   Failed (TODO) test 'fail 4'
#   at t/todo.t line 123.
not ok 31 - testing todo_start() with no message # TODO 
#   Failed (TODO) test 'testing todo_start() with no message'
#   at t/todo.t line 132.
============ undef.t ============
1..21
============ useing.t ============
1..5
============ use_ok.t ============
1..15
============ utf8.t ============
1..5
============ versions.t ============
1..4
 Completed tests

-- 
Regards
Dave Saville


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

Date: Sat, 26 May 2012 19:02:04 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Help with install from CPAN
Message-Id: <sdi799-7841.ln1@anubis.morrow.me.uk>


Quoth "Dave Saville" <dave@invalid.invalid>:
> 
> Having seen that ExtUtils::MakeMaker seem to pass all test run 
> standalone except those that reinvoke the test method that fails with 
> "no subtests run" I did a "make install" anyway.

This 'no subtests run' thing ideally needs to be fixed, though.
*Something* is going badly wrong, and it may affect code other than
TAP::Harness.

> This has changed 
> nothing. So I started onTest::More. There are so many tests I knocked 
> up my own quick and dirty tester
> 
> use strict;
> use warnings;
> opendir T, 't' or die "Can't open t $!";
> my @tests = grep /\.t$/, readdir T;
> closedir T;
> foreach (@tests)
> {
>   print "\n============ $_ ============\n";
>   print `perl -Mblib t/$_`;

 ...so that works, too. This is getting weirder and weirder: I can't
imagine what TAP::Harness is doing that's fundamentally different from
what backticks do.

> }
> print "\n Completed tests\n";
> 
> I then did a "grep -v ^^ok" to strip the ok responses. Problem is I 
> don't know enough to know if the errors below are real/matter or 
> whatever. The testers site you quoted says they all should pass.

All those results are passes. Any line beginning with '#' is a comment,
and any test result matching /^not ok .*# TODO/ is a TODO test, which
the harness will count as a pass even though it failed. They're used for
writing tests for things you haven't implemented yet; if and when they
start passing, Test::Harness will print something like '6 TODO tests
passed'.

The full spec for TAP (this 'ok/not ok' test output format) is at
http://testanything.org/wiki/index.php/TAP_specification . It wouldn't
take long to write a complete and correct parser; you could even release
it as TAP::Harness::Tiny... :).

Ben



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

Date: Sat, 26 May 2012 22:38:57 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Help with install from CPAN
Message-Id: <h4v799-o781.ln1@anubis.morrow.me.uk>


Quoth Ben Morrow <ben@morrow.me.uk>:
> Quoth "Dave Saville" <dave@invalid.invalid>:
> > 
> > Having seen that ExtUtils::MakeMaker seem to pass all test run 
> > standalone except those that reinvoke the test method that fails with 
> > "no subtests run" I did a "make install" anyway.
> 
> This 'no subtests run' thing ideally needs to be fixed, though.
> *Something* is going badly wrong, and it may affect code other than
> TAP::Harness.

I meant to say: until you get this fixed, there's no point trying to use
CPAN.pm or cpanm or any other automated installer, since they won't
install if tests fail. I suppose you could use the -n switch to cpanm
(not cpan, which doesn't support this), which causes it to skip 'make
test' altogether, but I really wouldn't recommend it when you already
know things aren't working as they should.

Here's a rather crude hack you could try: put the following in
TAP/Harness/UseQx.pm somewhere in your @INC:

    package TAP::Harness::UseQx;

    use warnings;
    use strict;

    require TAP::Harness;
    our @ISA = "TAP::Harness";

    #warn "UseQx: loaded\n";

    sub _get_parser_args {
        my ($self, $job) = @_;

        my $test = $job->filename;
        my @switches;
        push @switches, $self->lib      if $self->lib;
        push @switches, $self->switches if $self->switches;

        local $" = " ";
        my $cmd = "perl @switches $test";
        #warn "UseQx: running [$cmd]\n";

        my $tap = qx/$cmd/;
        return { tap => $tap };
    }

    1;

and then set HARNESS_SUBCLASS=TAP::Harness::UseQx in your environment.
This won't work on 5.10 until you've manually upgraded Test::Harness,
since the version supplied with 5.10 doesn't support this extension
mechanism.

If this *doesn't* work, it would be interesting to see what you get if
you uncomment those warnings. It's just possible something in your setup
is causing TAP::Harness to pass the wrong args to perl.

Ben



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

Date: Fri, 25 May 2012 15:59:45 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How does a script language work in a server
Message-Id: <0f30s7d1ih20vvg8cnbv55spktf293014o@4ax.com>

John <John.Smith@invalid.com> wrote:
>When someone uses s browser and goes to a www.somesite.com/someperl.pl how does
>it work at the server end? 

That depends totally upon how the server is configured. The server may
respond by sending the content of this file (provided this URL actually
does refer to a file), it may execute this file as a program and return
any output this program generates (those two are common scenarios), it
may query a database and return all results that are found using the
query someperl.pl (not so common), or it may do any of a gazillion
different things. It all depends on how the server is configured.

>Let's say I'd like to create a "perl-clone" or
>something like perl or php where would I get more info?

At relevant graduate classes about "Design of Programming Languages" and
"Compiler Construction" at your favourite university.

jue 


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

Date: Fri, 25 May 2012 23:49:31 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How does a script language work in a server
Message-Id: <rse599-utf.ln1@anubis.morrow.me.uk>


Quoth John.Smith@invalid.com:
> When someone uses s browser and goes to a www.somesite.com/someperl.pl
> how does it work at the server end?

That depends on how the server is set up. If you look at the various
Plack::Handler modules on CPAN you will see some of the different ways
Perl can be set up as a server-side language.

> Let's say I'd like to create a
> "perl-clone" or something like perl or php where would I get more
> info?

Why do you think you need to do this? What are you trying to do that you
can't do with Perl (or Ruby, or Python, or whatever)?

If you really want to, it would probably be simpler to write your
interpreter *in* Perl, and use the existing interfaces for running Perl
programs. This is how PHP started, after all (not that I'd recommend PHP
as a good example of how to do *anything*).

In the simplest terms, all a language strictly needs to be able to do to
run as a server-side HTTP app is access its command-line arguments and
environment, read from stdin, and write to stdout and stderr. This is
sufficient for CGI; for more efficient interfaces like FastCGI you also
need access to the socket syscalls, and probably the resolver. For
something like mod_perl you would need to write an Apache extension
which knows how to load your language interpreter and provide it with an
interface to communicate with the web server.

Ben



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

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


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