[17881] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 41 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 11 18:05:51 2001

Date: Thu, 11 Jan 2001 15:05:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979254321-v10-i41@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 11 Jan 2001     Volume: 10 Number: 41

Today's topics:
    Re: 'Make test' fails <doug@cc.ysu.edu>
    Re: A RegEx question <Kien_Ha@Mitel.COM>
    Re: A RegEx question <merl@softhome.net>
    Re: Any good Perl books? <henryhartley@westat.com>
        Apply XPath expression to XML::DOM <bjoern@hoehrmann.de>
    Re: are there sites with Perl Advocacy examples? (David H. Adler)
    Re: are there sites with Perl Advocacy examples? (Maggert)
        Background reminder process and server reboots phild@sancerre.demon.co.uk
    Re: Background reminder process and server reboots gungeek@my-deja.com
        can I chdir(DIRHANDLE)? (LMC)
    Re: can I chdir(DIRHANDLE)? (LMC)
        Client pull from intranet server via ISP server - HELP! <kj@royroy.fsnet.co.uk>
        CPAN license? (Jacek =?iso-8859-2?Q?Pop=B3awski?=)
        Deleting PDF pages mrapropos@hotmail.com
    Re: Dir dots in readdir and Win (Tad McClellan)
    Re: Finding ranges in a list of integers (Craig Berry)
        How to get STDERR from system? <prlawrence@lehigh.edu>
        HTTP::Request encoding query iain_hogg@my-deja.com
    Re: Jobs: Senior Software Engineer <brannon@lnc.usc.edu>
    Re: left op of && and || only in scalar context ? <stephen@twocats.dont-spam.demon.co.uk>
        MacPerl news groups <markp@mail1.jpl.nasa.gov>
    Re: MacPerl news groups <bart.lateur@skynet.be>
        Newbie - simple search <vertical.reality@ntlworld.com>
    Re: Newbie - simple search <vertical.reality@ntlworld.com>
        OT: .htpasswd on Win32 build <oktay@torontonian.com>
        pattern as a sentence in pattern matching <yhu@mail.nih.gov>
        perl as a login shell wroot@my-deja.com
    Re: perl as a login shell (Chris Fedde)
    Re: perl as a login shell <brannon@lnc.usc.edu>
    Re: Perl idioms for converting string into list of char <ansel@babylon.dyndns.org>
    Re: Perl idioms for converting string into list of char <ren.maddox@tivoli.com>
    Re: Perl idioms for converting string into list of char <uri@sysarch.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 11 Jan 2001 22:44:14 GMT
From: Doug S <doug@cc.ysu.edu>
Subject: Re: 'Make test' fails
Message-Id: <93lcvu$kep$1@news.ysu.edu>

Perl 5.6.0, AIX 4.2.1 on an RS6000 590. Configure ran fine, make
did too. 

52 tests failed - most 'FAILED at test 0' and core-dumped.

"./perl -cw harness" fails with a core dump, too... so I assume
something is drastically pooched.

What should I be looking at ? Looking at a stack trace was greek.

config.sh is at http://cc.ysu.edu/~doug/config.sh.txt
Policy.sh is at http://cc.ysu.edu/~doug/Policy.sh.txt

Tests that failed on 'test 0' were:

io/openpid op/defins op/glob op/goto_xs op/readdir op/taint pragma/locale
pragma/strict pragma/warnings lib/anydbm lib/attrs lib/db-btree lib/db-hash
lib/db-recno lib/dirhand lib/dprof lib/dumper-ovl lib/dumper lib/filehand
lib/glob-basic lib/glob-case lib/glob-global lib/glob-taint lib/hostname
lib/io_const lib/io_dir lib/io_dup lib/io_linenum lib/io_multihomed
lib/io_pipe lib/io_poll lib/io_sock lib/io_taint lib/io_tell lib/io_udp
lib/io_unix lib/io_xs lib/ipc_sysv lib/ndbm lib/odbm lib/opcode lib/open2
lib/open3 lib/ops lib/ph lib/posix lib/safe1 lib/safe2 lib/sdbm lib/socket

(besides that, op/lex_assign failed on 14 and lib/filecopy on test 6)

Doug
-- 
Doug S. (doug@cc.ysu.edu) (http://cc.ysu.edu/~doug/)

The shadow of a dog never bit anyone -- Kenneth Copeland
Stamp out html e-mails: http://www.geocities.com/CapitolHill/1236/nomime.html


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

Date: Thu, 11 Jan 2001 19:19:32 GMT
From: Kien Ha <Kien_Ha@Mitel.COM>
Subject: Re: A RegEx question
Message-Id: <3A5E071B.5B3F7D67@Mitel.COM>

Vladimir Georgiev wrote:
> 
> I have a string like: "ShowPic('01.jpg',281,41)" which is a part of a
> Javascript.
> I wanted to increase the two numbers by 10 and tried the following code:
> 
> $a =~ s/(ShowPic\('\d{1,3}\.jpg',)(\d{2,4}),(\d{2,4})\)/$1,$2+10,$3+10)/;
> 
> but the output was:
> (...,281+10,41+10)
> and not (...,291,51) as I expected.
> 
> It seems that the expression is always interpreted as a string.
> Any ideas how to make it add the numbers? Or other ways to do it?
> 
> Vladimir


Here is one way using zero-width positive lookbehind assertion:

   $a =~ s/(?<=,)(\d+)/$1+10/eg;


Kien


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

Date: Fri, 12 Jan 2001 00:25:53 +0200
From: "Vladimir Georgiev" <merl@softhome.net>
Subject: Re: A RegEx question
Message-Id: <3a5e3441_3@news2.prserv.net>


"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:5cnr5t898infofo318k9dkh9ar0ha9io9g@4ax.com...
>
> Don't you get two comma's, instead of one, after $1?

Sorry, just a typo, I should have copied the code :)

And thanks a lot for the help.

Vladimir




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

Date: Thu, 11 Jan 2001 13:27:31 -0500
From: Henry Hartley <henryhartley@westat.com>
Subject: Re: Any good Perl books?
Message-Id: <3A5DFB13.447F0B85@westat.com>

Abigail wrote:
> 
> Good ones: The Camel
>            The Cookbook

Personally, I'd add: Programming the Perl DBI which was very helpful to
me and while it isn't strictly speaking a Perl book, I think Mastering
Regular Expressions is pretty good and useful to the Perl programmer.

And non-Oreilly books I'd add under Good ones would be:
  Perl - The Programmer's Companion (by Chapman, Wiley)
  Effective Perl Programming (by Hall, Addison Wesley)
  Object Oriented Perl (by Conway, Manning)

--
Henry Hartley
Westat
Rockville, Maryland, USA


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

Date: Thu, 11 Jan 2001 22:52:59 +0100
From: Bjoern Hoehrmann <bjoern@hoehrmann.de>
Subject: Apply XPath expression to XML::DOM
Message-Id: <3a8d174f.39810133@news.bjoern.hoehrmann.de>

Hi,

I've got XML::DOM::Document or XML::DOM::Node object and i want to use
XPath to get some nodes of this node-set. There is XML::XPath on CPAN,
but it doesn't seem to support this. Is this correct? If yes, why and
what can I do to reach my goal?
-- 
Björn Höhrmann ^ mailto:bjoern@hoehrmann.de ^ http://www.bjoernsworld.de
am Badedeich 7 ° Telefon: +49(0)4667/981028 ° http://bjoern.hoehrmann.de
25899 Dagebüll # PGP Pub. KeyID: 0xA4357E78 # http://learn.to/quote [!]e
<x>&#73; &#x2665; &#x2640;, &#x266B; &#x26; &#88;&#77;&#76; &#x263A;</x>


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

Date: 11 Jan 2001 21:16:57 GMT
From: dha@panix6.panix.com (David H. Adler)
Subject: Re: are there sites with Perl Advocacy examples?
Message-Id: <slrn95s8m9.8ru.dha@panix6.panix.com>

On Thu, 11 Jan 2001 18:32:54 GMT, webqueen, queen of the web
<webqueen@my-deja.com> wrote:

>Our IS dept glommed onto the premise that Perl is a "scripting
>langauage" useful only for quick and dirty scripts. I'm trying to be the
>advocate to give it much broader scope in our project suite. Can anyone
>provide sitges with examples of Perl application in the context of very
>large or at least large projects (with an appropriate amount of
>largeness)?

You might start by looking at
http://perl.oreilly.com/news/success_stories.html - unless the US
census and the Oxford English Dictionary strike you as small
things... :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
I'm not a non-conformist, I just follow directions poorly.
	- graffiti on the men's room wall at the Blind Tiger


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

Date: Thu, 11 Jan 2001 21:53:38 GMT
From: mag@ionet.net (Maggert)
Subject: Re: are there sites with Perl Advocacy examples?
Message-Id: <3a5e2af6.343845043@news.ionet.net>

On Thu, 11 Jan 2001 18:32:54 GMT, webqueen, queen of the web
<webqueen@my-deja.com> wrote:

>Our IS dept glommed onto the premise that Perl is a "scripting
>langauage" useful only for quick and dirty scripts. I'm trying to be the
>advocate to give it much broader scope in our project suite. Can anyone
>provide sitges with examples of Perl application in the context of very
>large or at least large projects (with an appropriate amount of
>largeness)?
>
>They are pushing for JSP and I'm not overly intrigued from what I've
>read about JSP. Many (like this guy:
>http://www.webmacro.org/OtherTech.html ) dont seem to like it much.
>

	MP3.com
	NASA
	Sandia Labs
	



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

Date: Thu, 11 Jan 2001 19:34:16 GMT
From: phild@sancerre.demon.co.uk
Subject: Background reminder process and server reboots
Message-Id: <93l1rn$klo$1@nnrp1.deja.com>

I'd like to write a Perl background reminder process which will check
for certain reminders and sleep until the next one is ready, then
execute that one etc.. (the reminders will come in the way of sending
emails..)

However, I've a problem I'm not sure of the best way to deal with: this
software will be running on someone else's server (possibly multiple
servers) so what happens if that server is restarted? The background
process will no longer be running and the reminders won't happen!

This background process will be part of a system which should be run
daily, so I thought that, when this system is run, it could check
whether the background process is running. If it isn't, it will run it.
This is the bit I'm unsure of how to do.

I can think of two ways of doing it off-hand:

1. Some kind of interprocess communication between the processes, one
of which might not exist and therefore might not respond. If it didn't
respond it would mean it needed to be started.
2. Checking the processes running on the machine to see if the
background process is running. If not, it needs to be started.

At the moment I favor 2 for a number of reasons. Do others agree? Can
anyone think of a better way of doing it, or provide me with some
example code for doing this very thing?

Please note that manual re-running of this process is NOT an option for
me.

Excuse me if this isn't the right newsgroup for this question...

Many thanks in advance for any replies!


Phil Drinkwater


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 11 Jan 2001 20:13:37 GMT
From: gungeek@my-deja.com
Subject: Re: Background reminder process and server reboots
Message-Id: <93l458$mv1$1@nnrp1.deja.com>

In article <93l1rn$klo$1@nnrp1.deja.com>,
  phild@sancerre.demon.co.uk wrote:
> I'd like to write a Perl background reminder process which will check
> for certain reminders and sleep until the next one is ready, then
> execute that one etc.. (the reminders will come in the way of sending
> emails..)
>
> However, I've a problem I'm not sure of the best way to deal with:
this
> software will be running on someone else's server (possibly multiple
> servers) so what happens if that server is restarted? The background
> process will no longer be running and the reminders won't happen!
>
> This background process will be part of a system which should be run
> daily, so I thought that, when this system is run, it could check
> whether the background process is running. If it isn't, it will run
it.
> This is the bit I'm unsure of how to do.
>
> I can think of two ways of doing it off-hand:
>
> 1. Some kind of interprocess communication between the processes, one
> of which might not exist and therefore might not respond. If it didn't
> respond it would mean it needed to be started.
> 2. Checking the processes running on the machine to see if the
> background process is running. If not, it needs to be started.
>
> At the moment I favor 2 for a number of reasons. Do others agree? Can
> anyone think of a better way of doing it, or provide me with some
> example code for doing this very thing?
>
> Please note that manual re-running of this process is NOT an option
for
> me.
>
> Excuse me if this isn't the right newsgroup for this question...
>

No, this isn't the right newsgroup.  It's more of an operating system
question.  Try comp.os.*


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 11 Jan 2001 16:24:39 -0500
From: "Antoine Beaupre (LMC)" <lmcabea@lmc.ericsson.se>
Subject: can I chdir(DIRHANDLE)?
Message-Id: <3A5E2497.7528F36@lmc.ericsson.se>

Hello!

I've read somewhere (???) that instead of doing:

use Cwd;
$from = cwd;
chdir ("/somewhere/else");
# do something
chdir $from;

I could do something like:

opendir(FROM, ".");
# do something
chdir(FROM);

that would be less error-prone and more portable.

Any idea on that? I've been looking all around perl docs and faqs and
this newsgroup and couldn't find anything...

Thanks a lot

A.
--
La sémantique est la gravité de l'abstraction.


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

Date: Thu, 11 Jan 2001 16:59:53 -0500
From: "Antoine Beaupre (LMC)" <lmcabea@lmc.ericsson.se>
Subject: Re: can I chdir(DIRHANDLE)?
Message-Id: <3A5E2CD9.4EED1464@lmc.ericsson.se>

I'm sorry for replying to my own post and posting it in the first place
altogether.

For other newbies that are as brain dead as me, the way to go is:

opendir(FROM, ".");
chdir(<FROM>);

duh.

A. (remembering to test the code he sends and to send the error codes
along... )

--
La sémantique est la gravité de l'abstraction.


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

Date: Thu, 11 Jan 2001 21:07:52 -0000
From: "KJ" <kj@royroy.fsnet.co.uk>
Subject: Client pull from intranet server via ISP server - HELP!
Message-Id: <93l77e$d1l$1@news6.svr.pol.co.uk>

Hi perl fans,

I have 3 elements...
* an internet browser.
* a webserver hosted by an internet service provider (IIS4.0, ActivePerl5x).
* an intranet webserver behind a firewall. (IIS4.0, ActivePerl5x).

I would like to return a web page to the internet browser from the intranet
webserver using the ISP server as a middle-man.  How can this be achieved
using Perl?  I have read that Perl can establish socket connections, but I
am really lost on this.

Your help is much appreciated :)

KJ.



Thanks in advance,

KJ




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

Date: 11 Jan 2001 21:46:48 GMT
From: jp@ulgo.koti.com.pl (Jacek =?iso-8859-2?Q?Pop=B3awski?=)
Subject: CPAN license?
Message-Id: <slrn95sae8.4lp.jp@localhost.localdomain>

Can I put CPAN on CoverCD?
I read in FAQ, that most modules are GPL, but few aren't. How to find
it (fast)? What license it is? 

-- 
Don't talk to strangers  
'Cause they're only there to make you sad
Don't dream of women                                  "Don't Talk To Strangers" 
'Cause they'll only bring you down                          - Ronnie James Dio


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

Date: Thu, 11 Jan 2001 20:46:22 GMT
From: mrapropos@hotmail.com
Subject: Deleting PDF pages
Message-Id: <93l62q$oun$1@nnrp1.deja.com>

Hi!

Is it possible to delete whole pages from a PDF file using Perl? I've
found plenty of modules to convert or create PDF files, but not clobber
whole parts of already created files.

For example, I would like to be able to find out how many pages are in
the PDF and then be able to delete page 9 and pages 12-15. The content
of the pages doesn't matter so much, just being able to delete them is
the key.

Any help would be ... helpful!

Thanks!


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 11 Jan 2001 14:43:45 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Dir dots in readdir and Win
Message-Id: <slrn95s37h.c92.tadmc@tadmc26.august.net>

markfolse@rocketmail.com <markfolse@rocketmail.com> wrote:

> How does one handle the directory dots in readdir in a Win system (ie,
>without resort to a pipe and grep,which these systems don't have). All
>the example I've found say @allfiles = grep !/^\.\.?$/, readdir, THISDIR
>or some similar grep pattern.


What happened when you tried that? Looks fine to me (except
for the syntax error (typo). Do NOT type in code, use copy/paste).

You are seeing problems where there are no problems.
(but you may be seeing problems that come from somewhere 
 besides Perl's grep() function.
)

What is the problem with the code above?

Got a short and complete program that we can run where the
grep/readdir thing is not working for you?

Show us the code and we will try and help you fix it.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 11 Jan 2001 21:47:15 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Finding ranges in a list of integers
Message-Id: <t5saf3q9jckafb@corp.supernews.com>

Rafael Garcia-Suarez (rgarciasuarez@free.fr) wrote:
: 
: I've a list of integers, sorted in ascending numerical order, like this:
:   qw/1 3 4 5 6 7 9 11 12 13 15 16 18 19 20 21 23 24/
: and I want to turn it into a string representation : a list of integers
: separated by commas, but where ranges of three or more consecutive
: integers are written like '1-3'. E.g. the solution for the above list
: would be :
:   1,3-7,9,11-13,15,16,18-21,23,24
: or, alternatively :
:   1,3-7,9,11-13,15-16,18-21,23-24
: if we allow two consecutive integers to be considered as a range.

If you'll settle for two being a range:

my @list = qw/1 3 4 5 6 7 9 11 12 13 15 16 18 19 20 21 23 24/;
$_       = join ' ', @list;

s/(\d+) (?=(\d+))/$1 + 1 == $2 ? "$1-" : "$1,"/eg;
s/-\d+(?=-)//g;     

print;


Patching it to discard 'ranges' of two consecutive ints is left as a
(fairly simple) excercise. :)

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "The hills are burning, and the wind is raging; and the clock
   |   strikes midnight in the Garden of Allah." - Don Henley


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

Date: Thu, 11 Jan 2001 16:51:13 -0600
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: How to get STDERR from system?
Message-Id: <93l9u9$2ig@fidoii.CC.Lehigh.EDU>

Basically, I want to seperately log (from my perl script) the STDERR and
STDOUT from system calls.  How can I do this?  Does the return from system()
mix both together?

Thanks,
Phil R Lawrence





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

Date: Thu, 11 Jan 2001 21:57:15 GMT
From: iain_hogg@my-deja.com
Subject: HTTP::Request encoding query
Message-Id: <93la7l$t68$1@nnrp1.deja.com>

Hi,

Take the following HTTP::Request :

$tgt = 'http://www.acme.com/cgi/test.cgi?val=bar|';
$req = new HTTP::Request('GET' => $tgt);

Now, when this request is made at some point it is encoded (in iso latin 1 I
think) into a HTTP request that looks like

GET http://www.acme.com/cgi/test.cgi?val=bar%7C

where '|' has become '%7C'

So what I'd like to know is if there is any way to prevent this encoding
taking place?  I don't mind changing perl source and recompiling if someone
can point me in the right direction, though obviously I'd prefer not to :)

This is under ActivePerl 5.22 (5.005_03) on Win32.  Thanks for any help.

--
Iain


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 11 Jan 2001 22:58:07 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Jobs: Senior Software Engineer
Message-Id: <lbn1cxzog1.fsf@lnc.usc.edu>

dha@panix2.panix.com (David H. Adler) writes:

> On Tue, 09 Jan 2001 17:58:14 GMT, jatgal  wrote:
> 
> >Title: Senior Software Engineer / Software Architect
> 
> >Availability:
> 
> Irrelevant.
> 
> You have posted a job posting or a resume in a technical group.

He posted a Perl job posting in a Perl newsgroup. Because this is
where Perl programmers are. I don't mind that.

-- 
Terrence Brannon
Carter's Compass...
    I know I'm on the right track when by deleting code I'm adding
    functionality.


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

Date: Thu, 11 Jan 2001 20:26:55 -0000
From: "Stephen Collyer" <stephen@twocats.dont-spam.demon.co.uk>
Subject: Re: left op of && and || only in scalar context ?
Message-Id: <979244895.12340.0.nnrp-02.9e98901a@news.demon.co.uk>


<nobull@mail.com> wrote in message news:u9g0iqj7qn.fsf@wcl-l.bham.ac.uk...

>
> EXPR1 || EXPR2  is semantically like:
>
> do {
>   my $expr1 = EXPR1; # Scalar context
>   if ( $expr1 ) { # Boolean context
>     $expr1;
>   } else {
>     EXPR2; # Inherits context
>   }
> }

This is a nice answer to my original question, giving
a constructive (in the mathematical proof sense)
description of why EXPR1 || EXPR2 evaluates only
EXPR1 in scalar context, when the whole expression
is in list context.

However, I should really have phrased the question
differently, cos I wan't  to know why this is considered
a feature, rather than a bug. It seems to me that if I
write:

@a = @b || @c;

either both sides should be evaluated in scalar context
or both in list. Maybe there's a problem with having to
reevaluate the same expression in two different contexts ?

Steve Collyer.





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

Date: Thu, 11 Jan 2001 13:06:20 -0800
From: Marc Pestana <markp@mail1.jpl.nasa.gov>
Subject: MacPerl news groups
Message-Id: <3A5E1E12.A940A87B@mail1.jpl.nasa.gov>

Hello,

Does anyone have a recommendation for MacPerl news groups or discussion
boards?

Thanks,
Marc P



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

Date: Thu, 11 Jan 2001 21:22:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: MacPerl news groups
Message-Id: <ns8s5t8s2treb6pku3av4khu73uplg6a54@4ax.com>

Marc Pestana wrote:

>Does anyone have a recommendation for MacPerl news groups or discussion
>boards?

The MacPerl mailing lists. The volume is quite low, at most 10 messages
a day.

	<http://www.macperl.com/depts/mlist.html>

When in doubt, pick the main list.

-- 
	Bart.


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

Date: Thu, 11 Jan 2001 21:34:34 -0000
From: "Tom" <vertical.reality@ntlworld.com>
Subject: Newbie - simple search
Message-Id: <TEp76.2238$XC4.38552@news6-win.server.ntlworld.com>

This works,......I got that far

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

$file = 'search_terms.dat';
open(SEARCH, $file) || die "Couldn't open file\n";

$full_string = $ENV{QUERY_STRING};

$string=~ s/^(.{0}).{2}/$1/;

while ($line = <SEARCH>)
 {
  if($line =~ /house/)  # What I want to do here is replace "house" with
"$string" so I can search via the query
string..... Possible ??
  {
  print "$line<br>";
  }
 }
close(SEARCH);
--
Tom

Effective Web Design
http://www.foothills.co.uk/ewd/







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

Date: Thu, 11 Jan 2001 22:20:12 -0000
From: "Tom" <vertical.reality@ntlworld.com>
Subject: Re: Newbie - simple search
Message-Id: <Fjq76.2369$XC4.42441@news6-win.server.ntlworld.com>

AAAAAAAAARRRRRRRGGGGGGHHHHH!

OK stop laughing !

Too late, need sleep - I've sorted it


--
Tom

Effective Web Design
http://www.foothills.co.uk/ewd/



Tom <vertical.reality@ntlworld.com> wrote in message
news:TEp76.2238$XC4.38552@news6-win.server.ntlworld.com...
> This works,......I got that far
>
> print "Content-Type: text/html\n\n";
>
> $file = 'search_terms.dat';
> open(SEARCH, $file) || die "Couldn't open file\n";
>
> $full_string = $ENV{QUERY_STRING};
>
> $string=~ s/^(.{0}).{2}/$1/;
>
> while ($line = <SEARCH>)
>  {
>   if($line =~ /house/)  # What I want to do here is replace "house" with
> "$string" so I can search via the query
> string..... Possible ??
>   {
>   print "$line<br>";
>   }
>  }
> close(SEARCH);
> --
> Tom
>
> Effective Web Design
> http://www.foothills.co.uk/ewd/
>
>
>
>
>




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

Date: Thu, 11 Jan 2001 21:11:29 GMT
From: Oktay <oktay@torontonian.com>
Subject: OT: .htpasswd on Win32 build
Message-Id: <3A5E221F.710E5A3@torontonian.com>

I apologize for an OT posting but my ISP doesn't carry any Apache
related NG.

 .htpasswd on Win32 build

Hello,

I downloaded indigo perl, Apache/1.3.14 +perl+modperl for my win2000
machine to test the scripts, webpages I create.
I've also successfuly installed 
PHP Version 4.0.4 as a module
Mysql 3.23.22-beta

So far it works flawlessy for a development server.

The only problem  I have at the moment is I can not use cyrpt or
 .htpasswd files.
I was wondering what can I do to make cyript or .htpasswd files to work
in win32 environment?

I thank you all in advance

Regards 

Oktay


PS: For those of you who might be interested in downloading indigo perl
see the URL below:
http://www.indigostar.com/indigoperl.htm


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

Date: Thu, 11 Jan 2001 14:25:16 -0500
From: Ying Hu <yhu@mail.nih.gov>
Subject: pattern as a sentence in pattern matching
Message-Id: <3A5E089C.64802A80@mail.nih.gov>

Hi,

I want to get a sentance with an interested word, such as:

$_ =~ s/[\.?!](\s*.* \b$word\b .*)\./$1/;

Could you please tell me the best way?

Thanks

Ying



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

Date: Thu, 11 Jan 2001 21:03:31 GMT
From: wroot@my-deja.com
Subject: perl as a login shell
Message-Id: <93l72r$q1k$1@nnrp1.deja.com>

Hi!

I'm curious:
Can one use perl as a login shell?

Thanks


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 11 Jan 2001 23:01:37 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: perl as a login shell
Message-Id: <lXq76.878$B9.190630912@news.frii.net>

In article <93l72r$q1k$1@nnrp1.deja.com>,  <wroot@my-deja.com> wrote:
>Hi!
>
>I'm curious:
>Can one use perl as a login shell?
>
>Thanks
>

One could.  But one might not find it as usefull as one might
want.  See the perlfaq3 answer titled "Is there a Perl shell?"

chris

-- 
    This space intentionally left blank


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

Date: Thu, 11 Jan 2001 23:01:36 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: perl as a login shell
Message-Id: <lbk881zoa8.fsf@lnc.usc.edu>

wroot@my-deja.com writes:

> Hi!
> 
> I'm curious:
> Can one use perl as a login shell?

Yes. There was a Perl Journal article on this... I can't remember this
issue though.

> 
> Thanks
> 
> 
> Sent via Deja.com
> http://www.deja.com/

-- 
Terrence Brannon
Carter's Compass...
    I know I'm on the right track when by deleting code I'm adding
    functionality.


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

Date: 11 Jan 2001 13:19:25 -0800
From: Ansel Sermersheim <ansel@babylon.dyndns.org>
Subject: Re: Perl idioms for converting string into list of characters...
Message-Id: <87wvc19482.fsf@redhawk.babylon.dyndns.org>

>>>>> "Weston" == Weston Cann <iowa88_song88.remove_eights@hotmail.com> writes:

> I can figure out a way convert a string into a list of characters
> via repeated use of the substr function.

> It also looks as if you can do it using split(//,$str).

> Are there other perl idioms for doing this?

One that I've used a variant of in the JAPH in my signature, but never
seen anywhere else is '$string =~ /./g'.  I had assumed it only to be
good for obfuscated code, but I just tested it and it seems to be
significantly faster than 'split //, $string' on my machine:

-----
[ansel@kithawk src]$ cat splittest
use Benchmark;
my $string = 'a' x 500;
timethese(-30,
          {
           SPLIT => sub { my(@list) = split //, $string },
           MATCH => sub { my(@list) = $string=~/./g },
          });
[ansel@kithawk src]$ perl ./splittest
Benchmark: running MATCH, SPLIT, each for at least 30 CPU seconds...
     MATCH: 32 wallclock secs (31.16 usr +  0.00 sys = 31.16 CPU) @
735.21/s (n=22909)
     SPLIT: 32 wallclock secs (31.32 usr +  0.00 sys = 31.32 CPU) @
675.35/s (n=21152)
[ansel@kithawk src]$ perl -v

This is perl, v5.6.0 built for i686-linux
-----

Anybody know why?  This seems odd to me.

Thanks,
-Ansel
-- 
$_{\$,}=[];@,=(%_,\%_,\*_,sub{},'JaPH'x2);y/0-9a-y//d,for(@,);map{$_ x=3}@,;$q=
join'',sort'$y=shift@,; $y^= int(eval$q) $q=q-my eval${q}if@,;$y-;pr'=~/\S*/g;$
_=q]"^vp|\@Zi0e|12O7340CP567M[,"];s@\d@\$][$&]@g;@]=(split'',unpack qq^$&q^^q^,
^^q,nQ,,q^)%1T&'`P%"SD`^);push@,,eval;eval(('JXKCC'^q^/.*/g^).$q=~/(.{6}).$/g);



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

Date: 11 Jan 2001 14:09:53 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Perl idioms for converting string into list of characters...
Message-Id: <m3puhtam0e.fsf@dhcp11-177.support.tivoli.com>

iowa88_song88.remove_eights@hotmail.com (Weston Cann) writes:

> I can figure out a way convert a string into a list of characters via
> repeated use of the substr function. 
> 
> It also looks as if you can do it using split(//,$str). 
> 
> Are there other perl idioms for doing this?

split //  seems to be the solution that most readily springs to
mind. You could also do something with chop like:

unshift @chars, chop $string while length $string;

But I expect that is *much* slower than the split method, and it
destroys the original string.  Looping with substr is probably even
faster than the above.

Of course, the real question is probably, Why do you want to do this?
Treating a string as a list of characters is seldom the right way to
go about things in Perl.  What is the underlying problem that you are
trying to solve?

-- 
Ren Maddox
ren@tivoli.com


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

Date: Thu, 11 Jan 2001 22:50:02 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl idioms for converting string into list of characters...
Message-Id: <x73dep4sbp.fsf@home.sysarch.com>

>>>>> "AS" == Ansel Sermersheim <ansel@babylon.dyndns.org> writes:


  AS> One that I've used a variant of in the JAPH in my signature, but never
  AS> seen anywhere else is '$string =~ /./g'.  I had assumed it only to be
  AS> good for obfuscated code, but I just tested it and it seems to be
  AS> significantly faster than 'split //, $string' on my machine:

  AS>      MATCH: 32 wallclock secs (31.16 usr +  0.00 sys = 31.16 CPU) @
  AS> 735.21/s (n=22909)
  AS>      SPLIT: 32 wallclock secs (31.32 usr +  0.00 sys = 31.32 CPU) @
  AS> 675.35/s (n=21152)

10% faster is not signifigant in some circles. i would just say is it
faster and leave it at that. and it should be mentioned more often as a
faster version of the common split // idiom.

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: 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 V10 Issue 41
*************************************


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