[15483] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2893 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 28 14:10:36 2000

Date: Fri, 28 Apr 2000 11:10:24 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <956945424-v9-i2893@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 28 Apr 2000     Volume: 9 Number: 2893

Today's topics:
        Netscape::Server 0.24 (aka nsapi_perl) on Perl 5.6.0? <dwhaskin@earthlink.net>
        Netscape::Server 0.24 (aka nsapi_perl) on Perl 5.6.0? <dwhaskin@earthlink.net>
        perl backtic problem with slapd (Eric R. Jorgensen)
    Re: perl backtic problem with slapd nobull@mail.com
    Re: Perl can't find specific XML::DOM package bbrelin@my-deja.com
        Perl Compiler with 5.6.0 - quick fix (Mike Schilli)
        perl embed perlguts xzhu77@my-deja.com
    Re: perl in NT .BAT files Question + emacs <Vincent.Murphy@Baltimore.Com>
    Re: perl in NT .BAT files Question + emacs <DNess@Home.Com>
    Re: perl in NT .BAT files Question <skx@tardis.ed.ac.uk>
    Re: perl in NT .BAT files Question <DNess@Home.Com>
    Re: Perl POD problem swaroop_g@my-deja.com
        perl v5.6.0 install and the "otherlibdirs" variable <cedelis@uillinois.edu>
        Problem w/Net::NNTP <admin@salvador.venice.ca.us>
    Re: Problem w/Net::NNTP <rootbeer@redcat.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 28 Apr 2000 17:28:51 GMT
From: Denis Haskin <dwhaskin@earthlink.net>
Subject: Netscape::Server 0.24 (aka nsapi_perl) on Perl 5.6.0?
Message-Id: <3909CA04.7A8B72A2@earthlink.net>

Has anyone bulit/installed Netscape::Server on Perl 5.6.0?  I'm
attempting to do it on Solaris and getting some problems (see below).
I'll look into it further myself, but I figured if someone has already
been here, I'd like to ride on their coattails.

I sent mail to nsapi_perl@samurai.com, which is the "nsapi_perl mailing
list", according to http://people.canoe.ca/bsugars/nsapi_perl.html, but
no response as of yet.  Also it looks like this module is no longer
being maintained.

Thanks,

dwh

Here's what I get during make, and below that is a perl -V output.

---snip---

  CPAN.pm: Going to build BSUGARS/nsapi_perl-0.24.tar.gz


Welcome to nsapi_perl.  This program will ask some questions and then
generate Makefiles that will be used to compile the nsapi_perl server
plug in and the Netscape:: perl extensions.

Some questions may have default answers.  If a question has a default
answer, it will be presented between square brackets [ ... ] when the
question is asked.  Just hit <return> to accept the default answer.

Proceed? [y]


Enter your Netscape server's root directory:
/opt/netscape/suitespot/https-heimlich

Enter the directory where the NSAPI header files can
be found: []
/opt/netscape/suitespot/include

Enter where you want to install the Netscape plugin and the
nsapi_perl_init.pl start-up script:
[/opt/netscape/suitespot/https-heimlich/lib]


Enable nsapi_perl tracing? [y]


If you are running your Netscape Server in a single process/multithread
mode
it is recommended that you choose one of the following syncronization
methods
for running perl scripts: [1]
  1. Critical sections?
  2. Use no synchronization?

See the INSTALL file for further instructions.  Please contact the
nsapi_perl mailing list (nsapi_perl@samurai.com) in the event of
success/failure.

Good Luck!
Makefile.PL: creating nsapi/xsinit.c
Makefile.PL: creating Netscape/Makefile.PL
Makefile.PL: creating nsapi/Makefile.PL
Writing Makefile for nsapi_perl
Writing Makefile for Netscape::Server
Writing Makefile for nsapi_perl
mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/nsapi_perl
mkdir blib/lib/auto
mkdir blib/lib/auto/nsapi_perl
mkdir blib/man3
cp nsapi_perl.pod blib/lib/nsapi_perl.pod
make[1]: Entering directory
`/export/home/dhaskin/.cpan/build/nsapi_perl-0.24/nsapi'
gcc -c -I/opt/netscape/suitespot/include -I. -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O     -DVERSION=\"0.24\"
-DXS_VERSION=\"0.24\" -fPIC
-I/export/home/dhaskin/perl/lib/5.6.0/sun4-solaris/CORE -DNET_SSL
-DMCC_HTTPD -DPERL_TRACE -DNP_HAVE_CRITICAL -DNP_USE_CRITICAL
-DNP_BOOTSTRAP -DXP_UNIX -D_REENTRANT -DSOLARIS -DSPAPI20 nsapi_perl.c
nsapi_perl.c: In function `nsapi_perl_init':
nsapi_perl.c:161: `na' undeclared (first use in this function)
nsapi_perl.c:161: (Each undeclared identifier is reported only once
nsapi_perl.c:161: for each function it appears in.)
nsapi_perl.c: In function `nsapi_perl_handler':
nsapi_perl.c:211: `sv_count' undeclared (first use in this function)
nsapi_perl.c:211: `sv_objcount' undeclared (first use in this function)
nsapi_perl.c:259: `na' undeclared (first use in this function)
nsapi_perl.c: In function `nsapi_perl_require_module':
nsapi_perl.c:331: `na' undeclared (first use in this function)
nsapi_perl.c: In function `nsapi_perl_eval_ok':
nsapi_perl.c:353: `na' undeclared (first use in this function)
make[1]: *** [nsapi_perl.o] Error 1
make[1]: Leaving directory
`/export/home/dhaskin/.cpan/build/nsapi_perl-0.24/nsapi'
make: *** [subdirs] Error 2
  /usr/local/bin/make  -- NOT OK

---snip---

bash-2.02$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:

  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos heimlich 5.6 generic_105181-16 sun4u sparc sunw,ultra-4

'
    config_args='-Dcc=gcc -Dprefix=/export/home/dhaskin/perl -de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define
    use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.8.1
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lsec
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under solaris
  Compiled at Apr 27 2000 10:44:45
  %ENV:
    PERL5LIB="/export/home/dhaskin/perl/lib"
  @INC:
    /export/home/dhaskin/perl/lib/5.6.0/sun4-solaris
    /export/home/dhaskin/perl/lib/5.6.0
    /export/home/dhaskin/perl/lib
    /export/home/dhaskin/perl/lib/5.6.0/sun4-solaris
    /export/home/dhaskin/perl/lib/5.6.0
    /export/home/dhaskin/perl/lib/site_perl/5.6.0/sun4-solaris
    /export/home/dhaskin/perl/lib/site_perl/5.6.0
    /export/home/dhaskin/perl/lib/site_perl
    .







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

Date: Fri, 28 Apr 2000 17:56:34 GMT
From: Denis Haskin <dwhaskin@earthlink.net>
Subject: Netscape::Server 0.24 (aka nsapi_perl) on Perl 5.6.0?
Message-Id: <3909D07D.ADD10DE7@earthlink.net>

Has anyone built/installed Netscape::Server on Perl 5.6.0?  I'm
attempting to do it on Solaris and getting some problems (see below).
I'll look into it further myself, but I figured if someone has already
been here, I'd like to ride on their coattails.

I sent mail to the "nsapi_perl mailing list" nsapi_perl@samurai.com
(according to  http://people.canoe.ca/bsugars/nsapi_perl.html ) but no
response yet.  According to the page, the module is no longer being
maintained by Ben).

Thanks,

dwh


Here's what I get during make, and below that is a perl -V output.

---snip---

  CPAN.pm: Going to build BSUGARS/nsapi_perl-0.24.tar.gz


Welcome to nsapi_perl.  This program will ask some questions and then
generate Makefiles that will be used to compile the nsapi_perl server
plug in and the Netscape:: perl extensions.

Some questions may have default answers.  If a question has a default
answer, it will be presented between square brackets [ ... ] when the
question is asked.  Just hit <return> to accept the default answer.

Proceed? [y]


Enter your Netscape server's root directory:
/opt/netscape/suitespot/https-mynode

Enter the directory where the NSAPI header files can
be found: []
/opt/netscape/suitespot/include

Enter where you want to install the Netscape plugin and the
nsapi_perl_init.pl start-up script:
[/opt/netscape/suitespot/https-mynode/lib]


Enable nsapi_perl tracing? [y]


If you are running your Netscape Server in a single process/multithread
mode
it is recommended that you choose one of the following syncronization
methods
for running perl scripts: [1]
  1. Critical sections?
  2. Use no synchronization?

See the INSTALL file for further instructions.  Please contact the
nsapi_perl mailing list (nsapi_perl@samurai.com) in the event of
success/failure.

Good Luck!
Makefile.PL: creating nsapi/xsinit.c
Makefile.PL: creating Netscape/Makefile.PL
Makefile.PL: creating nsapi/Makefile.PL
Writing Makefile for nsapi_perl
Writing Makefile for Netscape::Server
Writing Makefile for nsapi_perl
mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/nsapi_perl
mkdir blib/lib/auto
mkdir blib/lib/auto/nsapi_perl
mkdir blib/man3
cp nsapi_perl.pod blib/lib/nsapi_perl.pod
make[1]: Entering directory
`/export/home/<username>/.cpan/build/nsapi_perl-0.24/nsapi'
gcc -c -I/opt/netscape/suitespot/include -I. -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O     -DVERSION=\"0.24\"
-DXS_VERSION=\"0.24\" -fPIC
-I/export/home/<username>/perl/lib/5.6.0/sun4-solaris/CORE -DNET_SSL
-DMCC_HTTPD -DPERL_TRACE -DNP_HAVE_CRITICAL -DNP_USE_CRITICAL
-DNP_BOOTSTRAP -DXP_UNIX -D_REENTRANT -DSOLARIS -DSPAPI20 nsapi_perl.c
nsapi_perl.c: In function `nsapi_perl_init':
nsapi_perl.c:161: `na' undeclared (first use in this function)
nsapi_perl.c:161: (Each undeclared identifier is reported only once
nsapi_perl.c:161: for each function it appears in.)
nsapi_perl.c: In function `nsapi_perl_handler':
nsapi_perl.c:211: `sv_count' undeclared (first use in this function)
nsapi_perl.c:211: `sv_objcount' undeclared (first use in this function)
nsapi_perl.c:259: `na' undeclared (first use in this function)
nsapi_perl.c: In function `nsapi_perl_require_module':
nsapi_perl.c:331: `na' undeclared (first use in this function)
nsapi_perl.c: In function `nsapi_perl_eval_ok':
nsapi_perl.c:353: `na' undeclared (first use in this function)
make[1]: *** [nsapi_perl.o] Error 1
make[1]: Leaving directory
`/export/home/<username>/.cpan/build/nsapi_perl-0.24/nsapi'
make: *** [subdirs] Error 2
  /usr/local/bin/make  -- NOT OK

---snip---

bash-2.02$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:

  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos mynode 5.6 generic_105181-16 sun4u sparc sunw,ultra-4
'
    config_args='-Dcc=gcc -Dprefix=/export/home/<username>/perl -de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define
    use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.8.1
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lsec
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under solaris
  Compiled at Apr 27 2000 10:44:45
  %ENV:
    PERL5LIB="/export/home/<username>/perl/lib"
  @INC:
    /export/home/<username>/perl/lib/5.6.0/sun4-solaris
    /export/home/<username>/perl/lib/5.6.0
    /export/home/<username>/perl/lib
    /export/home/<username>/perl/lib/5.6.0/sun4-solaris
    /export/home/<username>/perl/lib/5.6.0
    /export/home/<username>/perl/lib/site_perl/5.6.0/sun4-solaris
    /export/home/<username>/perl/lib/site_perl/5.6.0
    /export/home/<username>/perl/lib/site_perl
    .







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

Date: 28 Apr 2000 16:26:37 GMT
From: jorgy@Colorado.EDU (Eric R. Jorgensen)
Subject: perl backtic problem with slapd
Message-Id: <8ece3t$7b0$1@peabody.colorado.edu>


Hello,

I'm trying to start up the OpenLDAP slapd server from a perl script:



#!/export/home/jorgy/perlhome/bin/perl
`/usr/local/libexec/slapd -f /usr/local/etc/openldap/slapd.conf`;


For some reason, it starts the server but doesn't background.  If I
kill the resulting slapd, the perl script continues on.  I've tried
various combinations of & to background the process, but nothing seems
to work - even though I believe it should work as-is.

Here are the specifics on my setup:

sun4-solaris, version 2.7
perl 5.6.0 (though the same behavior appears with 5.004_05)
slapd-1.2.7

(I'm also having trouble finding an appropriate newsgroup for
openldap... any pointers?)

Thanks for any help,

Eric




-- 
Eric R. Jorgensen			jorgy@Colorado.EDU
University of Colorado, Boulder		
"A lot of people may not know this, but I'm pretty famous." -- Sam on Cheers


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

Date: 28 Apr 2000 18:00:29 +0100
From: nobull@mail.com
Subject: Re: perl backtic problem with slapd
Message-Id: <u9g0s617pu.fsf@wcl-l.bham.ac.uk>

jorgy@Colorado.EDU (Eric R. Jorgensen) writes:

> `/usr/local/libexec/slapd -f /usr/local/etc/openldap/slapd.conf`;
> 
> For some reason, it starts the server but doesn't background.

Maybe it does but doesn't close its STDOUT.  Not all processess that
fork-off-and-die remember to close STDOUT.

Try system() instead of backticks.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 28 Apr 2000 17:43:46 GMT
From: bbrelin@my-deja.com
Subject: Re: Perl can't find specific XML::DOM package
Message-Id: <8ecike$b2a$1@nnrp1.deja.com>

I actually found the answer to the problem, but now I'm even more
confused...

The answer was to change the DOM.pm line to read

 XML::DOM::DocumentType->new(@_);

from the old:

new XML::DOM::DocumentType(@_);


Is this a 5.6.x artifact?  Does the new version of perl deprecate
the older way of creating an object instance?

Thanks,

Braun Brelin


In article <8eblbq$aa8$1@nnrp1.deja.com>,
  bbrelin@my-deja.com wrote:
> Hello,
>
> I'm creating a perl program using perl5.6.0 on Mandrake Linux 7.0.
>
> The program does the following:
>
> $doctype = $Document->getDoctype;
> .
> .
> .
>
>  $doctype = $tmp->createDocumentType("CIM","cim.dtd");
>
> Document is an instance of a parsed XML file created via the XML::DOM
> module.
>
> This is the error I get...
>
> Undefined subroutine &XML::DOM::DocumentType called at
> /usr/lib/perl5/site_perl/5.6.0/XML/DOM.pm line 3475, <GEN2> line 18.
>
> Yet in looking at the DOM.pm file, there is a package called
> DocumentType.
>
> Anybody have any ideas?
>
> Thanks,
>
> Braun Brelin
> bbrelin@my-deja.com
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 28 Apr 2000 15:10:23 GMT
From: mschilli@perlmeister.com (Mike Schilli)
Subject: Perl Compiler with 5.6.0 - quick fix
Message-Id: <zRhO4.464$XX5.352105@news.pacbell.net>

Hi folks,

the perlcc that comes with 5.6.0 had problems on both my Linux
and my Solaris system -- looks like it couldn't find the DynaLoader,
cause I used to get the following error message even for the simplest
of scripts:

    /tmp/ccF7lsFG.o: In function `xs_init':
    /tmp/ccF7lsFG.o(.text+0x325d): undefined reference to `boot_DynaLoader'
    collect2: ld returned 1 exit status
    ERROR: In compiling code for t.pl.c !

For a quick fix, just put the line

    use DynaLoader;

at line 393 of perlcc, so that it reads 

        ...
        print $fd <<"EOF";
        use DynaLoader;
        use FileHandle;
        my \$fh3  = new FileHandle("> $incfile")
        ...

This at least lets it compile simple Perl scripts into native binaries,
though everything's still very, very experimental.

-- Mike


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

Date: Fri, 28 Apr 2000 15:35:57 GMT
From: xzhu77@my-deja.com
Subject: perl embed perlguts
Message-Id: <8ecb4r$2i9$1@nnrp1.deja.com>

Could some one tell me why my following code has
memory leak?#include <unistd.h>
#include <EXTERN.h>
#include <perl.h>
SV* my_perl_eval_sv(SV *sv, I32 croak_on_error)
{
  dSP;
  SV* retval;
  STRLEN n_a;

  PUSHMARK(SP);
  perl_eval_sv(sv, G_SCALAR);

  SPAGAIN;
  retval = POPs;
  PUTBACK;

  if (croak_on_error && SvTRUE(ERRSV))
     croak(SvPVx(ERRSV, n_a));

  return retval;
}

I32 matches(SV *string, char *pattern, AV
**match_list)
{
  SV *command = NEWSV(1099, 0);
  I32 num_matches;
  STRLEN n_a;

  sv_setpvf(command, "my $string = '%s'; @array =
($string =~ %s)",
           SvPV(string,n_a), pattern);

  my_perl_eval_sv(command, TRUE);
  SvREFCNT_dec(command);

  *match_list = perl_get_av("array", FALSE);
  num_matches = av_len(*match_list) + 1; /**
assume $[ is 0 **/

  return num_matches;
}

main (int argc, char **argv, char **env)
{
  PerlInterpreter *my_perl = perl_alloc();
  char *embedding[] = { "", "-e", "0" };
  perl_construct(my_perl);
  perl_parse(my_perl, NULL, 3, embedding, NULL);
  PL_perl_destruct_level = 1;
  char *str = new char[1000000];
  strcpy(str, "");
  for(int i=0; i<20; i++)
  {
    SV *text = NEWSV(1099,0);
    AV *match_list;
    I32 num_matches;
    STRLEN n_a;
    strcat(str, "aajflsjlaaaal");
    sv_setpv(text, str);
    int intNumberOfMatches = matches(text, "m/
(aaa)/g", &match_list);
    for(int j=0; j<intNumberOfMatches; j++)
      SvPV(*av_fetch(match_list, j, FALSE), n_a);
    SvREFCNT_dec(text);
    av_undef(match_list);
  }
  delete [] str;
  perl_destruct(my_perl);
  perl_free(my_perl);
}



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 28 Apr 2000 15:56:37 GMT
From: Vincent Murphy <Vincent.Murphy@Baltimore.Com>
Subject: Re: perl in NT .BAT files Question + emacs
Message-Id: <xjgaeiefccw.fsf@gamora.us.cybertrust.com>

>>>>> "David" == David Ness <DNess@Home.Com> writes:

<snip>

    David> This has worked fine for a long time, but now that I am processing my
    David> files with a `-w' I get a `used only once' on `@REM'. I can't use the
    David> my() structure to avoid this because, while it works well other places,
    David> here the `@REM' has to be the first thing encountered. I find I can
    David> avoid the diagnostic by including a `@REM=@REM;' as the first line
    David> of executable perl code, but I don't know if that is good practice or if
    David> there is some better way.

When I create a new perl file in emacs I use the perl-mode hook to
create things like Getopt::Long, use strict, usage statement etc -
basically it creates about ninety lines of code that usually you have to
type.  If the file is of the extension .bat the hook will "ntperlize"
the source file.  The only thing you have to be concerned about is the
path issue - It assumes that perl is in your path and you could have
multiple names of the same .bat file - whichever is found first is the
one that is executed.

The ntperlize generated text looks like the following:

@rem = '--*-PERL-*--';
@rem = '
@echo off
rem setlocal
set ARGS=
:loop
if .%1==. goto endloop
set ARGS=%ARGS% %1
shift
goto loop
:endloop
rem ***** This assumes PERL is in the PATH *****
perl.exe -w -S foo.el %ARGS%
goto endofperl
@rem ';

<snip of getopts, use etc. >

__END__
:endofperl
if errorlevel 1 runSomeBogusCommand 2>NUL


;; elisp code - known to work on xemacs 21.2
;;
(defun ntperlize()
  "ntize the perl setup"
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (setq pname (file-name-nondirectory (buffer-file-name)))
    (insert-string "@rem = '--*-PERL-*--';")
    (insert-string "\n@rem = '")
    (insert-string "\n@echo off")
    (insert-string "\nrem setlocal")
    (insert-string "\nset ARGS=")
    (insert-string "\n:loop")
    (insert-string "\nif .%1==. goto endloop")
    (insert-string "\nset ARGS=%ARGS% %1")
    (insert-string "\nshift")
    (insert-string "\ngoto loop")
    (insert-string "\n:endloop")
    (insert-string "\nrem ***** This assumes PERL is in the PATH *****")
    (insert "\nperl.exe -w -S " pname " %ARGS%")
    (insert-string "\ngoto endofperl")
    (insert-string "\n@rem ';\n")
    (goto-char (point-max))
    (insert-string "\n__END__\n")
    (insert-string ":endofperl\n")
    (insert-string "if errorlevel 1 runSomeBogusCommand 2>NUL\n")
    (goto-char (point-min))
    )
  )

    David> Alternatively, is there some better way to handle this whole problem in 
    David> Windows/perl?

YARTUE ( yet another reason to use emacs ) :-)



-Vinny


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

Date: Fri, 28 Apr 2000 17:02:37 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: perl in NT .BAT files Question + emacs
Message-Id: <3909C435.1C554F2D@Home.Com>

Vincent Murphy wrote:
> 
> When I create a new perl file in emacs I use the perl-mode hook to
> create things like Getopt::Long, use strict, usage statement etc -
> basically it creates about ninety lines of code that usually you have to
> type.  If the file is of the extension .bat the hook will "ntperlize"
> the source file.  The only thing you have to be concerned about is the
> path issue - It assumes that perl is in your path and you could have
> multiple names of the same .bat file - whichever is found first is the
> one that is executed.
> 
> The ntperlize generated text looks like the following:
> 

 ...

Thanks for the suggestion. It gives me one more excuse to dig into EMacs
a bit more, and I'm sure I'll learn from that...


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

Date: Fri, 28 Apr 2000 16:22:15 +0100
From: Steve Kemp <skx@tardis.ed.ac.uk>
Subject: Re: perl in NT .BAT files Question
Message-Id: <Pine.GSO.4.10.10004281619110.23817-100000@tardis.tardis.ed.ac.uk>


On Fri, 28 Apr 2000, David Ness wrote:

> Steve Kemp wrote:
> >     perl %PerlFlag% %0 %*

> The problem is pathname and extension. Your suggestion is a worthy try, and I 
> don't know why I never thought of it. However, in context it doesn't work as it 
> would require pathname and extension be typed on the command line, and that is 
> one of the things that it is designed to avoid. AFAIK I'd have to type
> `C:\BIN\MYNAME.BAT Arg1 Arg2 ...' for your suggestion to work.


  Ah, of course that was my mistake.

  What I should hav said is use:

  perl %PerlFlag% %~f0 %*

> stand I type `MYNAME Arg1 Arg2 ...'. PATH lets the system find MYNAME.BAT,
> but %0 only gets `MYNAME' (I think) _not_ `C:\BIN\MYNAME.BAT' and the perl
> command needs to be able to find the file.

  [%~f0 will give the complete path + extension.]
 
> The purpose of the code was precisely to avoid having to maintain two
> files while allowing the flexibility to `do some windows' just prior and
> just post the perl processing. There are some (a few) problems you can solve
> this way that are _very_ hard to handle otherwise, particularly problems that
> involve changing the working environment.

  Well I'm sorry I couldn't really help, but I cannot think of another
 approach.. maybe somebody else can help..


Steve
---
http://GNUSoftware.com/ -- GNU Software for Windows Users
http://steve.org.uk/    -- All about Steve



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

Date: Fri, 28 Apr 2000 16:48:17 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: perl in NT .BAT files Question
Message-Id: <3909C0D8.26476E0F@Home.Com>

Steve Kemp wrote:
> 
>   Ah, of course that was my mistake.
> 
>   What I should hav said is use:
> 
>   perl %PerlFlag% %~f0 %*
> 

I had no idea. This is very nice and it reminds me that I haven't visited
the issue of command line parameters in a very long time now. I will test
to make sure it survives transition to Win98 and Win2K, and if so it seems
to be a direct improvement of what I had been using.

Do you know a straightforward place to find documentation on the `%~fn'
construct?

> 
>   [%~f0 will give the complete path + extension.]
> 
> > The purpose of the code was precisely to avoid having to maintain two
> > files while allowing the flexibility to `do some windows' just prior and
> > just post the perl processing. There are some (a few) problems you can solve
> > this way that are _very_ hard to handle otherwise, particularly problems that
> > involve changing the working environment.
> 
>   Well I'm sorry I couldn't really help, but I cannot think of another
>  approach.. maybe somebody else can help..
> 
> Steve
> ---

You did `really help'. Thanks for taking the time and the trouble.


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

Date: Fri, 28 Apr 2000 17:37:06 GMT
From: swaroop_g@my-deja.com
Subject: Re: Perl POD problem
Message-Id: <8eci80$as4$1@nnrp1.deja.com>

putting
=pod
=cut
works !!

the _END_ statement seemed to confuse the complier.
but i may be missing something.

my problem is solved though,
thanks,
Swaroop.


In article <3908A00E.5EB6A4CB@null.net>,
  Mike Ayers <do.not.mail.me@null.net> wrote:
>
> 	Try:
>
> #
> #   Code at beginning
> #
>
> 1;
>
> __END__
>
> =head1
>
> xyz, etc.
>
> 	...but what you probablly want is just...
>
> >  require "a.pl"
> >
> >  pod documentation embedded at end
> >  of prog.pl.
> >
> =pod
>
> >  =head1
> >
> >   xyz ...etc
> >
>
> 	where the "=pod" directive tells the interpreter "ignore
everything
> between me and  the =cut directive.  That should clear you up.
>
> 	HTH,
>
> /|/|ike
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 28 Apr 2000 11:50:43 -0500
From: "c d" <cedelis@uillinois.edu>
Subject: perl v5.6.0 install and the "otherlibdirs" variable
Message-Id: <bijO4.12388$nb2.258253@vixen.cso.uiuc.edu>

has anyone set this variable during an install (and have gotten it to work
correctly)?

i would like to permanently add a path to the @INC variable and thought this
was a way i could do it.

i am building perl from source.

any help would be greatly appreciated!   thanks!

please send a CC: to chris@delis.net




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

Date: Fri, 28 Apr 2000 10:27:42 -0700
From: Salvador Peralta <admin@salvador.venice.ca.us>
Subject: Problem w/Net::NNTP
Message-Id: <3909CA0E.1AD6FE4A@salvador.venice.ca.us>

Below is a simple script to test Net::NNTP on my system.  When I call
it, I get a "Use of uninitialized value at ./nntp.pl line 7."  The
syntax looks correct, and the module is correctly installed.  Can anyone
see the problem?

Much appreciated, 

Salvador Peralta
admin@salvador.venice.ca.us
http://www.la-online.com

--
#!/usr/bin/perl -w

use Net::NNTP;
$data = "/path/to/data/news.txt";

my $nntp = Net::NNTP->new('news01.buzzardnews.com');
my @articles = @{$nntp->newnews(time - 3600,'la.jobs')};
open (NEWS, "> $data");
foreach my $article (@articles) {
      print NEWS "Article $article:\n";
      print NEWS @{$nntp->article($article)};
  };
close NEWS;


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

Date: Fri, 28 Apr 2000 10:57:52 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Problem w/Net::NNTP
Message-Id: <Pine.GSO.4.10.10004281056400.21722-100000@user2.teleport.com>

On Fri, 28 Apr 2000, Salvador Peralta wrote:

> Newsgroups: comp.lang.perl.misc
> Subject: Problem w/Net::NNTP

You already posted this (multiple times, with variations!) in
comp.lang.perl.modules. Please learn to crosspost, to post properly, and
to read news.announce.newusers. Thank you.

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



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

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


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