[9191] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2808 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 4 16:09:28 1998

Date: Thu, 4 Jun 98 13:01:07 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 4 Jun 1998     Volume: 8 Number: 2808

Today's topics:
        -B $file problems <paladin@uvic.ca>
    Re: Altavista, infoseek, etc. dlynch@morrisonscientific.com
        Anyone know graphics? <warp@internetcom.com.br>
    Re: Compile Perl5.4 on AIX 4.2 with Gcc 2.8.0 <rosenbauer@springer.de>
    Re: help me to install perl on WinNT (Jonathan Stowe)
        HELP:  Upload binary file with Perl script on WinNT <thidinh@erols.com>
    Re: HELP:  Upload binary file with Perl script on WinNT <thidinh@erols.com>
    Re: how to make a Perl program receive email under Unix <wsanchez@tribune.com>
        Lotus Notes from perl? murple@erols.com
    Re: Module Net::SMTP dlynch@morrisonscientific.com
    Re: pattern match (Jonathan Stowe)
    Re: Perl and Javascript conflicts (Jonathan Stowe)
        Perl Socket connections on NT <stephens.42@osu.edu>
        problem using LWP sylviamo@my-dejanews.com
        Q: please help explain why this is array context? (Was: Matthew.Wickline@usa.net
    Re: Q: please help explain why this is array context? ( <jdporter@min.net>
    Re: Regex: parens inside quantifiers: can you capture a <aqumsieh@matrox.com>
    Re: Regular Expressions <rootbeer@teleport.com>
    Re: Regular Expressions (Mike Stok)
        Running Perl script on remote machine and returning res <gmarler@mccaw-stg.com>
        Search Engine <probavm@cat.com>
    Re: Search Engine <rootbeer@teleport.com>
    Re: Search Engine <probavm@cat.com>
    Re: seek advice on simple first program <rootbeer@teleport.com>
    Re: Submitting html form to Perl script. suave@colba.net
        Unbuffered Input (Alan Myers)
    Re: Use of HTML, POD, etc in Usenet (was: Re: map in vo <rsi@lucent.com>
    Re: Use of HTML, POD, etc in Usenet (was: Re: map in vo <jdporter@min.net>
    Re: user authentication suave@colba.net
    Re: very quick s/// question (Matt Knecht)
        Why is there no "in" operator in Perl? (Glen Koundry)
    Re: Why is there no "in" operator in Perl? (Matt Knecht)
    Re: Why is there no "in" operator in Perl? (Joel Coltoff)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 4 Jun 1998 11:11:31 -0700
From: Draco Paladin <paladin@uvic.ca>
Subject: -B $file problems
Message-Id: <Pine.A41.3.96.980604110724.60394A-100000@unix3.UVic.CA>

I have a problem with the File test operator -B.

I am working on a DOS machine and have a file that contains a bunch of
text (specificallt the word "Hello" 40 times) followed by a single CR
(\r).

When I test it with -B it returns true (ie that it is a binary file) but
if that CR is anywhere else in the file it returns false (ie that it is a
text file).

Is this a problem with PERL or specifically with the DOS port of perl?

Any help would be appreciated.

Alan.

---------------------------------------------
Mother is the name for GOD on the lips and
hearts of all children.  - Eric Draven



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

Date: Thu, 04 Jun 1998 18:05:03 GMT
From: dlynch@morrisonscientific.com
Subject: Re: Altavista, infoseek, etc.
Message-Id: <3576e0ec.515837825@news.canuck.com>

On Thu, 4 Jun 1998 13:58:10 +0200, "arnoud de jong"
<arnoud@notenbomer.nl> wrote:

>Hi,
>
>Does anyone know how I can create a simple search engine. So I can create a
>list of URL's and create a searchable index.
>
>Any Ideas?
>
>Arnoud
>
>
>


Have you played around with the LWP, NET, HTML and URI modules?  They
have functions relevant to the Web.  Stuff like FTP, retreiving web
documents, mirroring sites, and extracting links.


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

Date: Thu, 4 Jun 1998 16:00:35 -0300
From: "BBQ" <warp@internetcom.com.br>
Subject: Anyone know graphics?
Message-Id: <6l6qsv$i22@www001.itanet.com.br>

Does anyone know of any module, system, or anything app that could help
produce gif's or jpeg's for web output??

Any pointers?

Thanx,
BBQ






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

Date: Thu, 04 Jun 1998 20:09:34 +0200
From: "M. Rosenbauer" <rosenbauer@springer.de>
Subject: Re: Compile Perl5.4 on AIX 4.2 with Gcc 2.8.0
Message-Id: <3576E2DE.588B0B6@springer.de>

I have almost the same problem. But it doesn't depend on gcc. It's the
same for cc.

The problem is the right configuration. Some variables in the
config.sh file are not defined which ought to be defined,
e.g. d_umask. And lots of libraries don't have the attended
names on AIX, it seems to me (e.g. -lnet --> -lxnet ??)

The undefined variables then lead to messages like
"The umask funcion is unimplemented"
or
"/lib/socket...skipping test on this platform"

I could make some progress by  naming all system libraries as
additional libraries during the configuration procedure
"-lcurses -lxnet -lxti ...."
but up to now I havn't been able to find a combination of
defined variables and libraries which works and passes
100% of the test. I am above 90%, however.

Perhaps anyone has solved these problems on AIX already?
I am new to this operation system...

Sincerely
Martin


Alan Fahrner wrote:

> Hi All...
>
> Has anyone successfully compiled perl 5.4.4 on AIX 4.2 using the gcc 2.8.0
> compiler?
>
> I can get it to compile, but it then fails about 17% of the tests.
>
> On the surface, it appears that it is choking when it hits an "__END__"
> tag -- but not in every case (FileHandle.pm works if the __END__ tag is
> pulled out).
>
> I appreciate any suggestions on where I should go from here (any special
> config things you set, etc., etc. to make it work).  Maybe a "perl -V" if
> possible on a successful compile?
>
> Thanks
>
> Alan



--
===================================================================
Dr. Martin Rosenbauer                rosenbauer@springer.de
Springer-Verlag              __o     phone: +49 (6221) 487 184
Tiergartenstrasse 17       _-\<,_    fax:   +49 (6221) 487 304
D-69121 Heidelberg    ....(_)/ (_)   home phone: +49 (6221) 862384
==== Germany ======================================================




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

Date: Thu, 04 Jun 1998 18:47:58 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: help me to install perl on WinNT
Message-Id: <3576c71e.25672494@news.btinternet.com>

On 4 Jun 1998 09:36:08 GMT, wings wrote :

>Yingxue Li <yingxue@ee.tamu.edu> wrote:
>
>: I  tried to install Perl5.002 on my WinNT PC(using Gurusamy
>: Saraty's binary version from www.perl.com), but failed at the last step
>: and the error message was like:
>:   Copying distribution from ... to ...
>:   Can't spawn "cmd.exe": No such file or directory
>:   Copy failed!: No such file or directory.
>: However I can install it on a Win95 PC.
>: Can you help me to solve the problem? Thank you very much!
>
>why dont u use Activeware's Perl for win32? it's Perl5.003 and easy to install.
>

? The GSAR distribution is more recent more complete with more bugs
fixed.  The latest distribution I downloaded has installed like a
dream on both W95/NT4.  The only advantage of using activeware is if
you are convinced that you want to use IIS for the rest of your career
( However long that might turn out to be ).

There is a misconfiguration in the NT setup that has caused this
error.  Have you altered your environment to use a variant shell, your
path altered, deleted cmd.exe the list is endless.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Thu, 4 Jun 1998 13:55:02 -0400
From: "PH" <thidinh@erols.com>
Subject: HELP:  Upload binary file with Perl script on WinNT
Message-Id: <6l6n89$6e$1@winter.news.erols.com>

I meet a problem with my script which allows upload files.   This script
looks like this:

#----------------------------------------------------------------------

open(OUTFILE,">$outfile");
    open(INFILE, "<$infile");
    binmode(INFILE);

    while ($bytesread = read(INFILE,$buffer,1024)) {
        $totalbytes += $bytesread;
        binmode OUTFILE;
        print OUTFILE $buffer;
    }

    close(INFILE);
    close(OUTFILE);

    if ((stat $outfile)[7] < 1) {
        unlink $outfile;
        &Size_Error;
    }

#---------------------------------------------------------------------------

There is no problem, when I test on my computer.  However, when I access
this script on a client computer, this script allows to upload text file
only !!!  With any binary files, this script will return &Size_Error.

Did the problem come from the script or server's setting ?  How can I
correct it ?
I'm using WinNT4.0 and IIS4

Really appreciate for any helps

Dinh




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

Date: Thu, 4 Jun 1998 14:00:53 -0400
From: "PH" <thidinh@erols.com>
Subject: Re: HELP:  Upload binary file with Perl script on WinNT
Message-Id: <6l6nj9$1kv$1@winter.news.erols.com>

If you need to test this script, you can access it at :
http://207.172.209.81/scripts/createlink4.pl  today.


Thx again,

Dinh






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

Date: Thu, 04 Jun 1998 14:41:15 -0400
From: William Sanchez <wsanchez@tribune.com>
Subject: Re: how to make a Perl program receive email under Unix?
Message-Id: <3576EA4A.920C2D93@tribune.com>

An easier implementation would be to pipe all incoming mail to your
script.
There are caveats to heed, but I've found the benefits to be far greater
than the
cons.
-William

Earl Hood wrote:

>         [mail & posted]
> In article <6kagu2$n3j@bgtnsc02.worldnet.att.net>,
> Benjamin Geer  <benjamin.geer@worldnet.att.net> wrote:
>
> >I would also appreciate any recommendations about Perl modules for
> >processing email and MIME attachments.
>
> Try <URL:http://www.oac.uci.edu/indiv/ehood/mhonarc.html>.
> Probably will do most of what you want.
>
>         --ewh
> --
>              Earl Hood              | University of California: Irvine
>       ehood@medusa.acs.uci.edu      |      Electronic Loiterer
> http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME





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

Date: 4 Jun 1998 19:34:22 GMT
From: murple@erols.com
Subject: Lotus Notes from perl?
Message-Id: <6l6sru$mc5$1@winter.news.erols.com>

I need to be able to communicate between perl scripts (running on Linux boxen)
and databases running on a Lotus Notes server (running on NT). I need to be
able to both read from and write to the Notes database. My knowledge of Notes
is virtually non-existent. I've seen that there is a C and C++ API for Notes
but it is only for Solaris and HPUX, not Linux, and even if it were available
on Linux, it would still require a perl interface be written.

Has anyone else had to do something similar? Does anyone have any ideas on how
to go about this, or suggestions on where to look for possible leads? Aside
from the C/C++ APIs, I haven't been able to find anything useful on the net.



 /-------------------------------------------------------------\ 
/| Craig Schenk       |    The statement below is the truth.   |\
\| murple@erols.com   |      The statement above is a lie.     |/
 \-------------------------------------------------------------/ 


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

Date: Thu, 04 Jun 1998 18:12:17 GMT
From: dlynch@morrisonscientific.com
Subject: Re: Module Net::SMTP
Message-Id: <3576e2f3.516356301@news.canuck.com>

On 04 Jun 1998 14:43:29 +0200, Calle Dybedahl
<qdtcall@esb.ericsson.se> wrote:

>Justin Archie <thealienz@thealienz.com> writes:
>
>> Could someone explain how to use the module known as Net::SMTP?
>
>What's wrong with the examples in the documentation?
>-- 
>		    Calle Dybedahl, UNIX Sysadmin
>       qdtcall@esavionics.se  http://www.lysator.liu.se/~calle/


You create a new Net::SMTP object.  Define the to address, the from
address, and the data content.  Use the module's mail(), to(), and
data() functions.


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

Date: Thu, 04 Jun 1998 18:47:59 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: pattern match
Message-Id: <3576c2ff.24617385@news.btinternet.com>

On Thu, 04 Jun 1998 10:21:27 +0100, Iqbal gandham wrote :

>Hi
>
>I have a text file full of lines like below
>
>
>
>NW1*,  NW8*,  SE1,  SE11,  SE17,  SE5,  SW1,  SW10,  SW11,  SW1A, 
>SW1E,  SW1H,  SW1P,  SW1V,  SW1W,  SW1X,  SW1Y,  SW3,  SW4,  SW5,  SW6, 
>SW7,  SW8,  W1*,  W1A*,  W1E*,  W1H*,  W1M*,  W1N*,  W1P*,  W1R*, 
>W1V*,  W1X*,  W1Y*,  W2*,  W8*,  W9*;D5482.htm 
>
>
>What I have is a web page where users enter in a string. I want to see
>which line contains a match, and then goto that file listed at the end.
>

London postcodes right?

>Firstly how do I either match on teh first three or four chracters,
>cause as you can see some like SW8 only have 3 charcaters in it, so if
>someone enters SW83 2ER, I need that to match just as if someone entered
>SW1V 2ER. I cant match on just the first two chracters because some SW*
>point to other files.
>

Better watch out for the extra space in the shorter ones.  I.E 
"WC1  3CJ" .    I would also throw out SW83 ( its probably somewhere
in Hampshire).  You have a problem with W1*  because you have
[wW]1[a-zA-Z] etc which are all in the West End (and which you already
have - there are no W1A* addresses where the * is not at least one
space) whereas [wW]1[0-9] puts you in Paddington, Notting Hill , West
Kensington, Shepherds Bush etc which looks like it might be out of
your scope here. 

I would suggest obtaining a list of pukka postcodes (possibly from the
Post office) and using that to match against your input file in the
first place and then using that to generate an index which you can
use.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Thu, 04 Jun 1998 19:36:46 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl and Javascript conflicts
Message-Id: <3576f29c.36806011@news.btinternet.com>

On Thu, 4 Jun 1998 12:52:49 -0400, Kushal Khan wrote :

>    I'm editing a previously created Perl script by adding some Javascript
>into it and they do not seem to be communicating well.  At the end of my
>calendar.cgi Perl script, when my form is being submitted, it calls itself
>again and sends whatever necessary variables it needs passed.  But in my
>Javascript, I have certain situations where I use the 

I dont understand.  Is this a problem with Perl with javascript or
with your understanding of CGI. ?

Dont take this bad., but if you have some Perl code that doesnt work
and you have endeavoured to overcome the problem after reading the
full range of documentation available to you then feel free to post
some code that you find doesnt work.

However, this is not an appropriate venue to be discussing Javascript
and CGI - and certainly not to be debugging other peoples broken
scripts.

 ./J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Thu, 04 Jun 1998 15:46:42 -0400
From: William Stephens <stephens.42@osu.edu>
Subject: Perl Socket connections on NT
Message-Id: <3576F9A2.5C5D@osu.edu>

All,

I am trying to connect to a remote server using a socket from NT.  I
have the connection created and opened, but I get pure junk back (ex:
 v? v? 2? 2?) when it should and does print "User ID:" via telnet.

DO any of you know what might be causing this or how to convert it to
something readable?

THanks
Bill


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

Date: Thu, 04 Jun 1998 19:42:06 GMT
From: sylviamo@my-dejanews.com
Subject: problem using LWP
Message-Id: <6l6tae$4qb$1@nnrp1.dejanews.com>

Hello,
I'm a real beginner with using perl modules, so I may be missing something
really obvious.  I would also really appreciate a pointer to some really
basic information on using modules in perl.  Here's my question:

I'm using NT, the Gurusamy Sarathy port of Perl. I'm trying to use LWP simple.

I run this, which I got directly from somebody's post here

D:\Projects\Tiger>perl -MLWP::Simple -e 'getprint "http://www.sn.no"'

 ...and get this error:

Can't find string terminator "'" anywhere before EOF at -e line 1.

I tried this:

# test LWP simpleuse LWP::Simple;
$content = get("http://biz.yahoo.com/news/biotechnology.html");print $content;
 ...and it just hangs.

Don't I need to tell it somewhere how to connect to the internet?  I'm using
a proxy server--to I need to tell it to use that somewhere?

Thanks very much for any help.

Sylvia

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 04 Jun 1998 18:25:11 GMT
From: Matthew.Wickline@usa.net
Subject: Q: please help explain why this is array context? (Was: question re: sytanx for interpolation of obj->method in qq context)
Message-Id: <6l6oq5$td5$1@nnrp1.dejanews.com>

I wrote:
> print "${\$obj->data}";
> my $foo = $obj->data; print $foo;

In an earlier message, I noted that the two above gave different results.

The problem was that the First attempt called obj->data in wantarray context
while the second did not.

So, I now know why I saw different strings getting printed, but why the heck
would that first one be an array context situation?

It looks scalar to me... :/

(please cc via e-mail)
-matt

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 04 Jun 1998 19:03:04 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Q: please help explain why this is array context? (Was: question re: sytanx for interpolation of obj->method in qq context)
Message-Id: <3576F10C.7640@min.net>

Matthew.Wickline@usa.net wrote:
> 
> I wrote:
> > print "${\$obj->data}";
> > my $foo = $obj->data; print $foo;
> 
> The problem was that the First attempt called obj->data in wantarray context
> while the second did not.

You mean "array context", of course, not "wantarray context".
In fact, "list context" is better/righter than "array context" anyway...


> ... why the heck
> would that first one be an array context situation?
> It looks scalar to me... :/

That's just the way it is.  Maybe it's a bug.
${\$x} is a specific case of the more general
${\$x,\$y,\$z}, which can also be written ${\($x,$y,$z)}.
Even though the end result is a scalar-ref, each of the
comma-separated expressions get evaluated in list context.


> (please cc via e-mail)

Sorry.  Others might benefit from this info!

hth,
John Porter


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

Date: Thu, 04 Jun 1998 13:56:16 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Regex: parens inside quantifiers: can you capture all of them?
Message-Id: <3576DFBF.5980BBBF@matrox.com>

brian d foy wrote:

> In article <357558E5.D7FFECB9@matrox.com>, Ala Qumsieh <aqumsieh@matrox.com> posted:
> >> $_ = "dog kibble biscuits pal Y bark woof";
> >> @fs = /(\w+) (?: \s+ (\w+) )* \s+ ([YN]) (?: \s+ (\w+) )*/x;
> >
> >Are you sure you want to use (?:) here? This allows the matching of what's
> >inside the brackets without the creation of a backreference! So whatever is
> >matched there won't appear inside @fs.
>
> that seems to be the point - he wants to group the whitespace with
> the word next to it.  the problem is the construct

True ... I was deceived by the (\w+) within the (?:) ... but why should that create a
reference? Don't the outer brackets (?:) prevent the creating of backreferneces to
whatever is in between??

>    (?: \s+ (\w+) )*
>
> the (\w+) does create a backreference, but since the * says to match
>

Why???

> zero or more times, it tries to match again.  if it does, the matched
> value goes into the same memory variable!  it might seem that it
> should create another memory, but that's what one gets for trying
> to guess what Perl is going to do :)
>
> >Also, the /x modifier is not needed
> >unless your regexp spreads over multiple lines.
>
> the x modifier tells the m// to ignore whitespace - all of those
> spaces between the // would be literal without them.

True again ... my mistake.

> > My solution might not be the best one, but it works:
> >
> >$_ = "dog kibble biscuits pal Y bark woof";
> >$_ =~ /^(\w+)\s*(.*)\s*([YN])\s*(.*)\s*$/x;
> >print "$1: $2 $3 $4\n";
> >
> >$2 and $4 contain a list (if any) of the foods and sounds, respectively.
>
> nope - $2 and $4 and any other thingy beginning with a $ is a scalar,
> not a list.  scalars hold single values.

I am not that good with words, am I? I actually meant that $2 and $4 contain strings
that contain the names of the foods and sounds, respectively, separated by spaces.$2
hold 'kibble biscuits pal'

I should be more careful! (at least I didn't use the word array ;-)

> furthermore, notice your own useless use of the x modifier, which
> you just (incorrectly) ranted about above!
>

Yep ... I copied and pasted whatever the original posting had, and then modified it.
I should've removed that 'x' (especially that I complained about it!)

> and then, notice how the greediness affects things!  might as well
> leave out some of those \s*, since they are useless as well!

I am learning something new everyday!

> --
> brian d foy                                  <comdog@computerdog.com>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
> Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
> Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
> this is a three regex tour!



--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





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

Date: Thu, 04 Jun 1998 18:08:24 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Regular Expressions
Message-Id: <Pine.GSO.3.96.980604110202.29617C-100000@user2.teleport.com>

On 4 Jun 1998, David Siebert wrote:

> Subject: Regular Expressions

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> I need to extract the text form between two tags
> <hw> and </hw>

This is a bigger question than it sounds like. For example, what would you
want your code to do if the string '<hw>' is found within an HTML comment
or within another tag? (Both of those can happen in valid HTML, of
course.) You almost certainly want to work only with "real" tags, and not
those pretend ones.

You (almost) always need to parse HTML to work with it like this, and such
parsing can't be done with one or two simple regular expressions. But the
HTML::Parser module from CPAN will help you to do what you need. 

Hope this helps!

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



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

Date: 4 Jun 1998 20:14:17 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Regular Expressions
Message-Id: <6l6v6p$91d@news-central.tiac.net>

In article <6l6mkb$1q48$1@news.gate.net>,
David Siebert <dsiebert@gate.net> wrote:
>I have the hardest time with these.
>I need to extract the text form between two tags
><hw> and </hw>
>help please.

You can do it without resorting to regexes using the HTML::Filter module
which can be retrieved from CPAN (the comprehensive perl archive network,
go to http://www.perl.com  and follow the CPAN link)  They're in the
libwww package, and the latest readme says:

 THE HTML MODULES ARE STILL ALPHA

 The HTML::* modules should still be regarded as being in some kind of
 alpha state.  The interfaces provided by these modules might very well
 change in future releases of this library.  You are warned!

There's an example in the HTML::Filter manual page for stripping out
tables, you effectively want to strip out everything outside hw pairs so
it shouldn't be too hard to modify the example. 

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Thu, 04 Jun 1998 11:42:57 -0700
From: Gordon Marler <gmarler@mccaw-stg.com>
Subject: Running Perl script on remote machine and returning result to script on current machine
Message-Id: <3576EAB1.DB7690D2@mccaw-stg.com>

I'm looking for the best module(s)/techniques to use to solve the
following problem.  Any hints/experiences appreciated!

On a central server, I need to use a Perl script to create files which I
need to transfer to many remote machines.  I also need to make sure that
the
files arrive on the remote machines without corruption.  Here's what I'm
currently doing:

1. The Perl script generates the files on the central server, then uses
the MD5 module to create a digest file for each file I'm going to
transfer.
2. This script then ftp's the files and their digests to the remote
machine.

Here's where I'm stuck.  I need to have the script on the central
machine do something like this:

3. The central server script then causes the remote machine to run a
small Perl script which runs another MD5 check on the files that
     were ftp'ed to the remote machine.  The result of the MD5 check is
passed back to the central machine, which will then continue if
     the check was successful, or retry the ftp transfer to the remote
machine if it was not successful.

The difficulty seems to be with having the central server script pass
the small hard-coded Perl script to the remote machine, run it,  then
pass
the result back to the central server's script.

Any ideas/suggestions/examples?

Many thanks!

--
+-------------------------------------------+----------------------------+
| T. Gordon Marler                          | LSMSA '85                  |
| Unix System Administrator                 | Work: (425) 702-2980       |
| AT&T Wireless, WLTG                       | gordon.marler@attws.com    |
+-------------------------------------------+----------------------------+





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

Date: Thu, 04 Jun 1998 12:48:54 -0500
From: "Vincent M. Probasco" <probavm@cat.com>
Subject: Search Engine
Message-Id: <3576DE06.FF221E7C@cat.com>

I need a fast search engine to search through trouble reports. I was
wondering if anyone could
refer me to an engine they have used and found very efficient.

--
Vincent Probasco
Work Hours : 12:00-6:00p.m., Mon.-Fri.





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

Date: Thu, 04 Jun 1998 18:09:41 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Search Engine
Message-Id: <Pine.GSO.3.96.980604110834.29617D-100000@user2.teleport.com>

On Thu, 4 Jun 1998, Vincent M. Probasco wrote:

> I need a fast search engine to search through trouble reports. I was
> wondering if anyone could refer me to an engine they have used and found
> very efficient. 

The one at Yahoo seems pretty good. But what does this question have to do
with Perl?

If you're trying to find an archive of downloadable software, though, the
search engine at Yahoo may turn out to be useful for you after all. :-)

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



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

Date: Thu, 04 Jun 1998 13:40:02 -0500
From: "Vincent M. Probasco" <probavm@cat.com>
Subject: Re: Search Engine
Message-Id: <3576EA02.BDD9ACCA@cat.com>

Tom, I think you misunderstood my question. I was simply looking for
advice on which search engine
to use for the following problem.

I would like the user to input some type of "Problem attributed to "
data and then the search engine
needs to return a link to a troube report. All the trouble reports are
in the same directory.  I would prefer this search engine to be written
in Perl.Any advice on a fast engine would be helpfull. Thanks,
:-)

--
Vincent Probasco
Work Hours : 12:00-6:00p.m., Mon.-Fri.





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

Date: Thu, 04 Jun 1998 17:58:50 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: seek advice on simple first program
Message-Id: <Pine.GSO.3.96.980604105015.29617B-100000@user2.teleport.com>

On Thu, 4 Jun 1998, Darrell A. wrote:

> Subject: Re: seek advice on simple first program

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> chmod +x filename? this isn't working?!! 

In what way is it not working? Is it a Unix command which doesn't do what
its docs say it should do? In that case, it's a bug in the Unix command. 
Is it Perl's chmod which doesn't recognize '+x' as a parameter? It's not
supposed to do so. 

In this case, I think you mean the Unix command isn't making your Perl
script executable. Probably that means that your system doesn't recognize
the #! line in your script, or your $PATH isn't properly set. Check with
your local expert if you're not sure. Good luck!

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



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

Date: Thu, 04 Jun 1998 14:29:28 -0400
From: suave@colba.net
Subject: Re: Submitting html form to Perl script.
Message-Id: <3576E788.AA2F8952@colba.net>

posted and e-mailed to sender

Paul Wilver wrote:
> 
>    I have Perl Win32 installed on Windows 95 using Personal Web Server
> (from the NT 4.0 option pack). I can't figure out the perl code to
> accept the input of an html form. The closest I have come is :
> #!/usr/local/bin/perl
> print "content-type: text/html\n\n";
> use cgi qw(param);
> $a=param("field1");
> $b=param("field2");
> $c=param("field3");
> print "$a\n$b\n$c";
> The output of this is document contains no data. When I was running Perl
> on UNIX,  I used $form=<STDIN> and then used code to break $form into
> individual fields. That doesn't work with the Windows 95 setup. I have
> also tried $form=<> and $form=$_. Neither worked. Can anyone tell me how
> to input form data as a string and parse it myself as I was doing with
> UNIX. I'm worried about using the cgi.pm because the latest version of
> Perl Win32 is 5.00307 and the cgi.pm has the line require 5.004; which I
> commented out to get it to run. I do have perl scripts working with this
> setup - I just can't figure out how to do html form input. I will be
> grateful for any help offered.
Try something like this:
#!/usr/local/bin/perl
use 5.004;
use CGI qw(:all);
use strict;
#declare all variables
my $field1 = param("field1");
my $field2 = param("field2");
 ....
print header,start_html;
#now you can access the variables directly like so:
print p("field number 1 is $field1");
etc... ad nauseum....

for more info, check out the documentation on CGI.pm module

Mark Steele
Technical Support Supervisor
ColbaNet Internet Inc
suave@colba.net


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

Date: Thu, 4 Jun 1998 19:14:19 GMT
From: awmyers@netcom.com (Alan Myers)
Subject: Unbuffered Input
Message-Id: <awmyersEu1K3v.94u@netcom.com>

Can I get perl to process input one character at a time
without waiting for EOF?

I've tried various combinations of select, and $|, but no 
matter what I try I still have to type return to get anything
back.  Here is the latest incarnation of my code after I
gave up:

#!/usr/local/bin/perl

select (STDIN); $| = 1;
if ( <STDIN> ) {
        select (STDOUT); $| = 1;
        print "got it\n";
}

In this example, I don't get "got it" untill after I hit return, but 
I want it after I input _anything_.

Any help would be appreciated,
Thanks,
Alan


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

Date: 04 Jun 1998 14:00:18 -0400
From: Rajappa Iyer <rsi@lucent.com>
Subject: Re: Use of HTML, POD, etc in Usenet (was: Re: map in void context regarded as evil - suggestion)
Message-Id: <xny4sy1ujwt.fsf@placebo.ho.lucent.com>

Matt Curtin <cmcurtin@interhack.net> writes:

> Rajappa Iyer <rsi@lucent.com> writes:
> 
> > > Standards.
> > 
> > Aah... so HTML is more standard than ASCII?  Thanks for this nugget.
> 
> HTML is just as standard as ASCII.  It's an open, published standard.

Practically every newsreader (at least for languages with latin
character set) on the planet will do ASCII.  HTML or POD requires special
software.  Usenet posts are expected to be readable as standard ASCII.
Marked up posts are non-standard.
-- 
Rajappa Iyer <rsi@lucent.com>		#include <std_disclaimer.h>
	We're too busy mopping the floor to turn off the faucet.


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

Date: Thu, 04 Jun 1998 19:06:53 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Use of HTML, POD, etc in Usenet (was: Re: map in void context regarded as evil - suggestion)
Message-Id: <3576F1F0.23F7@min.net>

Matt Curtin wrote:
> 
> Rajappa Iyer <rsi@lucent.com> writes:
> 
> > > Standards.
> >
> > Aah... so HTML is more standard than ASCII?  Thanks for this nugget.
> 
> HTML is just as standard as ASCII.  It's an open, published standard.

If you mean "de jure" standard, that's true.
Both have been sealed, stamped, and blessed.

But if we're talking about "de facto" standards --
there's probably nothing in the world (of computers) that
even comes close to ascii.  
That's not to say that it's *completely* universal, of course...

John Porter


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

Date: Thu, 04 Jun 1998 14:41:14 -0400
From: suave@colba.net
To: nfrenett@nortel.ca
Subject: Re: user authentication
Message-Id: <3576EA4A.E8C1B39@colba.net>

Posted and e-mailed 

Neil Frenette wrote:
> 
> I have a script which is in a directory that is .htaccess protected. This is
> a massive script which either displays a document to a user or allows the
> user to edit the document. When the user access the script they are first
> prompted for their username and password, then they can view the document.
> On this page their is a like (to the same script different argument passed
> it) which allows them to edit the script. I would like, at this point to
> prompt the user for their username and password again (different password
> file than before). all members of the project team (htpassword.all) should
> be able to read the documents. But only the members of the
> (htpassword.developers ) can edit the document.
> 
> the .htaccess takes care of the read-only access.
> Is there a way to force the user (using a dialog box like the .htaccess one)
> to enter their
> username and password againg ????
> 
> Neil Frenette
> Magellan Web Administrator
> Nortel
> nfrenett@nortel.ca

If you want to go about it that way, make your program check for two
different variables each time the program is run. First, make it check
for the remote_user variable for read only access, and next make the
program output a form prompting for full read/write access, and throw in
a hidden html variable so that if the second password field is left
empty, open for read only, else check the second password against your
read/write database, if correct proceed to read/write mode, otherwise to
read only. (Hope you are still following me here).

Mark Steele
Technical Support Supervisor
ColbaNet Internet Inc
Montreal, Quebec
suave@colba.net


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

Date: Thu, 04 Jun 1998 19:28:30 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: very quick s/// question
Message-Id: <yzCd1.99$m4.2213947@news3.voicenet.com>

Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:
>After the first execution of the first code snippet, $pattern no longer
>has any internal whitespace in it.  The remaining 2_999_999 executions
>don't have much to do.

Good point.  I was in the midst of changing half my code because the
regex seemed like it was faster.  Thanks for pointing this out.

>And, as someone already pointed out, the embedded single quotes in your
>procedural code snippet mess things up.

Thanks for rubbing it in ;) !  Cut and paste strikes again, giving me
another syntax error.

>$str = "a b c d e    ";
>
>timethese(1_000_000, {
>  'regex'       => '($str2 = $str) =~ s/(\w)\s(?=\w)/$1\*$2/g',
>  'procedural'  => '$str2 = join("*", split(/\s/, $str))',
>});
>
>
>Benchmark: timing 1000000 iterations of procedural, regex...
>procedural: 49 secs (48.97 usr  0.00 sys = 48.97 cpu)
>     regex: 84 secs (84.83 usr  0.00 sys = 84.83 cpu)

Looks like (?= pattern), while being cleaner, isn't nearly as fast as the
procedural method.  Makes me think that there are a lot of regex's that
could be re-written to be faster using Perl's functions instead.  Unless
somebody can come up with a fast regex that solves this simple problem.

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: Thu, 04 Jun 1998 19:23:55 GMT
From: glengk@mindspring.com (Glen Koundry)
Subject: Why is there no "in" operator in Perl?
Message-Id: <3576f315.106536561@news.mindspring.com>

Am I missing something or does Perl lack the ability to check if
something is part of a list,  something like this:

@l1=("ab","abc","bc");

if("ab" in @l1) {
     print "found ab\n";
}


Is there some other language construct which serves this purpose?
(grep doesn't seem to be a good choice since the "ab" in the above
example would match "abc" as well).

Glen K.
glengk@mindspring.com


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

Date: Thu, 04 Jun 1998 19:41:17 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Why is there no "in" operator in Perl?
Message-Id: <xLCd1.100$m4.2215892@news3.voicenet.com>

Glen Koundry <glengk@mindspring.com> wrote:
>@l1=("ab","abc","bc");
>
>if("ab" in @l1) {
>     print "found ab\n";
>}
>
>Is there some other language construct which serves this purpose?
>(grep doesn't seem to be a good choice since the "ab" in the above
>example would match "abc" as well).

No, grep is what you want.  You just need to anchor the regex.

@arr = qw(ab abc cab);

for $try (@arr) {
        my $num = grep(/^$try$/, @arr);
        print "Matched $try $num times.\n" if $num;
}

Produces:

Matched ab 1 times.
Matched abc 1 times.
Matched cab 1 times.

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: Thu, 4 Jun 1998 19:51:39 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: Why is there no "in" operator in Perl?
Message-Id: <6l6trf$lvd@netaxs.com>

In article <3576f315.106536561@news.mindspring.com>,
>Am I missing something or does Perl lack the ability to check if
>something is part of a list,  something like this:
>
>@l1=("ab","abc","bc");
>
>if("ab" in @l1) {
>     print "found ab\n";
>}
>
>(grep doesn't seem to be a good choice since the "ab" in the above
>example would match "abc" as well).

How about using grep and anchoring the RE? Works for me. One downside
is you look through the rest of the list after you find it.

    @l1=("ab", "abc", "bc");
    @b1 = grep (/^ab$/, @l1);
    print join('--', @b1), "\n";

or if an RE doesn't work then don't use one. (Hey doctor it hurts
when I do this)

    $x = grep ( $_ eq "ab", @l1); 
    print "$x\n";

You could also use map to do this but don't tell anyone.

-- 
Joel Coltoff

I'd explain it, but there's a lot of math. -- Calvin


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 2808
**************************************

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