[15468] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2878 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 27 11:08:40 2000

Date: Thu, 27 Apr 2000 08:05:10 -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: <956847910-v9-i2878@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 27 Apr 2000     Volume: 9 Number: 2878

Today's topics:
        Apache & Perl mode in Win32 <gounis@my-deja.com>
    Re: Apache & Perl mode in Win32 <c4jgurney@my-deja.com>
    Re: Can anyone recommend a good book <kperrier@blkbox.com>
    Re: Confusion between bitwise and stringwise & ? <tye@metronet.com>
    Re: Converting MS Excel to ASCII or HTML exhacker@my-deja.com
    Re: Converting MS Excel to ASCII or HTML <jeff@vpservices.com>
        fork() and Win32::OLE incompatible jtillman@my-deja.com
    Re: HELP PLEASE!!! 2 strange problems with HTTP::Reques <tony_curtis32@yahoo.com>
    Re: help with a request exhacker@my-deja.com
        Hiding Password <hg009873@my-deja.com>
        how to close a subrutine <saddek@arch.chalmers.se>
        How to pass an array as an argument ? <forum@pliant.cams.ehess.fr>
    Re: How to pass an array as an argument ? <tony_curtis32@yahoo.com>
        Is there a way to create a Perl executable. <ant@tissoft.co.uk>
    Re: Is there a way to create a Perl executable. <kperrier@blkbox.com>
    Re: Is there a way to create a Perl executable. <brilliance201@hotmail.com>
        lib/anydbm.t TEST FAILED <pareilly@tcd.ie>
        mixing STDERR and STDOUT <lwaibel@cwia.com>
    Re: Perl Help file <dstiff@delanotech.com>
    Re: Put Variable Initializations In Other File (Tad McClellan)
    Re: Q: Script for searching a web site exhacker@my-deja.com
    Re: Script for searching a web site <john.paul.jones@dial.pipex.com>
    Re: searching database fields <lr@hpl.hp.com>
    Re: substitution question (Tad McClellan)
    Re: system commands failing on Windows NT <dstiff@delanotech.com>
        Working while travelling was Re: Psion 5, ... <ben@leedsnet.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 27 Apr 2000 13:28:13 GMT
From: gounis <gounis@my-deja.com>
Subject: Apache & Perl mode in Win32
Message-Id: <8e9f8s$rm7$1@nnrp1.deja.com>

i have apache web server and activestate perl in a Windows NT
workstation
machine

how can i setup apache server to recognize .pl pages

please help me

thanks
gounis

gounis@clubmobil.com

http://www.clubmobil.com



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


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

Date: Thu, 27 Apr 2000 14:38:16 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: Apache & Perl mode in Win32
Message-Id: <8e9jcm$fd$1@nnrp1.deja.com>

In article <8e9f8s$rm7$1@nnrp1.deja.com>,
  gounis <gounis@my-deja.com> wrote:
> i have apache web server and activestate perl in a Windows NT
> workstation machine
> how can i setup apache server to recognize .pl pages

Configuring servers (even if it's to run perl) is better covered in

comp.infosystems.www.servers.ms-windows

or their FAQ at

http://users.vfree.com/p/penguin/faq/ciwsmw-faq.html

Regards,

Jeremy Gurney
SAS Programmer  |  Protherics Molecular Design Ltd.
"When everything is coming your way, you're in the wrong lane."


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


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

Date: 27 Apr 2000 08:48:31 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: Can anyone recommend a good book
Message-Id: <8B861989B289A5C5.0FC432397C0CFB15.C5697718F228AA90@lp.airnews.net>


I really liked Clear and Present Danger by Tom Clancy

:)

Kent
-- 
    Just don't create a file called -rf.  :-)
            --Larry Wall in <11393@jpl-devvax.JPL.NASA.GOV>


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

Date: 26 Apr 2000 22:45:15 -0500
From: Tye McQueen <tye@metronet.com>
Subject: Re: Confusion between bitwise and stringwise & ?
Message-Id: <8e8d4b$fil@beanix.metronet.com>

Larry Rosler <lr@hpl.hp.com> writes:
) 
) I isolated the problem

FYI, what helped me track down the bug was this little trick that
should work often [but not if you are running Perl on a Cray]:

    sub svFlags { return sprintf " 0x%X",
      unpack "x8L", unpack "P12", pack "L", \$_[0] }

You have to look up the /^SV[sfp]_[A-Z]+$/ bits in
F<perl/lib/core/sv.h> to make sense of what is displayed.

I used it like:

    my $x= 10;		# $x only has an IV
    print "\$x=10\t\t",svFlags($x),"\n";
    $x= '2' . $x;	# $x should only have a PV, but perl5.6.0 keeps IV
    print "\$x='2'.\$x\t",svFlags($x),"\n";

    my $z;
    $x= '10';
    my $y= '02';	# $x,$y both only have PV
    print "\$x='10';\$y='02'\t",svFlags($x),svFlags($y),"\n";
    $z= $x & $y;	# $x,$y both only have PV (C<&> is stringwise)
    print "\$x&\$y\t\t",svFlags($x),svFlags($y),"\n";
    $z= $x & 0;		# $x now also has an IV (C<&> is numeric)
    print "\$x&0\t\t",svFlags($x),svFlags($y),"\n";
    $z= $x & $y;	# both $x,$y have both PV and IV (C<&> is numeric)
    print "\$x&\$y\t\t",svFlags($x),svFlags($y),"\n";

And I was wrong before -- even perl5.004 ends the above script
with both C<$x> and C<$y> having cached numeric values (IVs) so
that C<&> against either of them will be a "numeric bitwise and".

svFlags should never be used without adult supervision [such as
in a script]!
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Thu, 27 Apr 2000 13:21:43 GMT
From: exhacker@my-deja.com
Subject: Re: Converting MS Excel to ASCII or HTML
Message-Id: <8e9esp$rhk$1@nnrp1.deja.com>

In article <23WN4.89$x4.4543@newsread1.prod.itd.earthlink.net>,
  "Mike Flaherty" <mflaherty2@earthlink.net> wrote:
> I was told that Perl had a way to convert MS Excel files into ASCII.
Is
> anyone familiar with this?  How is it done?  I need to be able to do
this
> from a command line so that our search engine (Alkaline -
www.vestris.com)
> can index XLS files.
>
> Thanks as Always,
> Mike
>
>
I don't know if this helps, it depends on *how many files* you have to
do.  MS Excel has the option to save as tab-delimited.  That would put
it in a format easily parsible to a novice Perl user.  The problem is
that you would have to open *each* file, and click about 6-10 times.

# That's all from this brain.

exhacker


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


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

Date: Thu, 27 Apr 2000 07:31:58 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Converting MS Excel to ASCII or HTML
Message-Id: <39084F5E.9AA87B1F@vpservices.com>

Mike Flaherty wrote:
> 
> I was told that Perl had a way to convert MS Excel files into ASCII.  Is
> anyone familiar with this?  How is it done?  I need to be able to do this
> from a command line so that our search engine (Alkaline - www.vestris.com)
> can index XLS files.

A search of the deja-news archives of this newsgroup on the keyword
"excel" reveals over 200 articles on the topic you mention.  Among your
other options -- Win32::OLE and DBD::ODBC.  The former would let you
open each spreadsheet from Perl and save it as ascii, the later would
let you search the spreadsheets from Perl without converting them. 
Check the archives for details.

-- 
Jeff


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

Date: Thu, 27 Apr 2000 13:22:12 GMT
From: jtillman@my-deja.com
Subject: fork() and Win32::OLE incompatible
Message-Id: <8e9etk$rhr$1@nnrp1.deja.com>

To all using ActiveState perl 5.6 on win32 machines, please be aware
that Win32::OLE and fork() are not compatible.  Merely having this
statement:

use Win32::OLE;

in a script that uses fork seems to cause a GPF in perl.exe.

See ActiveState bug report libwin32/263 for the explanation:

http://bugs.activestate.com/ActivePerl/libwin32?
id=263;expression=win32::ole;user=guest;prio00=1;prio01=2;prio02=4;prio0
3=8;stat00=1;stat01=2;stat02=4;stat03=8;stat04=16;stat05=32;stat06=64;as
signtype=-1;assignuser=0

I'm personally a little disconcerted by the number of GPFs I'm
experiencing using this latest release of ActivePerl, many having
nothing to do with the use of fork().  Several have to do with using
ODBC from DBI, but others involving IO::Socket have been noted as
well.  I'm trying to nail down what I'm experiencing so I can report
what I've found.

Another note I'd like to add is that you should read the Release Notes
carefully before installing.  Installing over a previous release of AS
Perl seems to consistently break many modules.  DBI for example was
entirely broken when I tested an install of 5.6 on top of AS Perl build
522.

Hope this helps somebody out.

Jamie


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


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

Date: 27 Apr 2000 08:10:25 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: HELP PLEASE!!! 2 strange problems with HTTP::Request class; one solved, the other one.... somebodyy have an idea?
Message-Id: <87ln1zg05a.fsf@shleppie.uh.edu>

>> On Thu, 27 Apr 2000 09:58:32 +0200,
>> "Federico" <artax@shineline.it> said:

ciao,

>     The problem I have solved is this: the form of the
> search engine of Amazon is the follow:

> 1) url: htp://amazon.com/exec/obidos/external-search 2)
> method: GET 3) environment variables:
> mode=Books&keyword=~write_here~&tag=genialcomparison&Go=Go

That's the query string, rather than "environment
variables" (they're implemented as envariables, but that's
not what they actually are).

> where instead of ~write_here~ you have to put the
> keywords and substitute every space with the sequence
> %20. If you use the classes Response and Requeste

To be more exact, you have to escape all characters which
are meta- within the URL, see "perldoc URI::Escape" for a
safe method of doing this.

> defining the variable of the form with the Request class
> function "content(...)" the answer of the request will

Above you have a GET request, content() is for POST (and
some other) requests.

> be an error page from Amzon. I don't know why;have any
> idea?), BUT I KNOW that if you codify the cgi
> environment variables manually ie if you write

>     $temp=HTTP::Request-> new('GET' =>
> 'htp://amazon.com/exec/obidos/external-search?mode=Books&keyword=~write_here
> ~&tag=genialcomparison&Go=Go');

> it will work correctly!!!!!!!!!!!!!!!

This is how GET works.

>     But the real problem is another one: this form
> sended by a perl scrip with some sequence of keywords
> doesn't work correctly. For example it always work if
> you use just ONE word ... if you use 2 words or more it
> depends from which words. But if you copy-and-paste all

Very vague, there's no information in your description
which could help in debugging.

I suspect you need to make sure the query-string/content
is escaped properly before GETting or POSTing it.

hth
t


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

Date: Thu, 27 Apr 2000 13:08:43 GMT
From: exhacker@my-deja.com
Subject: Re: help with a request
Message-Id: <8e9e4g$qb3$1@nnrp1.deja.com>

In article <8e8gkp$r3r$1@nnrp1.deja.com>,
  morlou@my-deja.com wrote:
> Ok, I'm buiding a site to allow its user to buy computers. I'm doing
> the following CGI request to add a record in my Filemaker database and
> it works fine:
>
> @array = [-DB=>'MyDatabase.fp3', -Lay=>'COMPUTER_ORDER','-new'];
> $user_agent = LWP::UserAgent->new;
> $request=POST 'http://xxx:yyy@255.255.255.255/FMPro',@array;
> $response = $user_agent->request($request);
> print $response->as_string;
>
> Ok, my problem is that I have to save computer items and their prices
> etc... in the database, but I got to do it dynamically, I mean that I
> want to insert other elements in @array after its initialization, I
> would like to insert something like ---> part_price=>'199' <--- etc...
> I tried but I can't make it works (the preliminary code specified
above
> works though), notice that I am a Perl newbie and I'm really stucked
at
> this point... So do you know how to do it??? Please! Thanks a lot!
>
> Louis Morin

Louis, have you tried the push() function in Perl ?

push(@array,"part_price=199");

I would also recommend using strict on this one, to avoid having your
database interact with itself if two people are using it (or do i
misunderstand the function of strict....)

use strict;
my @array = [-DB=>'MyDatabase.fp3', -Lay=>'COMPUTER_ORDER','-new'];
my $user_agent = LWP::UserAgent->new;
my $request=POST 'http://xxx:yyy@255.255.255.255/FMPro',@array;
my $response = $user_agent->request($request);
print $response->as_string;

exhacker


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


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

Date: Thu, 27 Apr 2000 13:53:46 GMT
From: Gary <hg009873@my-deja.com>
Subject: Hiding Password
Message-Id: <8e9gp2$ti4$1@nnrp1.deja.com>

I have a perl script which runs in an NT command shell and asks the
user for username and password, for later use in accessing SQL. How can
I get perl to hide password (i.e. not echo to screen)as the user types
their password in.


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


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

Date: Thu, 27 Apr 2000 16:26:36 +0200
From: Saddek Rehal <saddek@arch.chalmers.se>
Subject: how to close a subrutine
Message-Id: <39084E1C.CF1E25F@arch.chalmers.se>

This is a multi-part message in MIME format.
--------------5039406595B449F0205EAF91
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

How can I run make my script to stop after each subroutine.

&step1 && &step2 && &step3 && &step4;

thank you for helping

--
Saddek Rehal
Chalmers tekniska högskola,
Arkitektur, Byggnadskonst
412 96 Göteborg
Tel: 031-772 24 75


--------------5039406595B449F0205EAF91
Content-Type: text/x-vcard; charset=us-ascii;
 name="saddek.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Saddek Rehal
Content-Disposition: attachment;
 filename="saddek.vcf"

begin:vcard 
n:Rehal;Saddek
tel;cell:0703088885
tel;home:031-144120
tel;work:031 7722475
x-mozilla-html:FALSE
url:pc15.arch.chalmers.se/saddek.html
adr:;;;;;;
version:2.1
email;internet:saddek@archc.chalmers.se
x-mozilla-cpt:129.16.160.85;2
end:vcard

--------------5039406595B449F0205EAF91--



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

Date: Thu, 27 Apr 2000 10:33:26 -0400
From: Yan Basile <forum@pliant.cams.ehess.fr>
Subject: How to pass an array as an argument ?
Message-Id: <39084FB6.F84081C@pliant.cams.ehess.fr>

Hi,

I want to make a fonction with the following prototype:

sub printArrayAsI_want (@arrayArg);

Is it possible to pass an Array as an argument in Perl ?
If it is possible, how we do that?

Thanks.



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

Date: 27 Apr 2000 09:41:50 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: How to pass an array as an argument ?
Message-Id: <87em7rfvwx.fsf@shleppie.uh.edu>

>> On Thu, 27 Apr 2000 10:33:26 -0400,
>> Yan Basile <forum@pliant.cams.ehess.fr> said:

> Hi, I want to make a fonction with the following
> prototype:

> sub printArrayAsI_want (@arrayArg);

> Is it possible to pass an Array as an argument in Perl ?
> If it is possible, how we do that?

    my @data = (1, 2, 3, 4, 5, 6);

Pass it directly as a list:

    sub myformat {
      foreach my $a (@_) {
	printf FORMAT, $a;
      }
    }
    
    myformat(@data);

or pass a reference to the array:

    sub myformat {
      my $arr = shift;
    
      foreach my $a (@$arr) {
	print "$a\n";
      }
    }
   
    myformat(\@data);

Alternatively don't forget that perl already has array
formatting potential via the $" variable (perldoc
perlvar).

    local $" = " +++ ";
    print "@data\n";

perldoc perlvar
perldoc -f printf
perldoc -f map
perldoc perlref

hth
t


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

Date: Thu, 27 Apr 2000 15:24:23 +0100
From: Antony KING <ant@tissoft.co.uk>
Subject: Is there a way to create a Perl executable.
Message-Id: <5A6743F1C6A8D311A23D009027DCC70323B72D@exchange.tissoft.co.uk>



-> As I understand it Perl gets compiled just before each 
-> execution. Is there
-> a way to create Perl object code (i.e. an .exe ) program 
-> that does not
-> need to be compiled every time it is run?

I've had a play with this with zero success (though I must admit I've
not spent a huge amount of time getting it to work). The latest perl has
perlcc supplied which should do the job, and probably will with simple
scripts. The 'old' way was to basically cause a core dump before you
started doing interesting code but after you'd set up any tables etc.
There's a program that you run over this core dump and it turns it into
an executable (don't think that would work on DOS though). I've got a
similar issue with the amount of time taken to compile the code - takes
about 5 seconds,which is a pain when it's on a web server; latency like
that is frowned on by your surfers.


DISCLAIMER===============================================
The views expressed in this message are my own and do not
necessarily represent the views of TIS Software Ltd.
=========================================================




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

Date: 27 Apr 2000 08:46:09 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: Is there a way to create a Perl executable.
Message-Id: <740B04C7712EA6C8.B97A94B0B88C3A34.F470124C62AC65E1@lp.airnews.net>

Alan Hopper <aahopper@mailbox.ucdavis.edu> writes:

> As I understand it Perl gets compiled just before each execution. Is there
> a way to create Perl object code (i.e. an .exe ) program that does not
> need to be compiled every time it is run?

Perl is compiled once, when it is installed.

Kent
-- 
    Just don't create a file called -rf.  :-)
            --Larry Wall in <11393@jpl-devvax.JPL.NASA.GOV>


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

Date: Thu, 27 Apr 2000 15:50:13 +0200
From: Philip Monitor <brilliance201@hotmail.com>
Subject: Re: Is there a way to create a Perl executable.
Message-Id: <2chggssifvf9g5dmr809tggumctar991bk@4ax.com>

On 27 Apr 2000 08:46:09 -0500, Kent Perrier <kperrier@blkbox.com>
wrote:

>Alan Hopper <aahopper@mailbox.ucdavis.edu> writes:
>
>> As I understand it Perl gets compiled just before each execution. Is there
>> a way to create Perl object code (i.e. an .exe ) program that does not
>> need to be compiled every time it is run?
>
>Perl is compiled once, when it is installed.
>
>Kent

Perl2exe

http://www.dynamicstate.com/

Phil


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

Date: Thu, 27 Apr 2000 14:35:23 +0100
From: Paul Reilly <pareilly@tcd.ie>
Subject: lib/anydbm.t TEST FAILED
Message-Id: <3908421A.563A92A3@tcd.ie>


Can anyone shed any light on this:

RH Linux 6.2
Just installed perl 5.005_3 from source.
When running make test , all the tests pass except for  lib/anydbm

lib/abbrev..........ok
lib/anydbm..........FAILED test 12    Failed 1/12 tests, 91.67% okay
lib/autoloader......ok

When I run the test on it's own, it fails, but the script says:

Can't locate Fcntl.pm in @INC (@INC contains: ../lib) at anydbm.t line
11.

And if you look at the lib/anydbm.t script it says:

#If Fcntl is not available, try 0x202 or 0x102 for O_RDWR|O_CREAT
use Fcntl;

and further down we have lines such as:

print (tie(%h,AnyDBM_File,'Op_dbmx', O_RDWR|O_CREAT, 0640)


So how can I get it to work? Do I need to change the 0640 to 0202 or
0102?
Should Fcntl be in my @INC and does it work on Linux 6.2?
What is Fcntl?

Any advice appreciated,

Paul



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

Date: Thu, 27 Apr 2000 06:18:41 PDT
From: Larry R. Waibel <lwaibel@cwia.com>
Subject: mixing STDERR and STDOUT
Message-Id: <VA.00000030.18f9ae2a@cwia.com>

I've got the following Perl script.  When I run, all the STDOUT is in the 
file before the STDERR output, even though I did the STDERR first.  How do I 
make sure that entries get into the file in the same order they happened?  I 
thought that's what setting the autoflush ($|=1) would do?  Thanks!

$| = 1;
open(STDERR, ">>$0.log");
open(STDOUT, ">>$0.log");
$Time = localtime;
print STDERR "$Time\n";
print "$0.log\n";
system qw(net use);




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

Date: Thu, 27 Apr 2000 09:22:31 -0400
From: "David Stiff" <dstiff@delanotech.com>
Subject: Re: Perl Help file
Message-Id: <vaXN4.9$o07.69@client>

Sorry. We had an Internet outage here and I lost my posts.

"David Stiff" <dstiff@delanotech.com> wrote in message
news:B3HN4.1166$pb6.1478@client...
> Has a Windows style HLP file been created for Perl? One with Contents |
> Index | Search tabs?
>
> Thanks.
>
>




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

Date: Thu, 27 Apr 2000 00:54:08 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Put Variable Initializations In Other File
Message-Id: <slrn8gfhvg.973.tadmc@magna.metronet.com>

On 27 Apr 2000 00:47:32 GMT, Jim Monty <monty@primenet.com> wrote:
>Tom Phoenix <rootbeer@redcat.com> wrote:
>> > What's the short answer?
>>
>> perlmod. (I'd tell you more, but then it wouldn't be a short answer. :-)
>
>Judging from the volume of discussion in this newsgroup about how
>packages and modules and 'use' and 'require' and 'do' and scoping
>and namespaces and compile-time evaluation and run-time evaluation
>and other related things work, the answer to my problem is not as
>trivial as simply reading about it somewhere.


It is as trivial as _carefully_ reading about it somewhere.


   perldoc strict

-----------------
       strict vars
             This generates a compile-time error if you access a
             variable that wasn't declared via use vars,
             localized via my() or wasn't fully qualified.
-----------------


So then we try the first alternative listed:

   perldoc vars

-----------------
       This will predeclare all the variables whose names are in
       the list, allowing you to use them under "use strict", and
       disabling any typo warnings.
-----------------


>I was hoping someone would just show me a simple example of how to
>put a hash initialization into a separate file and still "use
>strict" in the main or calling script. 


------------------
#!/usr/bin/perl -w
use strict;

use vars qw/ %hash /;  # a dynamic variable in package 'main'
require 'foo.pl';

foreach (sort keys %hash) {
   print "$_  ==>  $hash{$_}\n";
}
------------------

and in file 'foo.pl':

------------------
%hash = (       # defaults to %main::hash  (i.e. in package 'main')
   zero  => 0,
   one   => 1,
   two   => 2,
);

1;
------------------


>Based on what I have read,
>it cannot be done easily 


Doesn't look too hard to me...


>and without knowledge of packages and
>modules. 


You don't need to know about packages or modules.

You do need to know the difference between dynamic and lexical variables.


>(It goes without saying that I don't understand these
>topics or I wouldn't have to ask.)


That's OK. You don't need to understand them to do what you want.

How are you on the difference between dynamic/lexical variables
in Perl?  :-)


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 27 Apr 2000 14:23:34 GMT
From: exhacker@my-deja.com
Subject: Re: Q: Script for searching a web site
Message-Id: <8e9igi$vk3$1@nnrp1.deja.com>

Snip from http://www.analogx.com/contents/news.htm
************************************
Would you like to know what your website looks like to a search engine?
Would you like to get better placement on the search engines? One of
the best ways to do this is to analyze the words used, and now there's
a new weapon in the crawler battles - AnalogX Keyword Extractor
(KeyEx)! KeyEx has the ability to extract all the keywords and sort
them based on how they're used, then you can apply weighting values
that can be customized for any search engine out there - a MUST for
anyone serious about search engines! It's available right now in the
Download/Network area, so grab a copy and start extracting today!
************************************

exhacker

In article <8e9d7h$ikt$1@lure.pipex.net>,
  "John Paul Jones" <john.paul.jones@dial.pipex.com> wrote:
> Hi,
>
> Can anybody suggest a script for searching my own web site for
keywords?
>
> Thanks in advance
>
> John
>
>


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


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

Date: Thu, 27 Apr 2000 14:01:57 +0100
From: "John Paul Jones" <john.paul.jones@dial.pipex.com>
Subject: Re: Script for searching a web site
Message-Id: <8e9e0i$j1v$1@lure.pipex.net>

Hi Mike,

Unfortunately I don't have telnet access to my ISP (only via FTP) so it
doesn't look as if I can use vestris :(

John

Mike Flaherty <mflaherty2@earthlink.net> wrote in message
news:NRWN4.153$x4.7867@newsread1.prod.itd.earthlink.net...
> I use Alkaline and highly recommend it.  You can find it at
www.vestris.com.
> It is free for non commercial use and is very feature rich.  I like it
> because it can index more than just text or HTML if you instal the right
> filter (converter).  For example, we index several MS Word documents.
Note.
> It really isn't a script because you get binaries and no source code.
>
> John Paul Jones <john.paul.jones@dial.pipex.com> wrote in message
> news:8e9d7h$ikt$1@lure.pipex.net...
> > Hi,
> >
> > Can anybody suggest a script for searching my own web site for keywords?
> >
> > Thanks in advance
> >
> > John
> >
> >
>
>




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

Date: Thu, 27 Apr 2000 07:58:01 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: searching database fields
Message-Id: <MPG.1371f54d2a36ae598a995@nntp.hpl.hp.com>

In article <8e94ib$gcu$1@nnrp1.deja.com> on Thu, 27 Apr 2000 10:25:25 
GMT, exhacker@my-deja.com <exhacker@my-deja.com> says...

 ...

> At your "if" statement, you're saying
> if ($variable != "")

That incorrectly uses a numerical comparison operator instead of a 
string comparison operator.

> I would instead say
> if (length($variable))

So might I, but they are equivalent.

> this will only fail if $variable contains absolutely nothing.

What is 'absolutely nothing'?  If $variable is undefined, then it will 
be converted to a null string, but that will draw a warning if warnings 
are enabled (as they should be).

> another way (i think) is to say
> if ($variable != "^$")

Before posting 'i think' code, don't you think you should try one or two 
tests?  What benefit does an idle conjecture provide?

Let me count the errors in those few tokens:

1.  Numerical comparison instead of string comparison.

2.  Syntax error on the double-quoted string, containing an invalid 
interpolation.

3.  Semantic error -- that is not how to do a regex match.

> , where there are no characters between the beginning and end of the
> string (given that the variable contains a string :-)

Any scalar value can be converted to a string for stringwise comparison.

Oh, the correct code:

  if ($variable !~ /^$/)

Test it yourself.  Grumble, grumble...

> > BTW, chomp() is better than chop() for removing newlines. chop() removes
> > the last char regardless of what it is, chomp() only removes it if it
> > matches $/

 ...

> I have found that removing newlines with chomp and chop is not as
> powerful as some of the code below.

That is because they deal only with the ends of strings specifically.  
The chomp() function is the correct tool for the job.

> $variable =~ s/\n//;
> #removes a single newline from the string

Removes the first "\n" from the string, whether or not it is at the end.

> $variable =~ s/\n//g;
> #removes all newlines (careful with this one)

If that's what is wanted, why be careful?  For the record, the 'better 
way' is:

  $variable =~ tr/\n//d;

> Sometimes, internet line returns show up in hex as \r\n\n\r
> FYI

s/Sometimes/Never/;

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


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

Date: Thu, 27 Apr 2000 00:07:38 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: substitution question
Message-Id: <slrn8gff8a.973.tadmc@magna.metronet.com>

On Thu, 27 Apr 2000 02:22:51 GMT, borg <csis@geocities.com> wrote:
>I am looking for a way to rename all the text files in a dir to html. ie
>I want to change their extensions. Normally when I want to replace
                        ^^^^^^^^^^
>something in a file I use:
           ^^^^^^^^^
>perl -pe 's/old/new/g' filename > newfilename


The "name" of a file is a very different thing from the
"contents" of a file.


>How can I rename all the extensions using somethng similar?

I wouldn't call it similar, but this does what you ask (I think):

(word-wrapped shell style for posting)

   perl -we 'for(@ARGV){ ($new=$_) =~ s/\.txt$/.html/; \
             rename $_, $new unless -e $new }' *.txt


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 27 Apr 2000 09:23:19 -0400
From: "David Stiff" <dstiff@delanotech.com>
Subject: Re: system commands failing on Windows NT
Message-Id: <jbXN4.11$o07.127@client>

Thanks. I installed an older build of Perl and now the system commands are
working.

"David Stiff" <dstiff@delanotech.com> wrote in message
news:u4HN4.1171$pb6.1241@client...
> I have installed Active Perl 516 but "system" commands are failing. Do I
> need to install an older build of Perl. (I had this working at a previous
> job).
>
> Thanks.
>
>




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

Date: 27 Apr 2000 13:42:21 GMT
From: <ben@leedsnet.com>
Subject: Working while travelling was Re: Psion 5, ...
Message-Id: <8e9g3t$s79$1@supernews.com>

Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Sat, 8 Apr 2000 16:55:06 +0200 Alan J. Flavell wrote:
>> Nothing more exciting than reviewing the Perl documentation while
>> travelling.  I don't have the singleness of purpose to actually
>> develop apps over the in-flight catering, sorry; 

> I am on the 18:23 from Cannon Street to Hastings right now.  I have all
> the Perl documentation and Perl too ;-}  But you dont get charged for
> excess hand luggage on the train I guess.

If you want to make time travel quickly while travelling on 
British Rail for example from Manchester Victoria to Hull
Paragon, you could do worse than takes the docs for an otherwise
impenetrable application such as MacNosy.

Another is to take along some program that needs debugging, the
effort in remembering what all those hex addresses represent
makes the time pass very quickly.

Ben.



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

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


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