[8436] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2053 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 8 22:09:00 1998

Date: Sun, 8 Mar 98 19: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           Sun, 8 Mar 1998     Volume: 8 Number: 2053

Today's topics:
    Re: Another RegExp Question <mgk13002@bayou.uh.edu>
        Conversion from Cshell to Perl <dhwright@mindspring.com>
        Cookie extraction via Perl <brent@sympatico.ca>
        eval <hold@cglis.com>
    Re: Extract URL from search query <scriptabuser@127.0.0.1>
        how to abort sendmail process in perl    (123) (Nick Halloway)
        how to automate the many web link pulls to my disk thierry.metoudi@hol.fr
        how to automate the many web link pulls to my disk thierry.metoudi@hol.fr
        install question... <dsmayer@msn.com>
    Re: NTPerl, get inet addr or name without the other? (Vincent Fatica)
        Perl & Cookies: How do I delete once a person leaves my <poohba@io.com>
    Re: Perl longfilenames w/ win95 scott@softbase.com
        Perl On NT Mastered <mark@imp.net>
    Re: Pw32i302...now this is just plain frustrating! <camerond@mail.uca.edu>
    Re: Q: obscuring Perl scripts? (John Stanley)
        random numbers? mwsasser!nospam!@timetrend.com
    Re: random numbers? <danboo@negia.net>
    Re: random numbers? (Vincent Fatica)
    Re: RegEx Quiz Question <webmaster@fccjmail.fccj.cc.fl.us>
    Re: returning immediately from system call? <joat@series2000.com>
        Sarathy port of perl for Win32 thinks it's a dos progra pramsey@iname.com
    Re: Search Scripts (Burt Lewis)
    Re: The -w switch (was Re: better way to do this?) (Ilya Zakharevich)
    Re: The -w switch (was Re: better way to do this?) <r.kielty@xtra.co.nz>
    Re: Urgent! Help Want On Developing Scripts <uri@sysarch.com>
    Re: Using perl to do what a spreadsheet does but with a <edudley@servtech.com>
    Re: What is PERL? Learn JAVA instead? <evan@garrett.hpl.hp.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 08 Mar 1998 14:21:29 +0000
From: Marion King <mgk13002@bayou.uh.edu>
Subject: Re: Another RegExp Question
Message-Id: <3502A968.2B54@bayou.uh.edu>

My appologies to everyone. This was not meant to seem as a hoax. My news
reader is somewhat sucky. However, you'll accept my appology, here is
the
original message.

>Hi everyone. I've been searching the O'Reilly book, but I can't
>seem to find what I need. I have this chunk of code that parses
>through a mailbox and tries to reformat the messages for some
>other program. Only problem, when I try extracting things from
>those header lines in mail msgs, my script is excluding everything.
>Here's a snippit. Can someone point out if I'm probably trying to
>match the wrong type of pattern? Thanks in advance.

>example line from mail-
>        From: me@this.location
>        To: You da man <you@your.location>

>should set into a assoc. array like this-
>        $array{'From'} = $1...etc.

>        while (@data)   {
>                if (/^(.*): (.*)$/)     {
>                        $reformat{$1} = $2;
># fuzzy as whether or not to use this statement
>#                       $reformat{'$1'} = $2;
>                }
>        }

>I guess, from this 2nd look at it, it's interpretting all the lines of
>the mail message as a possible match. However. I'm under the assumption,
>that the even though it could catch it all, that ":" added to the pattern
>would force it not to match anything else that didn't fit. Am I wrong in
>this assumption and need to go reread? or just misguided? Once again,
>thanks to all for any help given.

>        Cheers,
>        Marion


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

Date: Sun, 08 Mar 1998 16:14:30 -0500
From: Dave Wright <dhwright@mindspring.com>
Subject: Conversion from Cshell to Perl
Message-Id: <35030A36.42CD@mindspring.com>

Anyone know of automated utilities or information to help 
convert production CShell scripts to Perl? Thanks!

Dave Wright
dhwright@mindspring.com


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

Date: Sun, 08 Mar 1998 20:17:08 -0500
From: Brent Mondoux <brent@sympatico.ca>
Subject: Cookie extraction via Perl
Message-Id: <35034314.22E92CBF@sympatico.ca>

I have two books on Perl and neither of them cover the extraction and
reading of a cookie.  Odd enough... anyhow I was wondering if anyone
could be so kind to send me some code that can extract a cookie that I
wrote to the client using javascript?  The cookie is called "username"
by the way.

Thanx in advance...
Brent



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

Date: 9 Mar 1998 00:24:08 GMT
From: "Christopher Lambrou" <hold@cglis.com>
Subject: eval
Message-Id: <01bd4af1$f127c0d0$a66f6420@akis>

This is the code in question:

eval {
  &foo;
};
print $@ if $@;

sub foo {
 # blah, blah, blah
 return; 
}

Question is: Will eval catch a runtime error inside sub foo?
Or should I include sub foo { } inside the eval block?

Also, how do I trigger a run time error? In VB 
we just say "Err XXX" and that's it.  Will 'die' do the
same thing in Perl, assuming I'm insite an eval? 

Thanx,
CLambrou



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

Date: Mon, 9 Mar 1998 02:15:36 +0000
From: Mark Worsdall <scriptabuser@127.0.0.1>
Subject: Re: Extract URL from search query
Message-Id: <MIqPlCAID1A1EwcX@worsdall.demon.co.uk>

In article <8CRc6xDxc0$0EwXE@worsdall.demon.co.uk>, Mark Worsdall
<scriptabuser@127.0.0.1> writes
>Hi,
>
>I am trying to work out how to get url address to splitt. Note it could
>be an address without subdirectorys or one with, i.e.:-
>
>WITH:    http://www.altavista.digital.com/cgi-bin
>WITHOUT: http://www.altavista.digital.com
>
>So using one of these modules I guess...
>use LWP::UserAgent;
>use HTTP::Request;
>use HTTP::Response;
>use HTML::Parse;
>use URI::URL;
> but which one:-)
>
>Below is an example of data given.
>
>$referer = "http://www.altavista.digital.com/cgi-bin/query?pg=q&stq=50&w
>hat=web&kl=XX&q=building+the+core+muscles+of+the+athalete&navig60.x=7&na
>vig60.y=11";
>

Has no one any ideas on this?

-- 
Mark Worsdall (Webmaster) - WEB site:- http://www.shadow.org.uk
Shadow:- webmasterATshadow.org.uk    
Home  :- shadowwebATworsdall.demon.co.uk
Any opinion given is my own personal belief...


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

Date: 8 Mar 1998 20:59:15 GMT
From: snowe@rain.org (Nick Halloway)
Subject: how to abort sendmail process in perl    (123)
Message-Id: <6dv0r4$g7g$1@news.rain.org>

I'm working on modifying a program which opens a sendmail process that's
attached to a filehandle.  The program writes out a mail message to the
filehandle, then when the filehandle is closed, the mail is sent.

Is it possible to abort this process after it's started, so that the
mail isn't sent?  Would clearing out the filehandle somehow do this?
I tried 

truncate (FILEHANDLE, 0); 

but that didn't work.  

Thanks much.



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

Date: Sun, 08 Mar 1998 18:08:56 -0600
From: thierry.metoudi@hol.fr
Subject: how to automate the many web link pulls to my disk
Message-Id: <6dvbsn$vut$1@nnrp1.dejanews.com>

Hi, I've just discovered Perl and I'd like to solve this problem:

 I want to automate the pulling of links from the web to my hard drive, for
instance the many web pages ("my Yahoo",  "news.com", a cgi returning a chart
or a map.

Is it possible to replace the mouse clicks and the keystrokes done with the
browser and have the information searched, and saved onto the disk.
(A kind of macro, to which I could give parameters)

(I'm working on win 95 and have a DOS version of Perl)

Thanks
--
Thierry METOUDI:  thierry.metoudi@hol.fr

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


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

Date: Sun, 08 Mar 1998 18:07:29 -0600
From: thierry.metoudi@hol.fr
Subject: how to automate the many web link pulls to my disk
Message-Id: <6dvbpv$vuk$1@nnrp1.dejanews.com>

Hi, I've just discovered Perl and I'd like to solve this problem:

 I want to automate the pulling of links from the web to my hard drive, for
instance the many web pages ("my Yahoo",  "news.com", a cgi returning a chart
or a map.

Is it possible to replace the mouse clicks and the keystrokes done with the
browser and have the information searched, and saved onto the disk.
(A kind of macro, to which I could give parameters)

(I'm working on win 95 and have a DOS version of Perl)

Thanks
--
Thierry METOUDI:  thierry.metoudi@hol.fr

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


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

Date: Sun, 8 Mar 1998 16:36:40 -0500
From: "Dave and Sharon Mayer" <dsmayer@msn.com>
Subject: install question...
Message-Id: <e8HhlitS9GA.210@upnetnews02.moswest.msn.net>

I'm trying to install Perl for win 32 on my Win 95 computer.  I've gone
through the extract of build 315, and try executing the "cmd32.exe"
executable, and then I have a problem.  the executable appears to open, and
then it quickly quits.  does anyone have any suggestions for me??  I'd
appreciate it....






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

Date: Sun, 08 Mar 1998 21:32:36 GMT
From: vefatica@syr.edu (Vincent Fatica)
Subject: Re: NTPerl, get inet addr or name without the other?
Message-Id: <35030bcc.744644382@news.ican.net>

Earlier, I asked:

>With NT Perl (5.001) is it possible to (and how might I) get either the internet
>name or internet address of the local computer without knowing the other (NT
>4.0, dial-up, dynamic address/name)?

This seems to work: give gethostbyname() the NT computer's "local" name (e.g.,
my computer calls itself "cockpit"); a valid (dialup) IP address is returned ...
give it to gethostbyaddr() to get the IP name. Here's a code fragment:

	($w, $x, $y, $z, @addrs) = gethostbyname("cockpit");
	$ipaddr = join(".", unpack("C4", $addrs[0]));
	if ( $ipaddr ne '127.0.0.1' ) {
		($ipname) = gethostbyaddr($addrs[0], AF_INET);
	}
	else {
		$ipname = 'offline';
	}

 - Vince

___
   Vincent Fatica
   Syracuse University Mathematics
   vefatica@syr.edu
   http://barnyard.syr.edu/~vefatica/


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

Date: Sun, 8 Mar 1998 20:20:53 -0500
From: Chocolate <poohba@io.com>
Subject: Perl & Cookies: How do I delete once a person leaves my site?
Message-Id: <Pine.BSI.3.96.980308201850.13476A-100000@xanadu.io.com>

Is it possible to delete a cookie once a person leaves my domain?  If so
how?

  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

			_/_/_/		     _/     _/
		       _/  _/	            _/     _/		
  Web Page Designs    _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ choco@duke.edu 
    Small Programs   _/     _/   / _/  _/ _/  _/ _/  _/ _/  _/  poohba@io.com
www.io.com/~poohba  _/	   _/_/_/ _/_/_/ _/  _/ _/_/_/ _/_/\_ 	(919)506-5883

  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/



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

Date: 8 Mar 1998 21:44:48 GMT
From: scott@softbase.com
Subject: Re: Perl longfilenames w/ win95
Message-Id: <6dv3gg$grm$2@scully.new-era.net>

bspiker@wiesbaden.netsurf.de wrote:

> This might be a newbie question, but I can't figure out how you can
> get a long-filename passed into Perl 5.03 as a long-filename.

I've never had any problem with it at all! I routinely use Perl
with "long" file names. (I never pay any attention to the distinction
anymore -- all mine are long.)

> I have create a short bat file that I've placed in the Windows
> "SendTo" directory. This way I can use the Windows Explorer...

STOP!!! You said the magic word: Explorer. Explorer's drag-and-drop
and Send To are hopelessly broken. They use only the short file
names. This is a terminal disease: the only cure is not to use
the program for this purpose. The reason for this has something
to do with backward compatibility.

> However I can't find any means to invoke a perl script directly
> from Windows 95.

Open a command prompt. Send To is overrated.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Sun, 8 Mar 1998 20:31:06 -0500
From: "Mark Polakow" <mark@imp.net>
Subject: Perl On NT Mastered
Message-Id: <6dvhhq$elf$1@viper.america.net>

I have successfully set up Perl on NT IIS4.0 - I have a number of good
scripts running including webboards, guestbooks, file upload, and the IMP
Free Web Page Lite Site at http://lite.imp.net
The lite Site will auto generate a perm web page for you based on some
graphics you choose and your content, you can go back and edit it at any
time. There is a custom version of this that allows you to use full HTML and
create a fully formatted web page just the way you want it! You can even cut
and paste html from a webeditor into the form field and generate your own
homepage.
I would be glad to share the secrets of Perl and NT with any who need help!




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

Date: Sun, 08 Mar 1998 14:37:47 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: Mark Stackhouse <stackhou@execpc.com>
Subject: Re: Pw32i302...now this is just plain frustrating!
Message-Id: <3503019B.A359DC3A@mail.uca.edu>

[cc'd to MS]

Mark Stackhouse wrote:
> 
> HELP... I downloaded Ps32i302.exe and ran it from my
> Windows95 "run".  

First, why are you using pw32i302? The AS Build 315 is out there, don't
cripple yourself with old code. 

> The install MS-DOS batch file
> automatically launched and installed Perl.  So far... no
> problem!  I then used "Notepad" to enter the "Hello World"
> program right out of my "Learning Perl" book.  HOW DO I RUN
> THE SCRIPT???  If I try to run it from a DOS prompt, I'm
> told that the program can't be run from DOS.

Are you sure that's what you did, "Start > Programs > MS-DOS Prompt"?
That's the way it's supposed to work (and that's the way it _does_ work
for me). Or did you "restart computer in DOS mode." That doesn't work,
no matter what it sounds like. I don't know *what* that's good for.

In Win95, you don't run the script, you run "perl nameofscript.pl"
(assuming the path to perl.exe is in your PATH statement in
autoexec.bat) just as if you were entering commands one at a time (In
WinNT, supposedly you can just run "nameofscript.pl" after you have set
the associations). 

Are you using the gecko or the llama? If you have the llama, try to get
someone to buy it off you and get the gecko, if you are going to
continue to run perl in a Windows environment.

> If I try to
> run it with Windows95 "run", it launches Notebook with my
> source!!!  What gives?  

What is Notebook? Do you mean Notepad? If this is a way for generating
notebook computers, it doesn't seem like a problem for anyone but the
manufacturers who are going to be losing big bucks. ;^) If you try to
run it this way (perl name.pl), you will get a DOS box which exists for
exactly the amount of time it takes to run the script, then
auto-selfdestructs. Not very useful unless you slow your system clock to
a KHz or so. 

> I feel dumber than dirt!

Dirt's not really dumb, just old.

Cameron Dorey
camerond@mail.uca.edu


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

Date: 8 Mar 1998 23:33:17 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Q: obscuring Perl scripts?
Message-Id: <6dv9rt$2u$1@news.orst.edu>

In article <3502C9DA.54FB@nicom.com>,
Steve Palincsar  <palincss@nicom.com> wrote:
>Utter drivel, John.

Get a grip, Steve.

>In the first place, what has my mailer at home got to do with
>anything?  If you think it does, shame on you.  Although unfortunately
>widely shared, such attitudes IMO have no place in this forum.

You were commenting on the fact that some code was unreadable and that
you would not even test such code. I was pointing out to you that
you not only test code that you can't read, you run it. I said nothing
negative about Netscape or the fact that you use it, only that you do
use it and that it is more obfuscated than the perl code you were
complaining about.

>In the second place, responding to the best possible interpretation of 
>your ad hominem slur, 

It was not ad hominem. I was pointing out that you needed to chill out
on your attitude towards unreadable code since you really actually do
use it. I didn't call you any names, nor make any comments about your
intelligence.

>to me there's a world of difference between apps 
>distributed as binary code and those distributed as source, 

Yes, there is, but not when you make claims about using code that you
can't read. If your inability to suss out the source of a perl script
when you get it is "bad", then it must be as bad that you can't suss out
the source for a binary executable like Netscape. In both cases you
can't work with the source.

>One doesn't need to read too far to discover a vast literature
>of proper coding standards.  

Yes, there are. How do you know that Netscape follows them if you can't
read the source? Since many of those standards are in place to aid the
authors in maintaining code, and the author of the perl code you
complained about certainly has the unobfuscated source, the standards
can't be the issue. He can maintain the source just fine.  You can't.
Neither can you maintain Netscape source. Or the Windows source that
you run the Netscape on. 

>the line following, but no general disagreement that code should be
>readable, well formatted, well commented, and should make its intentions
>clear.

I bet the source that the author has is well formatted, commented,
etc.  Since that is the source that is being maintained, it meets the
criteria fine. It's only the obfuscated code that you can't maintain,
just like you can't maintain the source for Netscape because it has
been obfuscated by a compiler.



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

Date: Mon, 09 Mar 1998 00:07:22 GMT
From: mwsasser!nospam!@timetrend.com
Subject: random numbers?
Message-Id: <3504323b.74917305@news.ax.centuryinter.net>

	I'm trying to generate real random numbers but all I generally
get are numbers from 8 to 14 when I try adding 3 random numbers from 1
to 6.  Should not 9 be the average number here?  I'm trying
int(rand(6)+1)   what am I missing?


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

Date: Sun, 08 Mar 1998 20:51:28 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: Re: random numbers?
Message-Id: <35034B20.BEF6C79B@negia.net>

mwsasser!nospam!@timetrend.com wrote:
> 
>         I'm trying to generate real random numbers but all I generally
> get are numbers from 8 to 14 when I try adding 3 random numbers from 1
> to 6.  Should not 9 be the average number here?  I'm trying
> int(rand(6)+1)   what am I missing?

hmm 9?

#!/usr/bin/perl -w
my @nums = (3..18);
my $total = 0;
for (@nums) { $total += $_; }
print $total/@nums, "\n";

your expectations are a bit off, but your results seem quite reasonable.

hope this helps,

dan


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

Date: Mon, 09 Mar 1998 02:37:21 GMT
From: vefatica@syr.edu (Vincent Fatica)
Subject: Re: random numbers?
Message-Id: <35034ede.761814180@news.ican.net>

On Mon, 09 Mar 1998 00:07:22 GMT, mwsasser!nospam!@timetrend.com wrote:

>	I'm trying to generate real random numbers but all I generally
>get are numbers from 8 to 14 when I try adding 3 random numbers from 1
>to 6.  Should not 9 be the average number here?  I'm trying
>int(rand(6)+1)   what am I missing?

(1+2+3+4+5+6)/6 = 21/6 = 3.5

3 x 3.5 = 10.5

The sums of three won't be random, they will average 10.5 and have the following
probability distribution:

	3 and 18		1/216
	4 and 17		3/216
	5 and 16		6/216
	6 and 15		10/216
	7 and 14		15/216
	8 and 13		21/216
	9 and 12		25/216
	10 and 11		27/216

It's no wonder you're getting a lot of numbers from 8 to 14. Think of it this
way: 3 is very hard to get ... only one way ... 1 + 1 + 1; getting 4 is easier
 ... 1 + 1 + 2, or 1 + 2 + 1, or 2 + 1 + 1 ... three ways; et cetera.

 - Vince
___
   Vincent Fatica
   Syracuse University Mathematics
   vefatica@syr.edu
   http://barnyard.syr.edu/~vefatica/


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

Date: Sun, 08 Mar 1998 20:03:26 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: RegEx Quiz Question
Message-Id: <3502F84E.417C3652@fccjmail.fccj.cc.fl.us>

Actually, sneely isn't a good term to
use as what I did is much worse :-(

I did want to know what, in more
detail, something like what I posted
did, but I am also having a tremendous
amount of trouble getting new posting
of this group from my ISP News Server.

So, yes flame me to death, I killed two
problems with one post.

Sorry.
Bill

Alan Schwartz wrote:

> Bill Jones  <bill@astro.fccj.cc.fl.us> writes:
>
> I don't mean to be harsh, Bill, but this isn't really a 'quiz',
> then, is it? It's asking for help.

Guilty.  But I do appreciate the explainationon d+; which helps me on another
project :-)

NG Readers:  Please, try not to flame me
too harshly...



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

Date: Sun, 08 Mar 1998 15:10:01 -0500
From: Tim Kramer <joat@series2000.com>
Subject: Re: returning immediately from system call?
Message-Id: <3502FB18.CDE23078@series2000.com>

Eric Bohlman wrote:

> Erik Johnson <erik@phidias.colorado.edu> wrote:
> : I've looked into the FAQ but come up empty handed (perhaps I don't
> : know the right question to 'ask'?).
>
> : Is there a way to have perl continue running after making a system
> : call to launch another program, without waiting for the other program
> : to complete?

Depending on what the original poster was trying to do, he might also
need to look up the use of the fconfigure command.



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

Date: Sun, 08 Mar 1998 19:47:24 -0600
From: pramsey@iname.com
Subject: Sarathy port of perl for Win32 thinks it's a dos program
Message-Id: <6dvhlb$88i$1@nnrp1.dejanews.com>

I've downloaded the two latest perl for win32 ports
to my win 95 box.
ActiveState works fine, as far as it goes.  The
Sarathy port thinks it's a dos program.  More accurately,
the system thinks it's a dos program, and tries to run it
as one.  When I try
to run it, either from explorer or the start menu run line,
it comes up in a dos box and says:
This program must be run under Win32.

This includes trying to run the install program through
using explorer or with the start menu run line
as specified in the readme file.
the first thing it does is complain that it must be run under
Win32.

Further investigation of the properties of the
two executables reveals that the ActiveState executable
is a win32 application, but the properties of the
Sarathy executable are as though it's a dos program:
I get all the tabs that normally go with a dos program,
including memory management and the like.

Does anybody out there know what's going wrong?

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


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

Date: 9 Mar 1998 01:05:28 GMT
From: burt@ici.net (Burt Lewis)
Subject: Re: Search Scripts
Message-Id: <6dvf8o$65f$3@bashir.ici.net>

Sound great, where does one find treesed?

Burt

n article <3502b6da.86360589@news.visi.com>, keefner@visi.com says...
>
>On Wed, 4 Mar 1998 12:17:17 -0800, "Nitin Gupta"
><niting@raleigh.ibm.com> wrote:
>
>>Are there any search scripts available which can deal with sites which have
>>2000+ pages? The one's available work by opening each page and searching 
for
>>the corresponding search term, this takes a long time on a large site.
>
>There is a script called treesed in perl which i use to handle
>global search/replace or find or specific page search/replace
>and one of my sites is over 2000 pages.  Takes less than
>a minute.
>
>Craig



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

Date: 8 Mar 1998 20:13:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: The -w switch (was Re: better way to do this?)
Message-Id: <6duu5g$i14$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Joseph N. Hall
<joseph@5sigma.com>],
who wrote in article <3500D24E.B4657F64@5sigma.com>:
> Your users are running prototype software?
> 
> Perl is perfectly suitable for producing finished products.  Finished
> products don't yield assertion failures under any circumstances.

I'm using a finished product.  It is an OS.  It asserts that all the
applications access the memory they are allowed to access only.

If this assertion fails, I get a message.

Ilya


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

Date: Mon, 09 Mar 1998 10:48:16 +1300
From: Robert Kielty <r.kielty@xtra.co.nz>
Subject: Re: The -w switch (was Re: better way to do this?)
Message-Id: <35031220.CA416F24@xtra.co.nz>

This is a multi-part message in MIME format.
--------------E16BF481CE286DADDB6C3D4E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Art Cohen wrote:
> 
snip 
> 
> : Still no -w and 'use strict'?  Do you *enjoy* pain? :)
> 
> I'd like to say that I almost never use the -w switch and I don't miss it
> (and I don't particularly enjoy pain).
> 
> Everybody in this newsgroup posts as if you're a ...

snip

> However, if I turn the -w switch on, I get warnings about them! I find
> this very annoying and not particularly helpful. If I need to initialize a
> variable, I do it. If I don't need to, I just use the variable name, and
> Perl works the way it was designed.
> 
> Does that make me an idiot or a masochist?

It just means that you can keep a lot of information in your head about
what
is going on in your Perl script.

It also means that you probably know Perl quite well and that you don't
mind 
taking mental notes of things, where a lot of other programming
environments 
hold your hand.

-w is great for people who are used to compiled languages whose
compilers
 inform them of possible defects in their code. 

The bottom line here is the reduction of time wasted with debugging.
This implies that you are concerned about saving money. 

If you don't trip up on the more subtle points of Perl then there is
no need for the -w (or the taint flag, -T I think, for security related
stuff)

I view Perl as being a very sharp knife, great at cutting things but you 
gotta know how to use correctly it in order not to hurt yourself badly.

Rob
--------------E16BF481CE286DADDB6C3D4E
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for <b>Robert<b> Kielty
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             <b>Robert<b> Kielty
n:              Kielty;<b>Robert<b>
org:            <br><br><img src="http://marketplace.xtra.co.nz/tis.gif" align=left valign=bottom><br>
adr:            31 Airedale St.;;;Auckland;;;New Zealand
email;internet: r.kielty@xtra.co.nz
title:          Applications Analyst
tel;work:       + 64 09 3577563
x-mozilla-cpt:  ;1
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------E16BF481CE286DADDB6C3D4E--



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

Date: 08 Mar 1998 16:12:56 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Urgent! Help Want On Developing Scripts
Message-Id: <x7pvjwvqcn.fsf@sysarch.com>

"Leonard Chan" <maestro8@email.msn.com> writes:

> I need help to develop a set of scripts for my web site, please email me if
> interested.
> 
> Leonard Chan
> maestro@msn.com

don't expect to get help when mail to both of your (spit) msn addresses bounce.


-- 
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: Sun, 08 Mar 1998 17:27:16 -0500
From: Eliot W Dudley <edudley@servtech.com>
Subject: Re: Using perl to do what a spreadsheet does but with a plain text file as a source?
Message-Id: <35031B44.74F8@servtech.com>

Tony Gonzalez wrote:
> 
> I'd like to use perl to do what a spreadsheet does but with a plain
> text file as a source, for example, if I have a text file like this:
> 
>                    Mon.    Tues.    Total
>                    ------------------------
> Joe Schmoe          5.3     1.2     TOTAL?
> John Doe            2.5     4.6     TOTAL?
> William Henry       1.3     3.2     TOTAL?
> 
> Is there any way I can generate a report like the above with the
> totals computed?
> 
> Seems to me a more practical and certainly more universal way of doing
> things than using a massive spreadsheet overkill GUI application. 

Forget perl, you need a practical extraction and report language.


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

Date: 08 Mar 1998 09:54:43 -0800
From: Evan Kirshenbaum <evan@garrett.hpl.hp.com>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <v9hogzhm5jw.fsf@garrett.hpl.hp.com>

bart.mediamind@tornado.be (Bart Lateur) writes:

> ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
> 
> >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.)
> 
> I see. Evan's posts suggested that there was a mark-and-sweep type of
> garbage collection at the end of the Perl run. Now I've come to think of
> it, there's no reason to go through the "mark" stage, as there will be
> nothing to keep. So the Perl engine can just go ahead, and "sweep"
> simply everything.

No, there appears to be a mark and sweep at the end of the interpreter
(as is described in the documentation).  This is necessary to ensure
that DESTROY methods are properly called so that they may release
resources, notify other processes of termination, etc.  To demonstrate
that this is, in fact, happening consider

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

    package A;

    sub new
    {
	my $self = bless {};
	$self->{"x"} = \$self;   # make it circular
	print "Creating an A\n";
	return $self;
    }

    sub DESTROY {
	print "destroying an A\n";
    }


    package main;
    $a = new A;
    undef $a;
    print "dying\n";

The output under perl5.004_01 is

    Creating an A
    dying
    destroying an A

The created A became garbage before printing out "dying", but couldn't
be collected because it was self-referential.  When the program ended,
the true GC was run, causing the object to be collected and the
DESTROY method run.

-- 
Evan Kirshenbaum                       +------------------------------------
    HP Laboratories                    |Those who study history are doomed
    1501 Page Mill Road, Building 1U   |to watch others repeat it.
    Palo Alto, CA  94304

    kirshenbaum@hpl.hp.com
    (650)857-7572

    http://www.hpl.hp.com/personal/Evan_Kirshenbaum/


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

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

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