[15518] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2928 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 2 21:06:25 2000

Date: Tue, 2 May 2000 18:05:14 -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: <957315914-v9-i2928@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 2 May 2000     Volume: 9 Number: 2928

Today's topics:
    Re: Ah the missing ~ thanks guys <dburch@teleport.com>
    Re: Aliases for Perl Operators? <rootbeer@redcat.com>
    Re: bourne 'dot' or csh 'source behavior <andrew.mcguire@walgreens.com>
    Re: bourne 'dot' or csh 'source behavior <uri@sysarch.com>
    Re: Can anyone recommend a good book (Jon S.)
    Re: Can I undef a whole namespace like undef $Z::temp? <rootbeer@redcat.com>
    Re: capture HTML!! <makarand_kulkarni@My-Deja.com>
    Re: Clear and then Reuse a package name space <rootbeer@redcat.com>
    Re: DB_File Question <makarand_kulkarni@My-Deja.com>
    Re: Directory spaces causing problems? <rootbeer@redcat.com>
        disabling keyboard echo during password entry (Doug Floer)
    Re: disabling keyboard echo during password entry <lauren_smith13@hotmail.com>
    Re: disabling keyboard echo during password entry <lr@hpl.hp.com>
        Failure Installing Perl 5.6.0 on NCR UNIX MP-RAS 3.02 <douglas.hendricksNOdoSPAM@telecom.co.nz.invalid>
    Re: Failure Installing Perl 5.6.0 on NCR UNIX MP-RAS 3. <douglas.hendricksNOdoSPAM@telecom.co.nz.invalid>
    Re: Failure Installing Perl 5.6.0 on NCR UNIX MP-RAS 3. <douglas.hendricksNOdoSPAM@telecom.co.nz.invalid>
    Re: Global Destruction Messages <rootbeer@redcat.com>
    Re: global variable with perl-cgi scripts ? <tina@streetmail.com>
    Re: How to define my own Perl Operator? <rootbeer@redcat.com>
    Re: If slices are so great... <perin@panix.com>
    Re: If slices are so great... <uri@sysarch.com>
    Re: is there sendmail on Win32 platform <danevans@wanadoo.es>
    Re: perl on Windows 32 <dburch@teleport.com>
        PerlIs config with IIS 4 mmccarn@my-deja.com
    Re: PerlIs config with IIS 4 <rootbeer@redcat.com>
    Re: printing to a jetdirect device from perl -- help <rootbeer@redcat.com>
    Re: Problem with local installation of a module <rootbeer@redcat.com>
    Re: PS <dburch@teleport.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 02 May 2000 15:06:28 -0700
From: Dan Burch <dburch@teleport.com>
Subject: Re: Ah the missing ~ thanks guys
Message-Id: <390F5164.CEF083EB@teleport.com>



Dan Burch wrote:

> This is probably an easy one, but I'm new to Perl and I'm having a hard
> time figuring this. I have a txt file with line that contain QTY SOLD
> and then space delimited fields with monthly totals that I can split on.
> The problem is commas in numbers over 1000 like 1,000.  If I just try to
> add up the fields it works for numbers under 1000, but gives a zero
> value for numbers with the comma.  This is what I'm trying:
>
>         elsif (  "$data_line[1]" =~ /QTY SOLD/  )
>         {
>
>          local $year_total = ($data_line[2] +$data_line[3]
> +$data_line[4] +$data_line[5] +$data_line[6] +$data_line[7]
> +$data_line[8] );
>
>                 print DATA_OUT "$year_total,";
>         }
>
> I tried :
>
>   foreach $data_line ( @data_line )
> {
>     $data_line = s/,//;
> }
>
> ahead of getting the total but that doesn't seem to work.
>
> Any Suggestions would be greatly appreciated.
>
> Best Regards
> Dan Burch



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

Date: Tue, 2 May 2000 17:06:14 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Aliases for Perl Operators?
Message-Id: <Pine.GSO.4.10.10005021705130.13677-100000@user2.teleport.com>

On Tue, 2 May 2000, k wrote:

> Is it possible to assign an "Alias" to an existing Perl Operator?

As far as I know, no. But I suppose you could do something with source
filters and preprocessing, if you're really tricky. Cheers!

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



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

Date: Tue, 02 May 2000 17:11:10 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: bourne 'dot' or csh 'source behavior
Message-Id: <390F527E.B266001A@walgreens.com>

Tom Phoenix wrote:
> 
> On 2 May 2000 shutchis@sherritt-NO_SPAM_PLEASEintl.com wrote:
> 
> > I have some scripts to run non-interactively (cron) and need to
> > establish a specific environment. Under sh|ksh I would '. <file>'; in
> > csh 'source <file>'. How to get the same behaviour within perl?
> >
> > Unfortunately, the <file> in question is vendor supplied, ruling out a
> > perl re-write.

[ snip ]
 
> One way would be to make a shell script which sources that file, then
> prints the current working directory, the values of all environment
> variables, and any other pertinent settings. Run that from perl via
> backticks and parse its output.

   Actually, oddly enough I had to do this today as well.
Here is what I came up with, hopefully it will be satisfactory.
This may not be the best way to do it, but it worked for me,
so any improvements/critisisms are welcome.

#!/usr/bin/perl -w

use strict;

my $config = "/path/to/some/config/file";
%ENV = ();
my @shenv = `sh -c ". $config; /usr/bin/env"`;
chomp @shenv;
%ENV = map { split /=/ } @shenv;

print map { "$_ => $ENV{$_}\n" } keys %ENV;

Regards,

anm
-- 
Andrew N. McGuire
andrew.mcguire@walgreens.com
perl -ne '/=item \* (.*?\?)/ && push @x,$1}{print "$x[rand @x]\n"' *.pod


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

Date: Tue, 02 May 2000 23:04:23 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: bourne 'dot' or csh 'source behavior
Message-Id: <x7itwwy2o9.fsf@home.sysarch.com>

>>>>> "ANM" == Andrew N McGuire <andrew.mcguire@walgreens.com> writes:


  ANM> my $config = "/path/to/some/config/file";
  ANM> %ENV = ();
  ANM> my @shenv = `sh -c ". $config; /usr/bin/env"`;
  ANM> chomp @shenv;
  ANM> %ENV = map { split /=/ } @shenv;

not a bad solution. do you really want this to set the entire ENV
including stuff set before the perl script started and stuff set by perl?
if not, then set another hash first %SH_ENV the way you do with %ENV and
then you can decide whether those values override the existing %ENV or
not.

shell overrides:

%ENV = ( %ENV, %SH_ENV ) ;

or

@ENV{ keys %SH_ENV } = values %SH_ENV ;

%ENV overrides:

%ENV = ( %SH_ENV, %ENV ) ;

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Tue, 02 May 2000 22:22:30 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: Can anyone recommend a good book
Message-Id: <390f55e2.28542518@news.earthlink.net>

On Wed, 26 Apr 2000 10:31:58 +0100, "Mark Rendle" <rendle@clara.co.uk>
wrote:

>I'm completely new to perl, never seen it before, but I've been programming
>for over 10 years, used Unix ksh, still remember some awk, more recently
>been using VC++ and VB, HTML and Javascript, need to learn CGI/Perl in a
>hurry. Can somebody recommend the best book to go from knowing nothing of
>perl to competent CGI scripting in about a week? Looked on amazon.co.uk but
>the reviews contradict each other horribly...
>
>Thanks in advance,

Mark, 

In addition to the straight Perl books, you might also browse the
CGI.pm books and "complete" HTML style books at your local computer
book store.  The O'Reilly Perl books get you started great and teach
you Perl great, but for this newbie, they are a little short on
specifics for web use.  CGI.pm will probably be used by you a lot as
well as the various DBI interfaces.

Jon


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

Date: Tue, 2 May 2000 17:15:05 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Can I undef a whole namespace like undef $Z::temp?
Message-Id: <Pine.GSO.4.10.10005021708430.13677-100000@user2.teleport.com>

On Tue, 2 May 2000 blah2163216536126712@my-deja.com wrote:

> Subject: Can I undef a whole namespace like undef $Z::temp?

Well, not exactly like that, but you can scrub an entire namespace if you
really need to. See whether your copy of perlfaq7 has an entry on "How do
I clear a package?".

>  $r->import_names('Q');

> # now I'd like to get rid of the whole namespace Q
> because if user 'a' fills out the entire form but
> user 'b' leaves some of the fields blank then some
> of users 'a' stuff while get mixed up in users 'b'
> stuff.

I don't think that's the easy way to do this. But if you really need this,
you could make up a new namespace for each new user. The first time you
call import_names, pass it "Q1". The second time, "Q2". And so on.

But I think you're doing something the hard way. Don't import the names;
use the param() function and its friends instead. Good luck with it!

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



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

Date: Tue, 02 May 2000 16:42:28 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: capture HTML!!
Message-Id: <390F67E4.49B35670@My-Deja.com>

>  I would like to add a print feature on it whereby a
> user can print the current contents.

adding print capability is very easy using Javascript ( window.print () function
).

>  However I'm not sure how to send the
> content of the current HTML page.

If you still want to do it the hard way the parser script
can use LWP::UserAgent to get the HTML content
of the CGI script that generates the dynamic HTML.

check

perldoc LWP::UserAgent
perldoc HTTP::Request

--



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

Date: Tue, 2 May 2000 16:33:16 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Clear and then Reuse a package name space
Message-Id: <Pine.GSO.4.10.10005021631461.13677-100000@user2.teleport.com>

On Tue, 2 May 2000 richard_chen@my-deja.com wrote:

> in some cases a perl process may have to reuse the same package name
> space many times.

Can you give an example of this? Perhaps there is a better way to do
whatever you're trying to do. In fact, I'm almost completely certain that
there is. :-)

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



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

Date: Tue, 02 May 2000 16:15:35 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: DB_File Question
Message-Id: <390F6197.F6350046@My-Deja.com>

>     tie (%SN, 'DB_File', "$lbPortfolio/$jobid", O-RDWR, 0777)

O-RDWR is not a valid opening mode.
You should use O_RDWR instead.

> single entry from the deletion.");
>     foreach $key(keys %SN) {
>         print "$key and $LB{$key}<br>\n";

 ..............what is %LB here. It was not tied to anything.

> untie %LB;

What is LB ?


See this working example that creates a new DB_File vvv
and stores a new value for the key 'scott' each time
it is run

#!/usr/local/bin/perl5 -w
use DB_File ;
 tie (%SN, 'DB_File', "vvv",O_CREAT|O_RDWR, 0777) or die "Houston, we have a
problem..";
    $SN{'scott'} = 'perl5-'.  time(); # insert the new dittie
foreach $key(keys %SN) {
        print "$key and $SN{$key}<br>\n";
    }
untie %SN;



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

Date: Tue, 2 May 2000 16:48:11 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Directory spaces causing problems?
Message-Id: <Pine.GSO.4.10.10005021647110.13677-100000@user2.teleport.com>

On Tue, 2 May 2000, Tina Mueller wrote:

> maybe you have to put in a backslash to escape the
> whitespace:
> $file = "School\ Trips";

There's no backslash in that string; see the perlop manpage for more
information. Cheers!

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



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

Date: Tue, 02 May 2000 22:27:15 GMT
From: dfloer@topsoft.bc.ca (Doug Floer)
Subject: disabling keyboard echo during password entry
Message-Id: <390f55a0.22770500@news.dccnet.com>

I'd like to disable character display (echo) in a Perl script while a
password is entered via the keyboard.  I'm using Perl 5 on an NT 4.0
workstation so I'm looking for the Perl NT equivalent to UNIX "stty
-echo".  Can anyone help?

thanks
doug


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

Date: Tue, 2 May 2000 15:39:55 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: disabling keyboard echo during password entry
Message-Id: <8enlf3$tl5$1@brokaw.wa.com>


Doug Floer <dfloer@topsoft.bc.ca> wrote in message
news:390f55a0.22770500@news.dccnet.com...
> I'd like to disable character display (echo) in a Perl script while a
> password is entered via the keyboard.  I'm using Perl 5 on an NT 4.0
> workstation so I'm looking for the Perl NT equivalent to UNIX "stty
> -echo".  Can anyone help?

perlfaq8: How do I ask the user for a password?

Lauren




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

Date: Tue, 2 May 2000 16:06:46 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: disabling keyboard echo during password entry
Message-Id: <MPG.1378ff602934d4ca98a9d0@nntp.hpl.hp.com>

In article <390f55a0.22770500@news.dccnet.com> on Tue, 02 May 2000 
22:27:15 GMT, Doug Floer <dfloer@topsoft.bc.ca> says...
> I'd like to disable character display (echo) in a Perl script while a
> password is entered via the keyboard.  I'm using Perl 5 on an NT 4.0
> workstation so I'm looking for the Perl NT equivalent to UNIX "stty
> -echo".  Can anyone help?

perldoc -q password

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 02 May 2000 16:02:29 -0700
From: The Reverend Dharma Roadkill <douglas.hendricksNOdoSPAM@telecom.co.nz.invalid>
Subject: Failure Installing Perl 5.6.0 on NCR UNIX MP-RAS 3.02
Message-Id: <01303ce6.1145206d@usw-ex0102-084.remarq.com>



Failure Installing Perl 5.6.0 on NCR UNIX MP-RAS 3.02


OK, I've tried all sorts of things, such as running with all of
the svr4 defaults,
running with NCR's make, running with GNU make and a new PATH.
All of the fatal errors
occur when making Dynaloader, and seem to involve a missing
basename (references to
not finding .y or .o)

I've been contacted by a guy in NCR who says that he can't get
Perl 5.6.0 to compile
either, with similar errors.  I've had Perl as recent as
5.005_03 install without
any issues (other than manually setting LD_LIBRARY_PATH and -
Uusenm, both of which
seem to be done by default now on NCR).


I'm willing to try again every few days but does anybody have
suggestions?


The tail of the make output file when using GNU make (similar
errors for NCR make):


        Making DynaLoader (static)
make[1]: Entering directory `/home/dzhw/perl/perl-
5.6.0/ext/DynaLoader'
Makefile out-of-date with respect
to ../../lib/Config.pm ../../config.h
Cleaning current config before rebuilding Makefile...
make -f Makefile.old clean > /dev/null 2>&1 || /bin/sh -c true
 ./../miniperl "-I../../lib" "-I../../lib"
Makefile.PL "INSTALLDIRS=perl" "LIBPE
RL_A=libperl.so"
Writing Makefile for DynaLoader
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command.  <==
false
make[1]: *** [Makefile] Error 255
make[1]: Leaving directory `/home/dzhw/perl/perl-
5.6.0/ext/DynaLoader'
make config failed, continuing anyway...
make[1]: Entering directory `/home/dzhw/perl/perl-
5.6.0/ext/DynaLoader'
 ./../miniperl -I../../lib -I../../lib -I../../lib -I../../lib
DynaLoader_pm.PL
DynaLoader.pm
 ./../miniperl -I../../lib -I../../lib -I../../lib -I../../lib
XSLoader_pm.PL XS
Loader.pm
Skip ../../lib/XSLoader.pm (unchanged)
Skip ../../lib/DynaLoader.pm (unchanged)
/bin/cc -L/usr/ccs/lib -L/usr/ucblib -
L/usr/gnu/lib  ../../EXTERN.h ../../INTERN
h ../../XSUB.h ../../av.h ../../cc_runtime.h ../../config.h ../.
/cop.h ../../c
v.h ../../dosish.h ../../embed.h ../../embedvar.h ../../fakethr.h
 ../../form.h .
/../gv.h ../../handy.h ../../hv.h ../../intrpvar.h ../../iperlsy
s.h ../../keywo
rds.h ../../mg.h ../../nostdio.h ../../objXSUB.h ../../op.h ../..
/opcode.h ../..
/opnames.h ../../patchlevel.h ../../perl.h ../../perlapi.h ../../
perlio.h ../../
perlsdio.h ../../perlsfio.h ../../perlvars.h ../../perly.h ../../
pp.h ../../pp_p
roto.h ../../proto.h ../../regcomp.h ../../regexp.h ../../regnode
s.h ../../scope
h ../../sv.h ../../thrdvar.h ../../thread.h ../../unixish.h ../.
/utf8.h ../../
util.h ../../warnings.h Makefile   -o .o
UX:ld: ERROR: ../../EXTERN.h: fatal error: file type neither
object nor archive
make[1]: *** [.o] Error 1
make[1]: Leaving directory `/home/dzhw/perl/perl-
5.6.0/ext/DynaLoader'
make: *** [lib/auto/DynaLoader/DynaLoader.a] Error 2


running make again gives (lot of stuff preceding editted out):


        Making DynaLoader (static)

make: fatal error: don't know how to make .y (bu42).
*** Error code 1 (bu21)

make: fatal error.




/myconfig gives:


Summary of my perl5 (revision 5.0 version 6 subversion 0)
configuration:
  Platform:
    osname=svr4.0, osvers=3.0, archname=3446A-svr4.0
    uname='tnzi4380 tnzi4380 4.0 3.0 3446a pentium pro(tm)-
eisapci '
    config_args='-des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=unde
f
    useperlio=undef d_sfio=undef uselargefiles=define
    use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
  Compiler:
    cc='/bin/cc', optimize='-O', gccversion=
    cppflags='-I/usr/include -I/usr/ucbinclude'
    ccflags ='-I/usr/include -I/usr/ucbinclude'
    stdchar='unsigned char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize
=4
    alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='/bin/cc', ldflags ='-L/usr/ccs/lib -L/usr/ucblib -
L/usr/gnu/lib'
    libpth=/usr/gnu/lib /lib /usr/lib /usr/ccs/lib /usr/ucblib
    libs=-lsocket -lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lucb -lx
    libc=, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/ccs/lib -
L/usr/ucblib -L/usr/gnu/li
b'



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 02 May 2000 16:12:52 -0700
From: The Reverend Dharma Roadkill <douglas.hendricksNOdoSPAM@telecom.co.nz.invalid>
Subject: Re: Failure Installing Perl 5.6.0 on NCR UNIX MP-RAS 3.02
Message-Id: <03095310.1389e748@usw-ex0102-084.remarq.com>


I note that Remarq (which is how I'm getting to the usenet) is
putting spaces after hyphens.



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 02 May 2000 17:23:04 -0700
From: The Reverend Dharma Roadkill <douglas.hendricksNOdoSPAM@telecom.co.nz.invalid>
Subject: Re: Failure Installing Perl 5.6.0 on NCR UNIX MP-RAS 3.02
Message-Id: <019e4be0.22e66058@usw-ex0102-084.remarq.com>



I've just discovered that down in the Dynaloader Makefile the
make variable

BASEEXT


is never set, which might explain why make keeps looking for
files like ".o" or ".y"


How do I fix that?  Is this a problem in whatever calls
MakeMaker?




* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 2 May 2000 17:38:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Global Destruction Messages
Message-Id: <Pine.GSO.4.10.10005021734260.13677-100000@user2.teleport.com>

On Tue, 2 May 2000, Bob Walton wrote:

>      Attempt to free unreferenced scalar during global destruction.

>      Can't upgrade that kind of scalar during global destruction.

These are (almost) always the result in bugs in some compiled code -
either in Perl itself, or in a compiled extension (like Tk). They should
never happen from user-level code.

> Any ideas what these mean, and whether they are important?

They're important, but probably not to you. :-)  I don't _think_ you
should worry about them too much. You can probably get rid of them by
installing a new version of _something_, but it can generally be tough to
determine which something that is. :-P

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




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

Date: Tue, 02 May 2000 18:05:23 -0400
From: Tina Mueller <tina@streetmail.com>
Subject: Re: global variable with perl-cgi scripts ?
Message-Id: <8enjf2$9ebfv$1@fu-berlin.de>

hi,

Ed Bras wrote:
> 
> Helllu, can someone tell me a good way to define your global variables, such
> that they still exists when the perl-cgi-script is called again ? (without
> using any perl-apache module).
> 
> For example would it be possible to include a package with variables
> defined, such that the variables in the packet still exist after the script
> finish running ?

just store the values in a file.
you can easily do that with the
Tie modules, such as Tie::Hash for example.

tina

-- 
        tinamue@gmx.net             |     _   enter the
http://user.berlin.de/~tina.mueller |  __| |___  ___ _ _ ___
--   new: tina's moviedatabase    --| / _` / _ \/ _ \ '_(_-< of
--search & add comments or reviews--| \__,_\___/\___/_| /__/ perception


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

Date: Tue, 2 May 2000 17:04:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to define my own Perl Operator?
Message-Id: <Pine.GSO.4.10.10005021702120.13677-100000@user2.teleport.com>

On Tue, 2 May 2000, k wrote:

> I would like to create an "in" operator which would test if a value is
> in an array.

I can see why you might want this. 

> Is it possible to do this sort of thing without hacking the perl core?

As far as I know, no. But why don't you want to hack the core? :-)

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



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

Date: 02 May 2000 19:23:38 -0400
From: Lewis Perin <perin@panix.com>
To: Quantum Mechanic <quantum_mechanic@my-deja.com>
Subject: Re: If slices are so great...
Message-Id: <pc766swfsed.fsf@panix6.panix.com>

Quantum Mechanic <quantum_mechanic@my-deja.com> writes:

> If slices are so great, why aren't there more references to them in
> the indices of the basic Perl books?
> [...]
> I wanted something like:
> 
>    @keep = split( /,/, $string )[2..-1]
> 
> but this of course doesn't DWYW. Is there another way besides a
> temporary variable?

A list slice does appear to work if you rearrange the parentheses
*and* forgo the -1 locution:

  bash-2.03$ perl -le '$s = "a,b,c,d";@k = (split /,/, $s)[1..2];print @k'
  bc

/Lew
-- 
Lew Perin / perin@mail.med.cornell.edu / perin@acm.org
www.panix.com/~perin/


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

Date: Tue, 02 May 2000 23:29:59 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: If slices are so great...
Message-Id: <x7g0s0y1hm.fsf@home.sysarch.com>

>>>>> "LP" == Lewis Perin <perin@panix.com> writes:

  LP> Quantum Mechanic <quantum_mechanic@my-deja.com> writes:

  >> @keep = split( /,/, $string )[2..-1]

  LP> A list slice does appear to work if you rearrange the parentheses
  LP> *and* forgo the -1 locution:

  LP>   bash-2.03$ perl -le '$s = "a,b,c,d";@k = (split /,/, $s)[1..2];print @k'

you are missing the whole point. he wants the the slice of elements
AFTER the first 2. and you don't know the length of the list in advance.

we all know you can do list slices but you can't count from the end like
he wants. in other languages where the syntax for list slices is builtin
you can do things like that. perl only supports a list of indices for a
slice and you can generate that list anyway you want but you can't get
the number of elements of the list in that expression.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 03 May 2000 00:45:03 GMT
From: "Dan Evans" <danevans@wanadoo.es>
Subject: Re: is there sendmail on Win32 platform
Message-Id: <jEKP4.2918$jv3.291638@m2newsread.uni2.es>


Tintin <you.will.always.find.him.in.the.kitchen@parties> wrote in message
news:957267724.509857@shelley.paradise.net.nz...
>
> "Dan Evans" <danevans@wanadoo.es> wrote in message news:5VlP4.2343
> > > How is your script calling blat?  Remember that blat ne sendmail.
They
> > have
> > > totally different flags and perform different functions.
> >
> > With:
> >
> >  Response.Redirect("pathto/cgi-bin/mail.cgi")
> >
> > from an ASP page after it has updated the database. The bit I am trying
to
> > send is just a confirmation e-mail, that notifies the webmaster that a
new
> > user has registered, so its the same message to the same address each
> time,
> > I don't need to pass any variables. $DEITY knows why the host haven't
> > installed CDONTS support, given that its an NT server running IIS.
>
> You've posted how your ASP page calls the CGI script.  The line/s in
> mail.cgi is the relevant stuff that you need to post.

DUH! yeah, misread the question, sorry. Anyway, I have got it sorted out
now, using

open BLAT, "|blat server/path/file.txt -t dan\@munged.com -s \"subject\"";

    close BLAT;

Thanks for taking the time to help me. It's appreciated. :0)

Now to sort out some misbehaving Clipper for tomorrow :0(

Dan




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

Date: Tue, 02 May 2000 16:38:49 -0700
From: Dan Burch <dburch@teleport.com>
Subject: Re: perl on Windows 32
Message-Id: <390F6709.EBCA6B71@teleport.com>



David Featley wrote:

> I am trying to run perl scripts via an apache web server on my local PC
> running windows 98 for local testing. I appear to be unable to get the
> script to output to my browser. All output is coming out in a dos text
> window.
>
> The simple script I am executing is:
>
> #!c:\perl\bin\perl.exe

#!c:\perl\bin\perl  no .exe needed
Also if you put "SET PATH=C:\Perl\bin\perl"  in your autoexec.bat file and
then restart you can just use #!perl

>
> print "Content-type:text/html", "\n\n";
> print "hello world";
>
> I have active perl installed but have been reading that to run under
> win32 I need to recompile from the source, I have also seen from various
> other posts that people are successfully running on Windows using
> "mod_perl", is this what the recompiled perl is referred to as? is this
> "recompiled" source available for download anywhere?
>
> Any help would be greatly appreciated.
>
> Thanks
>
> David



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

Date: Wed, 03 May 2000 00:15:02 GMT
From: mmccarn@my-deja.com
Subject: PerlIs config with IIS 4
Message-Id: <8enr1q$b5r$1@nnrp1.deja.com>

Hello everyone,

I am using PerlIs.dll with IIS 4 to process my
PERL scripts. In some SSI pages I include the
PERL output like this:
<!--#exec cgi="foo.plx"-->

Using PerlIs, the header info is included. If I
map .plx to perl.exe it is not included. Is there
someway to use the PerlIs and not have the header
info show up? I'd like to get the performance
advantage out of the Isapi, but can't do it if
the header info shows up like it is.

Thanks,
Mike


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


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

Date: Tue, 2 May 2000 17:42:34 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: PerlIs config with IIS 4
Message-Id: <Pine.GSO.4.10.10005021741530.13677-100000@user2.teleport.com>

On Wed, 3 May 2000 mmccarn@my-deja.com wrote:

> Is there someway to use the PerlIs and not have the header info show
> up?

It sounds as if you want to search for the docs, FAQs, and newsgroups
about webservers in general and your webserver in particular. Good luck
with it!

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



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

Date: Tue, 2 May 2000 17:08:07 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: printing to a jetdirect device from perl -- help
Message-Id: <Pine.GSO.4.10.10005021706460.13677-100000@user2.teleport.com>

On Tue, 2 May 2000, Aaron wrote:

> Can someone give me an example of how to print to a jetdirect device?

You'll almost certainly need to find out what protocol the device desires
that you use when you speak to it. Once you do, though, there are modules
on CPAN for many common protocols, or you can make your own. You may wish
to search for the docs, FAQs, and newsgroups about your hardware. Cheers!

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



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

Date: Tue, 2 May 2000 17:41:21 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Problem with local installation of a module
Message-Id: <Pine.GSO.4.10.10005021738560.13677-100000@user2.teleport.com>

On Tue, 2 May 2000, Christian Mahnke wrote:

> I tried to install the Mysql-Driver locally. I used this command:
> 
> perl Makefile.PL PREFIX=/usr/local/httpd/cgi-bin/modules

> and tells me that DBI was not found in @INC.

I'm not completely sure what the problem is, but I think you want to set
your PERL5LIB environment variable to include that path. (Still, that
should probably be taken care of automatically when you run Makefile.PL
like that.) Does that fix anything? Good luck with it.

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



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

Date: Tue, 02 May 2000 16:42:44 -0700
From: Dan Burch <dburch@teleport.com>
Subject: Re: PS
Message-Id: <390F67F4.F6733A2E@teleport.com>



Dan Burch wrote:

> David Featley wrote:
>
> > I am trying to run perl scripts via an apache web server on my local PC
> > running windows 98 for local testing. I appear to be unable to get the
> > script to output to my browser. All output is coming out in a dos text
> > window.
> >
> > The simple script I am executing is:
> >
> > #!c:\perl\bin\perl.exe
>

> #!c:\perl\bin\perl  no .exe needed
> Also if you put "SET PATH=C:\Perl\bin\perl"  in your autoexec.bat file and
> then restart you can just use #!perl
>

You must  have a blank line after the #! line.


> >
> > print "Content-type:text/html", "\n\n";
> > print "hello world";
> >
> > I have active perl installed but have been reading that to run under
> > win32 I need to recompile from the source, I have also seen from various
> > other posts that people are successfully running on Windows using
> > "mod_perl", is this what the recompiled perl is referred to as? is this
> > "recompiled" source available for download anywhere?
> >
> > Any help would be greatly appreciated.
> >
> > Thanks
> >
> > David



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

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


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