[8426] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2043 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 6 17:28:19 1998

Date: Fri, 6 Mar 98 14:00:30 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 6 Mar 1998     Volume: 8 Number: 2043

Today's topics:
    Re: "Or" Operator? (David Wall)
    Re: $0: which OSes? (Mark W. Schumann)
    Re: $0: which OSes? <webmaster@fccjmail.fccj.cc.fl.us>
    Re: [Q] Connecting Win32 Perl and a DLL? <ebohlman@netcom.com>
    Re: Can I open a filehandle on a scalar? <quentin@jihad.amd.com>
    Re: Detecting Perl version at compile time <spp@colltech.com>
        error??? <merlin@wcs.nl>
    Re: error??? <steve@prilnari.com>
    Re: error??? (I R A Aggie)
        Executing a Korn Script from within Perl chris_talley@ple.af.mil
        extracting a matched pattern <jcrouse@btv.ibm.com>
    Re: extracting a matched pattern <ebohlman@netcom.com>
    Re: extracting a matched pattern (Craig Berry)
    Re: Help with perl, immediate answers wanted! (steve)
    Re: Http - URL Regexp to remove only last part if <ebohlman@netcom.com>
    Re: Installing Perl <quentin@jihad.amd.com>
        is perl 4.0 y2k compliant ? <creed@osd.ulaval.ca>
    Re: is perl 4.0 y2k compliant ? (Craig Berry)
    Re: is perl 4.0 y2k compliant ? (John Moreno)
    Re: is perl 4.0 y2k compliant ? (Mike Stok)
    Re: Length of an array? (David Wall)
        Need help. Which DB for perl/cgi ? <kim@glink.net.hk>
    Re: Newbies question for Win32 <syrnyk@cadvision.com>
    Re: Newbies question for Win32 <ptimmins@netserv.unmc.edu>
        Non Perl Question - Re: Newbies question for Win32 (John Moreno)
        Open3 for Win32 (RonaldWS)
    Re: Pattern matching? (O'Shaughnessy Evans)
    Re: Perl and the Windows clipboard <fisherm@tce.com>
    Re: Perl file mode? <cantrela@agcs.com>
    Re: QUIZ: answer and hash slice tutorial <uri@sysarch.com>
    Re: QUIZ: answer and hash slice tutorial <jdporter@min.net>
    Re: Script for RTrimming Fields (Craig Berry)
        SSI problem <merlin@wcs.nl>
    Re: Stripping (Most) HTML tags <jsd@hudsucker.gamespot.com>
        web-sheet? <Robert.Lopez@abq.sc.philips.com>
    Re: What is PERL? Learn JAVA instead? (Ilya Zakharevich)
    Re: What is PERL? Learn JAVA instead? <jdporter@min.net>
    Re: What is PERL? Learn JAVA instead? (Ken Fox)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 06 Mar 1998 21:26:48 GMT
From: dkw0@cdc.gov (David Wall)
Subject: Re: "Or" Operator?
Message-Id: <6dpq08$mkl7@cdc4.cdc.gov>

In article <34F5D10C.291C0B5F@uswest.com>, rxruck2@uswest.com wrote:
>I'm new to programming in general and perl specifically.  Here's a basic
>statement I'm having a problem with.
>
[snip]
>     if ($var1 ne 'value1' || $var1 ne 'value 2') {

Isn't this *always* true?

David Wall


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

Date: 6 Mar 1998 15:28:25 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: $0: which OSes?
Message-Id: <6dpm99$lov@junior.apk.net>

In article <kozDxdO00YUq1oods0@andrew.cmu.edu>,
Gautam Srikanth  <morpheus+@andrew.cmu.edu> wrote:
>Linux is the only system I tried where a program's ps entry matched
>changes in $0.

AIX 4.1 and 4.2 do this too.
AT&T SVR4.3 doesn't.

-- 
Mark W. Schumann | catfood@apk.net
Why should I change or hide my return address to deter spammers?
I just loop the garbage right back at 'em.


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

Date: Fri, 06 Mar 1998 21:09:33 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: $0: which OSes?
Message-Id: <350064D0.A9770F8F@fccjmail.fccj.cc.fl.us>

No, proc exists on SunOS Solaris, but
implemented a 'little' cleaner.  I have seen
procs (kprocs) which float around
as if abandoned various OpSys,
especially AIX prior to 4.1.4;
but the $0 assignment is a Perl
problem :-)

Bill

PS - Most likely resolved in a current
release (I use 5.003...);  I know, I know,
I should UPGRADE :-)



Michael Kelly wrote:

> On Wed, 04 Mar 1998 11:58:08 GMT, Bill Jones <webmaster@fccjmail.fccj.cc.fl.us> wrote:
>
> >Very interesting.
> >Maybe on Solaris the $0 become a local assignment
> >and does not propagate?
>
> Perhaps the /proc filesystem Linux uses is the link between the
> app, $0 and ps?  Just a wild guess as I believe /proc is unique
> to Linux.
>
> >
> >Bill
> >
> >
> >
> >Gautam Srikanth wrote:
> >
> >> Excerpts from netnews.comp.lang.perl.misc: 4-Mar-98
> >> Re: $0: which OSes? by Bill Jones@fccjmail.fccj.cc.fl.us
> >>
> >> > Hmmm, that's funny, on my Solaris 2.5.1 $0 reflects the ENTIRE name of the
> >> > program as invoked...
> >>
> >> That's consistent with Solaris' behavior here: the initial value of $0
> >> reflects the pathname of the program invoked.  The trouble is that
> >> assigning to $0 does not change its entry in a 'ps' at all.
> >>
> >> Linux is the only system I tried where a program's ps entry matched
> >> changes in $0.
> >>
> >> Gautam
> >>
> >> -=-=-
> >> Gautam Srikanth  -  morpheus@andrew.cmu.edu  -  www.andrew.cmu.edu/~morpheus
> >> "If opera is entertainment, then falling off a roof is transportation" (MAD)
> >
> >
>
> Mike
>
> "Genius gives birth, talent delivers."
>
>                 - Jack Kerouac
>
> (remove NOSPAM from address, if present, to reply)





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

Date: Fri, 6 Mar 1998 20:39:56 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: [Q] Connecting Win32 Perl and a DLL?
Message-Id: <ebohlmanEpF02K.Fn5@netcom.com>

Fnord Prefect <foygel@shrug.isdn.uiuc.edu> wrote:
: I've been entirely stumped by something that seems like it 
: would be easy to do - how do I connect a Win32 Perl script
: to a generic DLL?  Dynaloader stuff is Perl-specific,
: whereas I need something that will link to a DLL compiled
: from C code.

Go over to CPAN and look for a module called Win32::API which, IIRC, 
should let you call functions in any DLL.  There may be different 
versions for the ActiveState port and the Sarathy port, so make sure you 
get the appropriate version.



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

Date: 06 Mar 1998 13:01:35 -0600
From: Quentin  Fennessy <quentin@jihad.amd.com>
Subject: Re: Can I open a filehandle on a scalar?
Message-Id: <ximogzjej8w.fsf@jihad.amd.com>

"Luis J. Martinez" <luis@utdallas.edu> writes:

> I want to open a filehandle on a scalar string rather than a file, so I can
> do file operations on it. Is there a way to do this?

Check out IO::File.

-- 
Quentin Fennessy			AMD, Austin Texas


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

Date: 06 Mar 1998 15:12:04 -0600
From: Stephen Potter <spp@colltech.com>
Subject: Re: Detecting Perl version at compile time
Message-Id: <uu67lr8qxn.fsf@psasolar.private.psa.pencom.com>

lg@kt.dtu.dk (Lars Gregersen) writes:
> On Tue, 3 Mar 1998 14:44:39 -1000, Ritchard Shadian
> <rshadian@hawaii.edu> wrote:
> 
> >I have a script which includes the "use" declaration to import a couple of
> >modules.  However, when this runs under Perl 4 or earlier, the script will
> >not compile because "use" is a syntax error in the old Perl.  Is there
> >some way to detect which version of Perl is running before the script is
> >compiled?  It would be better to catch it early and return a nice
> >formatted error mesage rather than leaving the user to ponder over all the
> >"syntax error" messages produced when module subroutines are called.
> 
> require 5;

Unfortunately, this use of require did not come about until perl 5.000.
However, $] has always held the version number.  Used in a numeric context,
you can compare its value to find out what you need:

die "Perl version 5.003 or better is required to use this script\n"
    unless $] >= 5.003;

-spp

-- 
Stephen P Potter     |~~~~|                     |~~~~|   spp@colltech.com
Ph: 312-781-1111     |____| C o l l e c t i v e |____|   Team "OH, Yeah!"
Pg: 800-759-8888,    |_______                 _______|   Webstreet Securities
      571-1869              []  technologies []        jthome.jthome.com/~spp
			     a pencom company


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

Date: Fri, 6 Mar 1998 21:26:16 +0100
From: "merlin" <merlin@wcs.nl>
Subject: error???
Message-Id: <6dpm3f$bno$1@news2.xs4all.nl>

I'm new at Perl, started 3 days ago (excuse my spelling, haven't slept very
much since then) to use it for getting data from a database. I bought a book
about Perl:"Perl CGI programming" by Erik Storm. In it he states that an
'elseif'-loop should read:

if (this is true){
do this}
elseif (this is true){
do that}
else { do something else}

My perl tells me the 'elseif' should be 'elsif'.
After correcting this all my scripts work fine.
My question is: Is this a printerror in the book or does it depent on what
system I'm running?????

(I'm using Sambar server on win95 which came with a perl interpreter)

Thank you in advance,

Tjerk Stroband; aeonxs@xs4all.nl




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

Date: Fri, 06 Mar 1998 20:34:31 GMT
From: Steve Wells <steve@prilnari.com>
To: merlin <merlin@wcs.nl>
Subject: Re: error???
Message-Id: <35005F52.9E137B01@prilnari.com>

merlin wrote:

> if (this is true){
> do this}
> elseif (this is true){
> do that}
> else { do something else}
> 
> My perl tells me the 'elseif' should be 'elsif'.
> After correcting this all my scripts work fine.
> My question is: Is this a printerror in the book or does it depent on what
> system I'm running?????

definitely a typo...
STEVE


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

Date: Fri, 06 Mar 1998 16:48:52 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: error???
Message-Id: <fl_aggie-0603981648520001@aggie.coaps.fsu.edu>

In article <35005F52.9E137B01@prilnari.com>, Steve Wells
<steve@prilnari.com> wrote:

+ merlin wrote:

+ > My perl tells me the 'elseif' should be 'elsif'.
+ > After correcting this all my scripts work fine.
+ > My question is: Is this a printerror in the book or does it depent on what
+ > system I'm running?????

+ definitely a typo...

That's being generous. Either the examples where not tested, or the
publisher unilaterally changed 'elsif' to 'elseif' as a "spelling error". 
The latter could have been caught by the author when he proofed the 
galleys of the book, but that would be a rather subtle thing to find.

Don't you just love spell checkers??

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: Fri, 06 Mar 1998 15:06:55 -0600
From: chris_talley@ple.af.mil
Subject: Executing a Korn Script from within Perl
Message-Id: <6dpofo$i1d$1@nnrp1.dejanews.com>

I'm trying to execute a korn sh script
from inside a perl script. My syntax is as
follows:
system("pmq_lookup.com $vars");
pmq_lookup being the korn sh script.
This script in turn executes Oracle
Driver and then executes a sql script
which spools to a file. If I execute
this from a command prompt it works
fine, however, when it is executed
through a cgi-bin, via the web, it
seems as if the pmq_lookup.com file
isn't even called!!

Thanks for any help... I desperately need it =0(
please email me at chris_talley@ple.af.mil

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


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

Date: Fri, 06 Mar 1998 14:46:51 -0500
From: James Crouse <jcrouse@btv.ibm.com>
Subject: extracting a matched pattern
Message-Id: <350052AB.41C6@btv.ibm.com>

For some reason I can't find information on extracting a matched pattern
from a string. With the match operator I get the whole string if the
pattern matches anywhere. But what if I just want to extract the pattern
by itself. For instance if there's an integer in a string, how do I get
that integer into a variable. Any help would be appreciated.

Thanks,

James


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

Date: Fri, 6 Mar 1998 20:41:16 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: extracting a matched pattern
Message-Id: <ebohlmanEpF04t.FtH@netcom.com>

James Crouse <jcrouse@btv.ibm.com> wrote:
: For some reason I can't find information on extracting a matched pattern
: from a string. With the match operator I get the whole string if the
: pattern matches anywhere. But what if I just want to extract the pattern
: by itself. For instance if there's an integer in a string, how do I get
: that integer into a variable. Any help would be appreciated.

perldoc perlre (look for the section about capturing parentheses)



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

Date: 6 Mar 1998 21:19:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: extracting a matched pattern
Message-Id: <6dpp8q$dje$1@marina.cinenet.net>

James Crouse (jcrouse@btv.ibm.com) wrote:
: For some reason I can't find information on extracting a matched pattern
: from a string. With the match operator I get the whole string if the
: pattern matches anywhere. But what if I just want to extract the pattern
: by itself. For instance if there's an integer in a string, how do I get
: that integer into a variable. Any help would be appreciated.

perldoc perlre
perldoc perlvar

_Learning Perl_

These should enlighten you.  In fact, the info you need is in perlre; the 
others just extend and better explain what you'll find there.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Fri, 06 Mar 1998 20:40:54 GMT
From: steveh@cent.com (steve)
Subject: Re: Help with perl, immediate answers wanted!
Message-Id: <35005f49.147480973@news.cent.com>

There's no flees on you LOL

On 5 Mar 1998 02:43:17 GMT, abigail@fnx.com (Abigail) wrote:

>Brandon Blum (bblum@earthlink.net) wrote on 1646 September 1993 in
><URL: news:34FD8F46.A5FF9B1F@earthlink.net>:
>++ Hi all, I was wondering if anyone could help me with a problem, well not
>++ really problem but an answer. I wanted to write a form or something that
>++ uses a form, i test them out on my machine with ms dos. Is there anyway
>++ I could use html in that so I could see the form and enter stuff, or do
>++ I need to put it on a webserver which I don't have. If anyone does have
>++ one or a place I could put the scripts I could definetly make out some
>++ kind of deal if you did let me use it!
>
>What makes you think comp.lang.perl.misc is a more appropriate forum to
>ask then say, rec.pets.flees?
>
>Your question has *NOTHING* to do with Perl. Absolutely nothing.
>
>
>
>Abigail
>-- 
>perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
>           print+Just (), another (), Perl (), Hacker ();'



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

Date: Fri, 6 Mar 1998 20:37:30 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Http - URL Regexp to remove only last part if
Message-Id: <ebohlmanEpEzyJ.FKo@netcom.com>

John R. Long <johnr@pacificnet.net> wrote:
: I need to retain all of a url if it does not contain a file ref, If file/cgi.. then chop it off but don't chop
: off any dirs. Problem is if a dir does not have a trailing slash then it gets chopped too.. I have been trying
: to do this in regexps and am hoping that there is a standard set of code to do this. It always fails on my
: test data in some way. 

Go over to CPAN and take a look at the URI::URL module, which is full of 
nifty methods for extracting components from URLs and composing URLs from 
components.



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

Date: 06 Mar 1998 12:30:58 -0600
From: Quentin  Fennessy <quentin@jihad.amd.com>
Subject: Re: Installing Perl
Message-Id: <ximsooveknx.fsf@jihad.amd.com>

loops@wwa.com (Jeffrey A. Koester) writes:

> I'm trying to install Perl 5.004_04 on Aix 4.1.5
> When I run the make it stops with the following
> 
[...]
> ar: A file or directory in the path name does not exist.
> ar: 0707-117 The fopen system call failed on file DynaLoader.o.
> make: 1254-004 The error code from the last command is 1.
> 

Looks like you do not have this LPP installed:

	bos.rte.bind_cmds

This contains /bin/ar -> /usr/ccs/bin/ar.

Speak with your system administrator and request to have it
installed.

-- 
Quentin Fennessy			AMD, Austin Texas


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

Date: Fri, 06 Mar 1998 19:00:22 GMT
From: Carlos Reed <creed@osd.ulaval.ca>
Subject: is perl 4.0 y2k compliant ?
Message-Id: <Pine.SOL.3.91.980306140600.26765A-100000@vert>

Hi gang!


I know that perl 5.0 is compliant y2k  and has, such and such,
but I have to validate a list of sotware, so my 
question is , Does perl 4.0 is y2k compliant ?

thanks in advance, and have a nice suny warmy weekend.

Carlos Reed, from beautiful adn lovely Quebec


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

Date: 6 Mar 1998 19:59:30 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: is perl 4.0 y2k compliant ?
Message-Id: <6dpkj2$46p$2@marina.cinenet.net>

Carlos Reed (creed@osd.ulaval.ca) wrote:
: I know that perl 5.0 is compliant y2k  and has, such and such,
: but I have to validate a list of sotware, so my 
: question is , Does perl 4.0 is y2k compliant ?

There are no plans to make Perl 4 Y2K compliant.  (This is a recording.)

Seriously, don't use Perl 4 anymore.  Move to Perl 5.  Use the first
sentence above to frighten admin/management types if necessary.  Good
luck! 

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Fri, 6 Mar 1998 15:22:35 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: is perl 4.0 y2k compliant ?
Message-Id: <6C348824892AF169.E4EF1F9FB4D2588D.E6115D3722AE257C@library-proxy.airnews.net>

Carlos Reed <creed@osd.ulaval.ca> wrote:

> Hi gang!
> 
> 
> I know that perl 5.0 is compliant y2k  and has, such and such,
> but I have to validate a list of sotware, so my 
> question is , Does perl 4.0 is y2k compliant ?

No.  Upgrade to perl 5.

-- 
John Moreno
I am trying to convince the author of YA-NewsWatcher that the latest
version should be released to the public.  He doesn't think there's much
interest in a new version.  Help me prove him wrong.  To do so, send me
mail <mailto:phenix@interpath.com> with a Subject of New YA.  Comments
on what you like/dislike in the current version will be appreciated.


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

Date: 6 Mar 1998 20:48:05 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: is perl 4.0 y2k compliant ?
Message-Id: <6dpne5$6ef@news-central.tiac.net>

In article <Pine.SOL.3.91.980306140600.26765A-100000@vert>,
Carlos Reed  <creed@osd.ulaval.ca> wrote:

>I know that perl 5.0 is compliant y2k  and has, such and such,
>but I have to validate a list of sotware, so my 
>question is , Does perl 4.0 is y2k compliant ?
>
>thanks in advance, and have a nice suny warmy weekend.

people will tell you that there are no plans to make perl 4 Y2K compliant,
whatever that might mean.

Your attention might be better aimed at the applications written in perl
and the data they manipulate (and see the artilce at Does Perl Have a Year
2000 Problem?  at http://www.perl.com )  Upgrading to perl 5 may have the
(beneficial) side effect of forcing a code review of "legacy" applications
written when perl 4 was state of the art.

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: Fri, 06 Mar 1998 21:18:02 GMT
From: dkw0@cdc.gov (David Wall)
Subject: Re: Length of an array?
Message-Id: <6dppfq$mkl6@cdc4.cdc.gov>

In article <6dn8hh$mkl5@cdc4.cdc.gov>, dkw0@cdc.gov (David Wall) wrote:
>
>perl -e "$a=split(/ /,'$a is 3'); print $a"
>
>perl -e "$a=scalar ('$a','is','3'); print $a"
>
>And if I'm getting the swing of things correctly, these two one-liners are 
>just about equivalent, except for the split.  In both cases, I'm forcing a 
>list into a scalar context.


Randal Schwartz replied pointing out that I was wrong, and that I got the 
expected result only because '3' was the last thing in the list.  (The 
article has yet to make it to my news server, so I'm replying to my post)

Thanks for the correction!  It still seems a bit odd to me that something 
like

@a =            ('this', 'is', 'a', 'list');
$test1 = scalar ('this', 'is', 'a', 'list');
$test2 = scalar @a;

ends up with test1 ne test2, but I'll learn live with it.  I'd been 
thinking of "array" and "list" as interchangeable terms, but after looking 
at the definitions in the Camel, I see that I took too much for granted.

David Wall
(No relation to Larry :-)


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

Date: Sat, 07 Mar 1998 15:00:37 +0800
From: Kim Chen <kim@glink.net.hk>
Subject: Need help. Which DB for perl/cgi ?
Message-Id: <3500F095.D62FB8E8@glink.net.hk>

Hi All,

	I am going to use perl to build a large amount of members base Web
application, which may be up to over 100 thousand members record.
However, I am not familiar with perl interface Database system nor the 
Database. I gusses text-file type database is not good enough. Other
choice are :

	DBM : SDBM, GDBM...I just know their name .What's the actual diff ? Are
they good enough ?

	Berkeley DB : any good ?

	freeware RDBMS : something like Postgre and PostgreSQL. But is it very
hard to install/learn/use ? Since I have no real experience with
RDBMS. However, it seems it is the most powerful and complete one. 

	Another question is : I don't own the web site. I will put the web
application on a ISP. So I don't have any superuser access right. Can I
still install/use the package ? 

	Or any better solution ?

	Thanks a lot for your help anyway.

	regards,

	Kim 
	Please reply to kim@glink.net.hk


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

Date: Fri, 06 Mar 1998 11:20:25 -0700
From: syrnyk <syrnyk@cadvision.com>
Subject: Re: Newbies question for Win32
Message-Id: <35003E69.BB487C33@cadvision.com>



cyber giggy wrote:

> Question #1. How can I save a file in Notepad with the .pl extension
> I have try going in to my folder option in "My Computer\View\Option\Files
> types\New type." and add a new type of file.
> Question #2. Is what do I fill in the "Content type{MIME}
> Thank Q.
> Ricky37@mindspring.com

  question #1: notebook doesn't do that to me ? hmmm...is the "save as file
type" pull down menu in the "save as" dialog box on "text documents" or "all
files(*.*)".It doesn't seem to matter on mine but it's all I can think of.

question#2:leave the content type{MIME} blank
(maybe resetting this will solve prob #1)

p.s
I'm a perl newbie too, I've found the FAQ's at WWW.perl.com to be very helpful
as well as the book "teach yourself perl5" by samsnet publishing, however
working on a win32 system will make everything perl a adventure to say the
least.
I think I might go UNIX.





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

Date: Fri, 06 Mar 1998 13:10:22 -0600
From: Patrick Timmins <ptimmins@netserv.unmc.edu>
Subject: Re: Newbies question for Win32
Message-Id: <35004A1E.404B@netserv.unmc.edu>

Neither of your questions relate to perl. 

1. "File", "Save As" (as opposed to "Save"), select "All Files (*.*)
in    the 'Save as type' box, and enter the desired file name in the
'File    name' box.

2. You must return the content type you are returning or you won't (eg : 
   print "Content-type: text/html","\n\n";
   for returning html.

Buy books and read FAQ's and documentation as if it were an important
thing to do.

Patrick Timmins
ptimmins@netserv.unmc.edu

cyber giggy wrote:
> 
> Hi
> I have just downloaded Perl for Win32. and successfully installing it.
> I beginning practicing writing in Perl in Notepad. afterward when I try to
> save it with a ".pl" .  Notepad then save this as a ".txt" file.  Example:
> hello.pl.txt
> Question #1. How can I save a file in Notepad with the .pl extension
> I have try going in to my folder option in "My Computer\View\Option\Files
> types\New type." and add a new type of file.
> Question #2. Is what do I fill in the "Content type{MIME}" , "Actions:" & "
> Default extension for content type" field.
> =====Add New Files Type=====
> Description of type: Perl files
> Associated extension: .pl
> Content type {MIME}: ?????
> Default extension for content type:?????
> Actions:??????
> 
> Thank Q.
> Ricky37@mindspring.com


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

Date: Fri, 6 Mar 1998 15:22:27 -0500
From: phenix@interpath.com (John Moreno)
Subject: Non Perl Question - Re: Newbies question for Win32
Message-Id: <FF13FF0B50412841.E61318147CF287C3.8CE9709591FD12D7@library-proxy.airnews.net>

cyber giggy <cybergiggy@home.com> wrote:

> Hi
> I have just downloaded Perl for Win32. and successfully installing it.
> I beginning practicing writing in Perl in Notepad. afterward when I try to
> save it with a ".pl" .  Notepad then save this as a ".txt" file.  Example:
> hello.pl.txt
> Question #1. How can I save a file in Notepad with the .pl extension
> I have try going in to my folder option in "My Computer\View\Option\Files
> types\New type." and add a new type of file.
> Question #2. Is what do I fill in the "Content type{MIME}" , "Actions:" & "
> Default extension for content type" field.
> =====Add New Files Type=====
> Description of type: Perl files
> Associated extension: .pl
> Content type {MIME}: ?????
> Default extension for content type:?????
> Actions:??????

For cyber giggy - this has nothing to do with perl.  Ask elsewhere.

For everybody else - moderation?  self-moderation (headers and killfile
if the header is absent)?  Flame away?

-- 
John Moreno


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

Date: 6 Mar 1998 19:56:38 GMT
From: ronaldws@aol.com (RonaldWS)
Subject: Open3 for Win32
Message-Id: <19980306195601.OAA18927@ladder02.news.aol.com>

I have been doing some work lately that required the equivalent of
IPC::Open3/IPC::Open2 under Win '95.  As far as I can tell they have not yet
been ported.  Is that correct?  Is there other functionalityin the Win32
modules, that I may have missed, providing equivalent functionality?

I have managed to come up with some perl functions on my own that duplicate the
basic functionality of IPC::Open3 (i.e. create a process and redirect the three
standard handles to that process through pipes to the parent process).  If
Open3 is not yet ported is anyone interested in this work?

Ronald Schmidt.


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

Date: 6 Mar 1998 20:44:46 GMT
From: shaug@gromit.callamer.com (O'Shaughnessy Evans)
Subject: Re: Pattern matching?
Message-Id: <6dpn7u$si7$1@ha1.rdc1.occa.home.com>

In article <34FF0D27.B7AFAC80@cks.ssd.k12.wa.us>, Jerome O'Neil
<joneil@cks.ssd.k12.wa.us>'s keyboard spewed forth thus:
> Keith L. Miller wrote:
>
> > while (<PASS>){
> >     @fields = split(/:/, $_);
>
> Why do you split $_, but not use the results of that in your match?
>
> >     if ($fields[0] =~ /$FORM{'USER'}/o){
> >         print "$_<BR>";
> >     }

Not to discourage Keith from learning more about regular expressions,
but he'd probably be better off just using a regular comparison since
he's using split:

    print "$fields[0]<BR>\n" if $fields[0] eq $FORM{USER};

HTH.

-- 
- O'Shaughnessy Evans
- http://www.callamerica.net/shaug/


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

Date: Fri, 6 Mar 1998 13:29:05 -0500 
From: Fisher Mark <fisherm@tce.com>
Subject: Re: Perl and the Windows clipboard
Message-Id: <84C932393B88D111AED30000F84104A740FF8C@indyexch_fddi.indy.tce.com>

>>Is there a way of using the windows clipboard as the input file for a
>>Perl script?
>
>I haven't used it, but there is a module with the standard Win32 port
>called Win32::Clipboard that probably does what you need.

I have used it -- matter of fact, to prepare this response.  (MS
Exchange client doesn't know about the '>' convention!).
==========================================================
Mark Leighton Fisher          Thomson Consumer Electronics
fisherm@indy.tce.com          Indianapolis, IN
"Browser Torture Specialist, First Class"




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

Date: Fri, 06 Mar 1998 14:32:10 -0700
From: Andy Cantrell <cantrela@agcs.com>
Subject: Re: Perl file mode?
Message-Id: <35006B5A.C0257B20@agcs.com>

Doug Vermes wrote:
> 
> When you use the stat command to get information on a file, one of
> the values it returns is the file mode ($mode). I'm having a hard
> time making sense of this number. It certainly isn't the normal
> UNIX permissions. For example, a file with UNIX permission 600
> comes back as 33152. How do I translate from one to the other?

I only chekced this out for files:
Logic as follows:
 system("chmod 200 test_file");
 $mode = (stat FH)[2] ;
 print ">$mode<\n" ;

 system("chmod 300 test_file");
 $mode = (stat FH)[2] ;
 print ">$mode<\n" ;

-------------------------------------
Subtracting the difference from the output gave 64.
Noticed that 64(base 10) == 100 (base 8)
(i.e. the difference between the two permission values)


(stat FH)[2] == 32768 + (base 10 permission value)

-- 
Andy Cantrell
AG Communication Systems
E-Mail:  cantrela@agcs.com
Ph. (602)582-7495  Rm. X18


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

Date: 06 Mar 1998 13:21:56 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: QUIZ: answer and hash slice tutorial
Message-Id: <x7afb3wugr.fsf@sysarch.com>

? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au> writes:

> In <34FD9000.734@world.northgrum.com> Charles Margolin <cmargoli@world.northgrum.com> writes:
> 
> >Uri Guttman wrote:
> > 
> >> @array{ @array } = ( [ @array ] ) x @array ;
> 
> >Is there a reason to copy the original array into an anonymous array?
> >Why not use a reference to @array?
> 
> Yes,  if you mod the anon array it will effect the original.  This may not
> be what you want.

???

the original @array cannot be modified by the hash which refers to the
anon array. i think you meant 

> Yes,  if you mod the array ref it will effect the original.  This may not
> be what you want.          ^^^

also if you are in a loop building the hash, @array will have changing
values which requires having anon arrays with copied values.

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
uri@sysarch.com                                          Have Perl, Will Hack
http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781) 643-2710
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Fri, 06 Mar 1998 15:22:28 -0500
From: John Porter <jdporter@min.net>
Subject: Re: QUIZ: answer and hash slice tutorial
Message-Id: <35005B04.3CE1@min.net>

Uri Guttman wrote:
> 
> also if you are in a loop building the hash, @array will have changing
> values which requires having anon arrays with copied values.

Not if the @array is a lexical variable inside the loop.

	for ( ... ) {
	  my @array = yadda(...);
	  @hash{ @array } = ( [ \@array ] ) x @array;
	}

works perfectly.

John Porter


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

Date: 6 Mar 1998 19:50:44 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Script for RTrimming Fields
Message-Id: <6dpk2k$46p$1@marina.cinenet.net>

? the platypus {aka David Formosa} (dformosa@st.nepean.uws.edu.au) wrote:
: In <34FEC427.43C5@prenhall.com> Byron Lee <byron_lee@prenhall.com> writes:
: >Does anyone out there have a script for trimming spaces from
: >the end of a string?
: 
: what is wrong with s/(.*?)\s*$/$1/  (Add flags to the end of sub
: depeanding on what you think the string is)?

How's that superior to s/\s+$// ?  Seems both more direct and more
efficient. 

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Fri, 6 Mar 1998 22:00:43 +0100
From: "merlin" <merlin@wcs.nl>
Subject: SSI problem
Message-Id: <6dpo42$e8b$1@news2.xs4all.nl>

I'm using Sambar server on my network. Everything is working fine except for
one thing. Here's the situation.

file1:      start.html     (a file containing an html opening and a lot of
javascript)
file2:    end.html   (file containing html closing)

perl script:

require (sambar version of 'include' if I'm not mistaken)
"......./start.html";
print " <some variables in html format>";
require "........./end.html";

I have found that the start.html and end.html files have to contain 'print
".............";'

My questions: Is there some nice perl-trick to avoid having to reformat the
html(&javascript)code in those two files???

and if there is, could anyone tell me how I could get this to work??

Tjerk Stroband,  aeonxs@xs4all.nl




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

Date: 6 Mar 1998 20:42:35 GMT
From: Jon Drukman <jsd@hudsucker.gamespot.com>
Subject: Re: Stripping (Most) HTML tags
Message-Id: <6dpn3r$2td$1@its.hooked.net>

John Porter <jdporter@min.net> wrote:
: > :   $p->parse( <> ); # slurps all files at once
: > 
: > it doesn't work if you specify multiple files on the
: > command line. 

: You sound pretty sure of yourself.  Have you tried it?

Yes, I have.  Have you?

Please try this script and share your findings:

------------------------------------------------------------------
#!/usr/local/bin/perl -wl

use HTML::Parser;

package myParser;
use Data::Dumper;
@ISA = qw/HTML::Parser/;  # myParser is a subclass of HTML::Parser

sub start {
  my ($this,$tag,$attref,$attrary,$code) = @_;
  if ($code =~ /cgi|perl/) { print "     $code"; }
}

package main;

my $p = myParser->new;
undef $/;
$p->parse ( <> );
------------------------------------------------------------------

Here's some sample output.  The directory has several .html files in
it.

jsd@hudsucker /www/docs> ~/perl/parser *.html

jsd@hudsucker /www/docs> ~/perl/parser index.html
     <a href="/perl/pod/">
     <FORM method=GET action="http://altavista.digital.com/cgi-bin/query">

jsd@hudsucker /www/docs> ~/perl/parser index.html search.html
     <a href="/perl/pod/">
     <FORM method=GET action="http://altavista.digital.com/cgi-bin/query">

jsd@hudsucker /www/docs> ~/perl/parser search.html index.html
     <form method=post action="http://search.gamespot.com/perl/search2.cgi">

As you can see, if you specify multiple files on the command line,
only the first is processed.  The rest are ignored.  Granted, this is
probably a bug in HTML::Parser and not a general issue with <>, which
I readily admit should behave as you described.



: > also, there's no way to tell which file you're in.

: "There's no way"...  Those words tend to rub a perl
: programmer the wrong way.
: I'll grant there may not be a trivially simple way.

I'd settle for a slightly complicated way.  I don't see a way to do it 
without modifying the code of HTML::Parser directly.  That to me is a
lot more distateful than a slightly ugly loop.

-j-


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

Date: 06 Mar 1998 11:57:26 -0700
From: Robert Lopez <Robert.Lopez@abq.sc.philips.com>
Subject: web-sheet?
Message-Id: <jc6u39blka1.fsf@abqn07.ato.sca.philips.com>


I once Scott McNeily on TV talking about the concept of a "websheet".
As I recall his explanation, it is a concept similar to a spreadsheet
where the cells can have agents that fetch data items or data streams
from elsewhere on the net. Since then I have not heard any more.

Is there any work happening on this concept in the free software
world?

-- 
Robert Lopez                    <Robert.Lopez@abq.sc.philips.com>
Philips Semiconductors,   9201 Pan American Fwy. N.E.,   ms 20,
Albuquerque, New Mexico 87113 USA  [P: (505)822-7112  F: ...7237]


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

Date: 6 Mar 1998 18:55:32 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <6dpgr4$dmp$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Bart Lateur
<bart.mediamind@tornado.be>],
who wrote in article <3502e8fd.7252681@news.tornado.be>:
> It seems like letting the programmer manually invoking the (full)
> garbage collector, just like happens at interpeter shutdown, might be a
> worthwile addition to the Perl kernel.
 ...
> Well, yes. If Perl runs out of memory, the full GC should be invoked
> too. (Doesn't this already happen?)

Since Perl has no garbage collector to invoke, your suggestions are
moot.  (You can hardly call the kill-everything-that-moves stuff that
Perl does at termination a GC.)

Ilya


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

Date: Fri, 06 Mar 1998 15:27:17 -0500
From: John Porter <jdporter@min.net>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <35005C25.1443@min.net>

Matthias Neeracher wrote:
> 
> I wouldn't quite call it "mark-and-sweep", it's more like "nuke-and-pave"
> garbage collection :-)
> 
> The primary use of the GC at interpreteer
> shutdown time for "mainstream" Perl applications is to guarantee that
> destructors for all objects get called.

Gee, is nuking and paving the normal way to destroy objects? ;-)

John Porter


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

Date: 6 Mar 1998 19:51:14 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <6dpk3i$9u2@eccws1.dearborn.ford.com>

abigail@fnx.com (Abigail) writes:
> Ilya Zakharevich (ilya@math.ohio-state.edu) wrote:
> ++ Wolfgang Denk (wd@uebemc.siemens.de) wrote:
> ++ > Evan Kirshenbaum <evan@garrett.hpl.hp.com> writes:
> ++ > 
> ++ > >   - Work with cyclic structures.  (AFAIK, Perl still uses
> ++ > >     reference counting rather than true garbage collection, and so
> ++ > >     cannot reclaim them automatically.)
> ++ > 
> ++ > Your knowledge is completely wrong.
> ++ 
> ++ Instead of rebuking an absolutely correct statement, care to explain
> ++ what made you come to this (wrong) conclusion?
> ++ 
> ++ Perl has no (and will not have in any forseeable future) garbage
> ++ collection.
> 
> So, the pages 299 - 301 of the Camel are wrong?

No, the Camel is right.  But the Camel agrees with the original
statement that Perl does not reclaim cyclic structures.  On page
299:

  "One serious concern is that unreachable memory with a non-zero
   reference count will normally not get freed."

Later, on page 300:

  "If you create nodes like this, they (currently) won't ever go
   away ...

   [footnote] In other words, this behavior is not to be construed
   as a feature ... Someday, Perl may have a full mark-and-sweep
   style garbage collection ..."

Perl does have garbage collection, but it is a weak form of
garbage collection.  This is a little like the sun glass manufacturer
who advertises protection from thermonuclear explosion.  It might
work great as long as that explosion is 93 million miles away and
filtered by a hundred miles of atmosphere. ;)

Seriously, if you are doing work with cyclic structures, Perl's garbage
collection is (almost) useless.  Most of us don't work with cyclic
structures, so Perl GC works fine.  (Actually, I think ALL Perl users
must not work with cyclic structures very often.  If we did we
wouldn't be having this conversation; we'd be building a new GC for
Perl. ;)

There are lots of problems in adding "Real" garbage collection to Perl.
In fact, conservative mark-sweep might leak more memory than reference
counting and any type of compacting collector is totally out because of
the restrictions it would place on extension writers.

- Ken

-- 
Ken Fox (kfox@ford.com)                  | My opinions or statements do
                                         | not represent those of, nor are
Ford Motor Company, Powertrain           | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section             | "Is this some sort of trick
                                         |  question or what?" -- 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 2043
**************************************

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