[11748] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5348 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 10 11:07:26 1999

Date: Sat, 10 Apr 99 08:00:19 -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           Sat, 10 Apr 1999     Volume: 8 Number: 5348

Today's topics:
    Re: ActivePerl win32 and fork() ?? Does it work on any  <blazer@mail.nevalink.ru>
    Re: Adding to @INC <blazer@mail.nevalink.ru>
    Re: Best Way to handle data from a form <cramirez@gte.net>
    Re: cbc_encrypt() and cbc_decrypt() <blazer@mail.nevalink.ru>
        Couple of Questions <robsmith@yahoo.com>
    Re: dir list utility <jdf@pobox.com>
    Re: Embed Assmebler <blazer@mail.nevalink.ru>
    Re: Embedding Perl into C <dchristensen@california.com>
    Re: Executing app in win32 <blazer@mail.nevalink.ru>
    Re: fullpath() in perl? <blazer@mail.nevalink.ru>
    Re: Help with JAVA-PERL connection (Kenny A. Chaffin)
    Re: Help! Missing first line..... (Mick Farmer)
        How to Restrict CGI access? global3@my-dejanews.com
        implement useradd in perl <t0.ho@student.qut.edu.au>
    Re: Multiple page forms <wells@cedarnet.org>
    Re: Perl and Windows NT RAS <blazer@mail.nevalink.ru>
    Re: pragma - relevant? <rra@stanford.edu>
    Re: Programming a browser <blazer@mail.nevalink.ru>
    Re: Programming a browser <tripix@tdi-net.freeserve.co.uk>
    Re: protecting perl scripts <blazer@mail.nevalink.ru>
    Re: Quantum Variable (Hans-Georg Rist)
    Re: strcmpi() and toupper() in Perl (Bart Lateur)
        Text Search Program <mfo@home.com>
    Re: Thank You comp.lang.perl.misc! (Bob Trieger)
        Win95 "-e" bad file descriptor <jeb@burkby.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 10 Apr 1999 14:42:31 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: ActivePerl win32 and fork() ?? Does it work on any win platform?
Message-Id: <370F2B17.BC7EA2E6@mail.nevalink.ru>

David L. Cassell wrote:
> 
> Davekonz wrote:
> > Is fort() a working function on any win32 platform.  I know it is not on win95.
> >  Does it work on win98 or NT ( lets say 4.0 or later )..

No, look at libwin distribution(libwin-0.14 in id/GSAR) - you'll find
Win32::Process there. Win32::Process::Create() is what you are looking
for.

 
> You mis-typed fork(), but fat-fingering is a common disorder.  :-)
> No, there is no fork() on any win32 platform.  If you want, you could
> download ActiveState's build 513 which has threads as an *experimental*
> feature.

AFAIK USE_THREADS option is incompartible with PERL_OBJECT, so
ActiveState uses PERL_OBJECT while Pete (his port of 5.005_02 is at
http://www.petes-place.com) uses threads.


-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Sat, 10 Apr 1999 15:43:19 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: Scott Ranzal <scott.ranzal@mci.com>
Subject: Re: Adding to @INC
Message-Id: <370F3957.43B4F8CD@mail.nevalink.ru>

Scott Ranzal wrote:
> 
> Issue:
> 
> I would like to add to the directories that have been established for
> searching for Perl libraries.  I am currently doing the additions within the
> scripts, but have several directories that I would like to add on a full
> time basis for every script.
> 
> Is there a way to do this ?

In addition to mentioned ways:

BEGIN { @INC = qw(lib1 lib2) }

or 4 example if you want to use your private lib before the common

BEGIN { unshift @INC, "." }

etc.
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Sat, 10 Apr 1999 11:29:27 GMT
From: Carlos Ramirez <cramirez@gte.net>
Subject: Re: Best Way to handle data from a form
Message-Id: <370F3615.9A302696@gte.net>

Try:

use CGI;
$q = new CGI;

@names = $q->param;
foreach $name (@names) {
   ## Go to next name=value pair if $name does not have a value
   next unless ($value =  $q->param($name));
   ## INSERT $value into database
}

Carlos

Greg Griffiths wrote:

> I have a database generated HTML form that listed all the item in the
> database and asks you to select which ones you want to collect, the HTML
> is as follows :
>
> <tr><td width="25%">Aberdeen CU</td><td width="25%"
> align="center"><INPUT TYPE="checkbox"  NAME="1"></td>
> <td width="25%">Aberdeen MethSoc</td><td width="25%"
> align="center"><INPUT TYPE="checkbox"  NAME="72"></td></tr>
> <tr><td width="25%">Aberdeen Revelation (Rock Gospel)</td><td
> width="25%" align="center"><INPUT TYPE="checkbox"  NAME="256"></td>
>
> I need a way of handling them on the server side, I need them in
> something that I can loop through as I need to do an INSERT query for
> each, but my copy of Form-mail etc are all a bit mangled. The Pseudo
> code is as follows :
>
> if we have a positive value in the box
>         INSERT
> else
>         IGNORE
>
> my problem is that the number of entries is not fixed.
>
> Hope that this is clear enough for you all.
>
> thanks in advance for the help.



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

Date: Sat, 10 Apr 1999 15:52:02 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: bing-du@tamu.edu
Subject: Re: cbc_encrypt() and cbc_decrypt()
Message-Id: <370F3B61.91C1E59E@mail.nevalink.ru>

> I need to use cbc_encrypt() and cbc_decrypt() in my Perl code.  Which module
> are they in?  I have Perl 5.005.  How to lookup their specification?

Look at Crypt::CBC, Crypt::DES and Crypt::Idea at CPAN.
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Sat, 10 Apr 1999 08:24:58 -0500
From: Robert Smith <robsmith@yahoo.com>
Subject: Couple of Questions
Message-Id: <370F512A.3838DBAD@yahoo.com>

When working with CGI is it possible to have .pl excute a .pl within
itself??? If so how is it done?

Also it is possible to get a .pl to parse a text into itself????

Robert



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

Date: 10 Apr 1999 08:36:48 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: bluesrift@aol.com (BLUESRIFT)
Subject: Re: dir list utility
Message-Id: <m3pv5cfy8v.fsf@joshua.panix.com>

bluesrift@aol.com (BLUESRIFT) writes:

> >perldoc -f opendir
> 
> Actually, I have already tried that and am able to get a listing
> when I supply an absolute path eg /absolutepath/ but when I
> substitute a valid http:// path no listing is produced. What am I
> doing wrong?

You're making up some functionality for a Perl builtin, based on
wishful thinking!  opendir() opens a directory.  You're trying to do
an entirely unrelated thing, which is to negotiate the HTTP protocol
over a network.  You'll want the LWP (libwww-perl), available at the
CPAN.  Once you've installed LWP, getting the contents of a URL is as
simple as

   use LWP::Simple;
   $content = get('http://www.foo.com');

By the way, you didn't give an attribution for the text you quoted
above, which is kind of a no-no.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Sat, 10 Apr 1999 15:56:15 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: Remove Spam <JoshSpamNarins@aol.com>
Subject: Re: Embed Assmebler
Message-Id: <370F3C5F.BEC8847A@mail.nevalink.ru>

JoshNarins wrote:
> 
> What support, if any, is provided for rolling assembler code into my Perl
> program? I am serious.
> 
> I mean, if I want more than Perl has to offer, why stop at C?
> 
> If such an animal exists, what is there to know about it?
> Packages/Modules/Debugging/FAQs/Common errors, et cetera
> 
> If such an animal DOES NOT exist, what would a guy like me have to do to make
> it? I really do not already know what is in XS or swig support modules but
> I'll guess that what needs to be created would resemble them.
> 
> I looked around CPAN, searched on perl.com and dejanews(i.e.USENET) and nada.

Try to look at the SSLeay distribution, I did not play with it but I
remember the was something like what you want.
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Fri, 9 Apr 1999 11:14:03 -0700
From: "David Christensen" <dchristensen@california.com>
Subject: Re: Embedding Perl into C
Message-Id: <370e4277@news2.newsfeeds.com>

Michael:

>...Win98, Using ActiveState Perl build 5.009
>
>I've used the DJGPP 32bit compiler...
>...and the Cygnus B-20 compiler...
>...Visual C++ 1.0 and it is 16-bit...

Do you know what compiler was used to make your ActiveState Perl?
I suspect that you will need the same one for your C.

As an alternative, I was on CPAN a few days ago and seem to recall
that there were DJGPP binaries and ported source.  You could grab
those, assuming your DJGPP version matches...

There were also Win32 binaries and ported source for Borland C++
5.02.  I don't know if Borland sells BC5.02 by itself any more, but
it is included with C++ Builder 4 Pro (around $300 to upgrade from
VC++).

David
dchristensen@california.com






  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
    http://www.newsfeeds.com/       The Largest Usenet Servers in the World!
---------== Over 72,000 Groups, Plus    Dedicated  Binaries Servers ==--------


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

Date: Sat, 10 Apr 1999 15:37:38 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: cwidhelm@arcmail.com
Subject: Re: Executing app in win32
Message-Id: <370F3802.E97FDAEF@mail.nevalink.ru>

Sometimes Norton, McAfee or other antivirus monitors can lead to this
effect, stop monitors and try again.

cwidhelm@arcmail.com wrote:
> 
> I am in the process of writing a cgi that when invoked will launch an
> application on the server side to perform an operation.  I am sending a system
> call as follows
> 
> system( '<path><application name><application parameters>' );
> 
> After sending the system call the browser just hangs.  Any suggestions on how
> to remedy this problem?
> 
> Chris
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Sat, 10 Apr 1999 14:59:13 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: William Herrera <posting.account@lynxview.com>
Subject: Re: fullpath() in perl?
Message-Id: <370F2F01.B99B7B6F@mail.nevalink.ru>

William Herrera wrote:
> 
> I there an equivalent to C fullpath() in perl?
> 
> I mean somthing that adds the full path to a filename, performing some
> canonpath() style cleanup along the way, as in changing
> 
> "myfile.txt"
> 
> to
> 
> "/usr/text/myfile.txt"
> 
> or in win32 to
> 
> "c:\\user\\myfile.txt"
> 
> (No, canonpath() in File::spec won't do this. Maybe it's broken?)


William, for win32 look at http://jenda.krynicky.cz/perl - the module's
name is AbsPath 1.0, tested very extensivelly and works with UNC paths
also.
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Sat, 10 Apr 1999 05:59:25 -0600
From: kenny@kacweb.com (Kenny A. Chaffin)
Subject: Re: Help with JAVA-PERL connection
Message-Id: <MPG.1178eb0dedaa37d598aa89@news.dimensional.com>

In article <370e0d4a.4786702@news.ptd.net>, ldspa@postoffice.ptd.net 
says...
> I have a Perl program that creates a web page with Javascript. The
> program askes a number of questions then the user pushes a button and
> the data is posted to a 2nd perl program that takes this info and runs
> another Javascript program and creates a password.
> 
> The flow is:
> 
> Perl1 ---- creates HTML/Javascript to ask questions.
> Java1  ---- Ask questions then POST using HTML POST to Perl2
> Perl2 ---- creates Javascript to calculate the password 
> Java2 ---- Calculates password and immediatly loads Perl3
>                (no display or questions are asked) 
> Perl3 ---- Automatically E-Mail the info to me and display the
> password.
> 
 .....
> miss your answers.
> 
> Thank you in advance,
> 
> Al Manno
> 
Hmmm, I think you are talking about javascript instead of java.


Java != Javascript!!!

KAC
-- 
KAC Website Design
Custom Programming, Web Design, and Graphics
kenny@kacweb.com    -     http://www.kacweb.com


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

Date: Fri, 9 Apr 1999 10:29:42 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: Help! Missing first line.....
Message-Id: <F9x3tI.GEq@mail2.ccs.bbk.ac.uk>

Hi,

Your first <UPDF> is evaluated in a scalar context and
consumes the firsr line.  Your second <UPDF> is evaluated in
a list context and assigns the remainder of the input to
your array.

Regards,

Mick


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

Date: Sat, 10 Apr 1999 13:46:48 GMT
From: global3@my-dejanews.com
Subject: How to Restrict CGI access?
Message-Id: <7enko7$in3$1@nnrp1.dejanews.com>

Hi All,

I am trying to modify the access.conf server configuration file to
restrict CGI access from remote hosts to CGI files in a particular
directory yet allow CGI access in the same directory for visitors to my
web site (i.e., people who come using their browsers). I have been trying
this code:

<Directory /usr/www/mydir/httpd/htdocs/high/links>
  Options - ExecCGI
  order deny,allow
  deny from all
  allow from 200.1.12.96
</Directory>

In the actual code I used, the IP address is that of my web site but
the IP address 200.1.12.96 above is a false IP address that I'm using
just to post this message. The problem is that this code also restricts
the browser visitors to my site who want to use the cgi forms on my site.

If anyone knows how I can achieve this then please let me know. I'll
appreciate it if you post your anwser to this forum for everyone's benefit.

Thank you very much and I'm looking forward to hearing from someone soon.

Best regards,
Alan

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 11 Apr 1999 00:21:25 +1000
From: "Jonathan Ho" <t0.ho@student.qut.edu.au>
Subject: implement useradd in perl
Message-Id: <7enmqb$6n4$1@dove.qut.edu.au>

How do i write the perl shell script to implement the "useradd " command?

regards
Jonathan





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

Date: Sat, 10 Apr 1999 12:41:56 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: Multiple page forms
Message-Id: <370F4714.3092BB07@cedarnet.org>

Alan Gilman wrote:
 
> Is there a clear set of directions on how to create multiple page forms.
> I have many good working HTML forms using Perl on my Web server, but I
> would like to know how to gather information from multiple form pages
> before creating the final input.

Check out the section on: 
   SAVING THE STATE OF THE SCRIPT TO A FILE:
within the CGI module.

With this you can save the name/value pairs
to a file and move through a series of forms
saving the new state each time.

or...

You could simply pass each variable as a hidden field 
to the next form.

or ...

You could save your variables as cookies and read them
into your program at the final stage.


As far as a clear set of directions goes I would highly recommend
reading through the CGI.pm module and take note of the various 
techniques Lincoln Stein and others have developed to have a program
save it's state information.

HTH,
STEVE
-- 
-----------
Stephen D. Wells
http://expert.cc.purdue.edu/~bgannon/booksearch/


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

Date: Sat, 10 Apr 1999 15:06:55 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: "Justin K. Hertog" <jkhertog@worldnet.att.net>
Subject: Re: Perl and Windows NT RAS
Message-Id: <370F30CF.45DB9541@mail.nevalink.ru>

Justin K. Hertog wrote:
> 
> Does anyone know a way to schedule RAS to dial to a phonebook entry and
> download a file via FTP.  How could this be done?  I'm interested in
> scripted solutions mostly (WSH, Perl, VBScript, etc.)

Justin, look at my page (link bellow) at Win32::DUN - it's the old one
but works perfect on Win95 and in 90% cases on NT too (depends on
registry configuration).

It can Dial the selected DUN/RAS entry, HangUp, Autodial and some more.

Now I'm testing much more powerful thing - Win32::RASE, that implements
almost whole RAS API functionality and some of TAPI. It could manage DUN
entries, properties, credentials, phonebooks (in part), dialing
locations etc. It already works 100% on Win95 but unfortunatelly I have
no NT handy, there still are some errors on NT. Mail me if you'd like to
try it.
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: 10 Apr 1999 05:39:37 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: pragma - relevant?
Message-Id: <yld81cir92.fsf@windlord.stanford.edu>

JTJ <elssa09@callisto.si.usherb.ca> writes:

> Sam: I have answered your queries from time to time. Now I'm looking for
> an answer to a question.

> We all use "Content-Type: text/html" from time to time, don't we?  Has
> anyone had any problems/experience with "Pragma: no-cache"?

> Does anyone know where I might look for a little help on my Pragma prob?

comp.infosystems.www.authoring.cgi, a newsgroup full of people doing CGI
programming, as opposed to this newsgroup which contains a lot of readers
and posters who, like me, will be happiest if they never have to touch
another CGI script again.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Sat, 10 Apr 1999 15:32:15 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: Akihiko <akihiko42@yahoo.com>
Subject: Re: Programming a browser
Message-Id: <370F36BF.9812F0F9@mail.nevalink.ru>

Akihiko wrote:
> 
> I'm pretty new to Perl and I was wondering, how feasible is it to
> program a graphical web browser all in Perl using Tk for the display?
> What features of Perl lend to this type of development? Thanks.

I guess LWP(libwww) and Net::FTP (if you are planning to implement FTP
also). On Win32 the easiest is to use Win32::Internet. You'll need to
implement multithreading or at least multiprocessing - it's too long to
wait file by file. There also is LWP::ParallelUA.pm (did not try on
Win32).
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Sat, 10 Apr 1999 12:49:53 +0100
From: "Wayne Keenan" <tripix@tdi-net.freeserve.co.uk>
Subject: Re: Programming a browser
Message-Id: <7enee5$iar$1@news6.svr.pol.co.uk>


Mike Blazer wrote in message <370F36BF.9812F0F9@mail.nevalink.ru>...
>Akihiko wrote:
>>
>> I'm pretty new to Perl and I was wondering, how feasible is it to
>> program a graphical web browser all in Perl using Tk for the display?
>> What features of Perl lend to this type of development? Thanks.
>
>I guess LWP(libwww) and Net::FTP (if you are planning to implement FTP
>also). On Win32 the easiest is to use Win32::Internet. You'll need to
>implement multithreading or at least multiprocessing - it's too long to
>wait file by file. There also is LWP::ParallelUA.pm (did not try on
>Win32).
>--
The Tk help page describing the text widget documents the ability to
embed user defined actions to be executed when clicking on regions of text,
i.e embedding perl code and execting it, thus you can:
get the URL the text relates to and also you have perl as a scripting
language in your browser, very nice.
Oh, and you can embed piccys too, I think, perl mod GD might do it.

Wayne




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

Date: Sat, 10 Apr 1999 14:48:46 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: Bill Jones <bill@fccj.org>
Subject: Re: protecting perl scripts
Message-Id: <370F2C8E.1CC07CA6@mail.nevalink.ru>

> > Is there anyway to protect my scripts from being copied, such as compiling
> > to an executable form for distribution?
> >
> > I have worked hard on a socket program here at work that will allow real
> > time information to be passed from our mainframe to a Unix or wintel system.
> > Now that some have caught wind of its future potential, they want to use it,
> > forgetting about who made it all possible in the first place. They want to
> > take credit for the entire endeavor, not just the glossy candy coat they may
> > have applied to the surface.
> >
> > I guess this is my "Welcome to the Business World".
> >
> >
> 
> Um, no ...
> 
> Welcome to the 'Open Source' world.
> 
> ( I've always wrote things that I enjoyed; with the hopes
>   that someone would find them useful.  I've always gotten
>   paid for everything else.... )

Yes "being kind to kind beings" ;)

still there are some ways. For example

#!/usr/bin/perl -ivoa{]#s/j[Br'(@)tp+h*kcni.lf,$gm
sub s{$;[++$#{;}]||=s;.*$;$_[$[];&&$;&&$_}&s('MG!R:6YT(")-:6ME($)L'.
'87IE<B`\8FQA>F5R7$!M86EL+FYE=F%L:6YK+G)U/%EQN(CL(`');&s('TF=~`_CW'.
'OO9uU`Z6<L0SL9uU`Z6<LuL9~DC|WT;;|JHP1--2GEFEF}A??F!FN=~DC|WTF}e4Z'.
'_ `Z6<L0SL9&JCULL9TF;');eval"y;4JZEN!~O&A0HLPTGW`?DS<6UC\\-_|9F>R".
";$^I;;";eval;

is created prorammatically ;)
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Sat, 10 Apr 1999 11:25:07 GMT
From: hans-georg@rist.net (Hans-Georg Rist)
Subject: Re: Quantum Variable
Message-Id: <370f34ca.5732518@news.uni-ulm.de>

Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu> wrote:

>You should either use double quotes or . joins, but not both;
>either:$file = '../dir/dir/dir/' . $country . '_' . $machine;
>or, preferably (at least to me):
>$file = "../dir/dir/dir/$country_$machine";

should be:
$file = "../dir/dir/dir/${country}_$machine";

HG

-- 
Hans-Georg Rist
hans-georg@rist.net


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

Date: Sat, 10 Apr 1999 11:05:35 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: strcmpi() and toupper() in Perl
Message-Id: <370f2e2c.1572392@news.skynet.be>

Glenn T. Jayaputera wrote:

>As a really really really newbie in Perl, I am having a difficulty
>in finding the equivalent functions of strcmp() and toupper() in Perl.

"Equivalent"? PErl is better! ;-)

In fact, there are several ways of achieving these.

Change to upper case:

	$text = "Hello!\n";
	print uc $text;
	print "\U$text";

Compare strings: eq, ne, lt, gt, cmp. See perlop (pod/html).

Actually, if you want powerful string processing, don't use just "eq" to
compare strings, but hashes and regexes too.

	if($name eq 'Bart') {
		print "Guessed it!\n";
	} 

	if($text =~ /\bBart\b/i) {
		print "My name is in there!\n";
	}

	%names = ( Bart => 1, Glenn => 2 );
	if($names{$name}) {
		print "I recognize the name...\n";
	}

	Bart.


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

Date: Sat, 10 Apr 1999 13:11:11 GMT
From: "Michael O'Connor" <mfo@home.com>
Subject: Text Search Program
Message-Id: <P5IP2.5094$LM.10322@news.rdc1.mi.home.com>

Hello,

I'm working on a project that is to have a user input a text string and then
search for that text string in a bunch of text files.  Then I am to display
those text files that have that text string in it.  I would like to use
windows or an internet browser to ask for the input and to display the
output.  I am using Windows 98 on a stand alone machine.  I have been
investigating Perl for doing the text searching.  I have had difficulty
using Perl to drive my internet browser.  Perl is designed for a Unix
environment not for a windows environment.  Perl wants to only open up a
text window.  Does anyone know drivers for windows or internet browsers
using Perl? Should I be using a different programming language? Any
suggestions?

Thank you for your help!

Please send information to my email: mfo@home.com.

Mike




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

Date: Sat, 10 Apr 1999 12:56:07 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Thank You comp.lang.perl.misc!
Message-Id: <7enhl7$59d$1@fir.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
Uri Guttman <uri@home.sysarch.com> wrote:
>>>>>> "JS" == Jonathan Stowe <gellyfish@gellyfish.com> writes:
>
>  JS> On Fri, 09 Apr 1999 09:36:29 -0700 Aaron Dickinson wrote:
>  >> I posted a question about directory traversing on 4-8-99 and within just
>  >> an hour I received several replies which should solve my problems, each
>  >> in a different way.  
>
>  JS> Look you cant go around saying things like that ...  we're
>  JS> supposed to be a bunch of hard-assed money grabbing bastards dont
>  JS> you know ?
>
>speak for yourself, you unselfish, perl philanthropic, tireless rescuer
>of newbies!
>
>i charge for my time on clpm. but nobody seems to pay me!

Uri,

Somebody is cashing those checks I've been sending you!



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

Date: Sat, 10 Apr 1999 12:33:20 GMT
From: Joe Burpee <jeb@burkby.com>
Subject: Win95 "-e" bad file descriptor
Message-Id: <370F45C4.32DBE65F@burkby.com>

I notice this problem has been posted here before, but I haven't seen a
solution.  Using AcivePerl builds 509 or 514, I get the message "Bad
file descriptor" on "-e", even with something basic like
  perl -e "print 'xxx'"

The same problem occurs on two separate Win95 installations, but not on
a third.  Of course, with Perl under Linux, no problem at all.

The man page refers to
  "/tmp/perl-e$$" temporary file for -e commands
and I assume on Win95 that would be \tmp\.  Is there something else I'm
missing?

Joe


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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