[8422] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2039 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 6 01:08:24 1998

Date: Thu, 5 Mar 98 22:00:32 -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           Thu, 5 Mar 1998     Volume: 8 Number: 2039

Today's topics:
    Re: "Learning Perl" or "Programming Perl" (Jeff Yoak)
    Re: Add int, convert to string, substitute. HELP! <mishra.aditya@emeryworld.com>
    Re: Books? sloop@mailcity.com
        CGI to do an ftp <wayne@coryphaeus.com>
    Re: Help with complex data structures. <dformosa@st.nepean.uws.edu.au>
    Re: How can i add users to the passwd file in unix with (Mike Ellwood)
    Re: local/global var question <jdf@pobox.com>
    Re: Lost trying to compare two times <jdf@pobox.com>
        Matching words anywhere in strings: need \A, \Z? (Peter Scott)
    Re: Matching words anywhere in strings: need \A, \Z? <jdf@pobox.com>
    Re: Matching words anywhere in strings: need \A, \Z? (Troy Denkinger)
    Re: Matching words anywhere in strings: need \A, \Z? <jdf@pobox.com>
    Re: Perl Script count lines of c/c++ code <uri@sysarch.com>
    Re: Quiz <rjk@coos.dartmouth.edu>
    Re: Regular Expressions - Real Basic Help. <uri@sysarch.com>
    Re: Regular Expressions - Real Basic Help. (David Oswald)
        Relative and Absolute URL's:  Parsing <zbrown@mail.utexas.edu>
    Re: Relative and Absolute URL's:  Parsing <jdf@pobox.com>
    Re: safe file modification strategy (w/flock, new_tmpfi <jdf@pobox.com>
    Re: Special Characters (Abigail)
    Re: Special Characters <jdf@pobox.com>
        utime not working (Kat)
    Re: What is PERL? Learn JAVA instead? <uri@sysarch.com>
    Re: What is PERL? Learn JAVA instead? <evan@garrett.hpl.hp.com>
    Re: What is PERL? Learn JAVA instead? <jdf@pobox.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 06 Mar 1998 02:51:24 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: "Learning Perl" or "Programming Perl"
Message-Id: <6dnonc$uu@dfw-ixnews3.ix.netcom.com>

gbacon@cs.uah.edu (Greg Bacon) wrote:

>: I don't
>: know whether to Tom notes like mine are baby or bathwater, given his
>: feelings about unrepliable addresses it did strike me as rather
>: ironic.

>An address isn't unreplyable just because mail to it from you bounces.

I understand and agree.  (I at least imply as much in my original
message when I point out that I see the difference between this and
munging the address.)  It only struck me as ironic because I remember
reading messages from Tom about his frustration at having mail bounce
when he replies to someone's post on Usenet.  I understand the reason
for the bounces that he was complaining about is different from the
reason mine bounced.

[ regarding my mail that was rejected ]
>Here's what my log has to say about that message:

>    1998/03/03 20:51:24 [9116]: Message from jeff@yoak.com (Re: Controlling TWO input files (merging))
>    1998/03/03 20:51:24 [9116]: Spamchecker caught \bnetcom\.com\b

>Quit giving money to spam harborers.

Twice I've received enough mail from a Netcom account to make it worth
complaining over and that account was closed within 48 hours.  It's
explicitly against their terms of use to send unsolicited commercial
email and they appear to be trying (with some success) to enforce it.
I'm inclined to think the objection to them is based on rather old
evidense and that they've corrected the problems that existed.  I
travel a lot and their near universal availability, no limit on online
time and $19.95 price make them really attractive.

Ah, well.  To each his own.  The only really upsetting thing is that
the problem is bad enough that people like you (Greg) and Tom feel
that you need to take such measures.

Cheers,
Jeff

-------------------------------
Jeff Yoak         jeff@yoak.com



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

Date: Thu, 5 Mar 1998 16:09:26 -0800
From: "Mishra, Aditya" <mishra.aditya@emeryworld.com>
Subject: Re: Add int, convert to string, substitute. HELP!
Message-Id: <6dncrv$t4g@ljcqs003.cnf.com>

Why don't you split the string out , add the 1000 and then interpolate it
back
in a string





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

Date: Fri, 06 Mar 1998 04:52:07 GMT
From: sloop@mailcity.com
Subject: Re: Books?
Message-Id: <34ff7ad6.102861468@news.xmission.com>

On Sat, 28 Feb 1998 12:18:47 +0100, Matteo Frana <mfrana@spm.it>
wrote:

>What are the best books about Perl?

First you ought to get a good book on the Internet; one that explains
how to look over old Usenet posts, one that recommends lurking for a
little while before posting, or maybe even one that helps you to learn
a little common sense.

A DejaNews search on the topic "Perl Books" returns over 830 current
Usenet posts, and 9200 "old" Usenet posts.  If you need any additional
information I recommend using all caps in your future posts, subject
lines like "NEWBIE NEEDS HELP!!!!" or crossposting your questions to
alt.usenet.kooks; those folks love a good troll.

Of course, if Usenet isn't in your bag of tricks, there's always the
web, and http://www.perl.com immediately leaps into mind.  Under the
subsection "Documentation" you'll find a nice list of books; some
written by the very Diety of Perl, Larry Wall, and others by the Holy
Perl Trinity, Larry, Randal and Tom.

Certanly, guessing the Perl home page's URL might be a streach, so
there's always Yahoo, right?  A search of "Perl Books" brings a brief
list of 20.  Sure, no endorsements, but that's somewhere to start...
and a little investigation would again show that a few of the books
were written by the author of Perl as well as some of the other
leading minds on the subject.  Then how about a Yahoo search for
"Perl"?  A click or two later and you'll find yourself at the Perl
homepage again... convenient thing, the web.

Maybe the Web isn't the best source for you.  Perhaps you like man
pages.  Ok, "man perl" tells you that there's a man page named
"perlbook".  Off we go...... "man perlbook".  I won't even begin to
expound on all the wonderful insight that page will give you.  (It's
brief, but of course, right on the money.)

Alright, man pages are too arcaine for you?  How about the Perl FAQ?
It can also be found at Perl's website, and has a nice section
explaining about Perl books.


I suppose all that is simply too much work, and it's far easier to
bother thousands of people with a question that has been asked and
answered 10,000 times before.

Good luck!




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

Date: Thu, 05 Mar 1998 19:43:12 -0800
From: Wayne Dahl <wayne@coryphaeus.com>
Subject: CGI to do an ftp
Message-Id: <34FF70D0.A5B55631@coryphaeus.com>

I want my cgi-bin to ftp a file to another machine.  I thought the
following would work.


	system ("ftp machine < ftp.commands");

ftp.comands is

	cd /pub
	put some.file
	quit

I have a .netrc which does the login.

The command

	ftp machine < ftp.commands

works just fine.

I set up my http server to run as me and when I run the perl script from
the command
line it works just fine.

I really don't want to go through all the problems of installing a
bzillion packages 
to get one command to work.  Do I have to?

Please respond via email.

Thanks

Wayne
-- 
-----------------------------------------------------
Wayne E Dahl                  Coryphaeus Software Inc
408-395-4537                http://www.coryphaeus.com
wayne@coryphaeus.com                 fax 408-395-6351
-----------------------------------------------------
So many peoples lives are filled with the wrong struggles
- Rachel Cart


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

Date: 6 Mar 1998 02:18:28 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Help with complex data structures.
Message-Id: <889150708.69129@cabal>

In <6dlcfa$jnt$1@client3.news.psi.net> abigail@fnx.com (Abigail) writes:

>Diego Zamboni (zamboni@cs.purdue.edu) wrote on 1647 September 1993 in
><URL: news:fwg1kxygq5.fsf@narnia.cs.purdue.edu>:

[...]

>++ for($i=0; $i<10; $i++) {

>   foreach $1 (0 .. 9) {

Don't you mean $i ?


--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: 6 Mar 1998 01:25:39 GMT
From: mwe@unixfe.cc.rl.ac.uk (Mike Ellwood)
Subject: Re: How can i add users to the passwd file in unix with Perl?
Message-Id: <6dnjaj$1fbe@newton.cc.rl.ac.uk>

ap958@chebucto.ns.ca wrote:
: In article <eK$cKh#P9GA.267@upnetnews03>,
:   "Hagen" <insel@msn.com> wrote:

: > How can i add users to the passwd file in unix?
: >
: > Can someone help me


:     While I will agree with Martien here and say that the passwd file should
: be modified using the tools that come with your OS (like vipw, if you are
: root), there are ways to generate an encrypted password with Perl using the
: same (I think) algorithm used by Unix.  Have a look at the crypt() function.


"Encrypts a string exactly like the crypt(3) function in the C library
(assuming that you actually have a version there that has not been
extirpated as a potential munition)."  perldoc -f crypt




: It takes a string of text and a salt and generates an encrypted version of the
: string of text.  Works pretty well, and I have used it on several occasions
: for applications that needed encrypted passwords.


I think it is a valid requirement to be able to manipulate the
information in the passwd file by program rather than the
(typically interactive) system admin tools that are often
supplied, and are fine for doing the odd change, but not 
much good for large numbers of such changes.

The important thing is to use interfaces which are correct for 
your system, and not just treat the passwd file (or shadow)
as any old data file, as everyone else has said.


In AIX for example, one can do just about all you want with
a collection of linemode commands, which can obviously be
driven by the Perl system() function. Unfortunately the one thing
you cannot easily do this way is change the actual password
entry. However it is possible using a C program using the C
putuserpw function, having first encrypted it. You could write
a relatively simple C setuid root program based on putuserpw (or whatever,
in your system), and call this from perl, having first crypt()-ed
it, and do any other manipulation your system allows you with
linemode commands via system().

I don't see any philosophical problem in there being a Perl
"putuserpw" function (or equivalent), which called the
appropriate system routine, obviously only callable via root.
I note that there are a whole bunch of functions with names
like getpwnam, getpwuid, but no putuserpw  :-)
--
Mike.Ellwood@rl.ac.uk


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

Date: 05 Mar 1998 22:41:37 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: local/global var question
Message-Id: <ogzkzdse.fsf@news.concentric.net>

Glenn Manuel <gmanuel@ti.com> writes:

> Can someone explain why a local variable 
> can be accessed globally, and why assigning
> the empty list of subroutine args makes a difference ???

You should read the perlsub document (part of the documentation that
accompanies perl), paying special attention to the section entitled
"Temporary Values via local()."  You might also consult perlfunc and
search for "local" and "my."

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 05 Mar 1998 23:11:21 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Lost trying to compare two times
Message-Id: <lnuozceu.fsf@news.concentric.net>

larry@larrysbabes.com writes:

> foreach (@database_array) {
> 	@refferer_array= split(/\|/,$database_array[$matched]);

You've lost me.  You're doing a foreach, which sets $_ to each
element of @database_array in turn, but then ignoring $_ and using
what I can only guess is a (fixed) index into the same array each time
through the loop.  I'm guessing you meant something else.

Also: it will make your code easier to understand (for you *and* us)
if you familiarize yourself with this idiom:

    ($meaningful_name, $another, $etc) = split '|';

As it is, there are those cryptic $refferer_array[0] thingies around,
which makes it hard to follow your ideas.  Express yourself!

Please see "perldata" for the general idea of list assignment.


> Both  represent the time as huors:minutes:seconds. 
> Is there a way to convert these
> temporarily into seconds.

Okay, well, you're using the < operator which evaluates its operands as
if they were numbers.  And a scalar that starts with some numbers then
has some other junk will be evaluated as that first bit of digits.  So

   14:12:03
   14:27:24

Are exactly equal (to 14 and each other) when evaluated numerically.
If you'd used the -w switch, you'd have been warned about your attempt
to numerically compare two strings that aren't well-formed numbers.

But you've got a logic problem, too, if you're just using the
clock time:  When you roll over at midnight, your later time will be
a good deal "less than" your earlier time.  I hope these comments are
helpful.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 6 Mar 1998 00:54:29 GMT
From: pse@euclid.jpl.nasa.gov (Peter Scott)
Subject: Matching words anywhere in strings: need \A, \Z?
Message-Id: <6dnhg6$cd8@netline.jpl.nasa.gov>

Wanting to detect and count number of occurrences of the word "abc" in $str,
I wrote:

	$str = "abc def abc def abc ghi abc";
	$count= () = $str =~ /\Wabc\W/ig;  # require 5.004 :-)

but this misses the first and last "abc".  My next attempt was:

	$count = () = $str =~ /(?:\W|\A)abc(?:\W|\Z)/ig;

which works.  But it looks darn ugly.  Am I missing an easier way?

-- 
This is news.  This is your      |  Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?   |  (pse@euclid.jpl.nasa.gov)

Disclaimer:  These comments are the personal opinions of the author, and 
have not been adopted, authorized, ratified, or approved by JPL.


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

Date: 05 Mar 1998 23:25:35 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Matching words anywhere in strings: need \A, \Z?
Message-Id: <iupszbr4.fsf@news.concentric.net>

pse@euclid.jpl.nasa.gov (Peter Scott) writes:

> 	$str = "abc def abc def abc ghi abc";
> 	$count= () = $str =~ /\Wabc\W/ig;  # require 5.004 :-)

I think you want \b, which matches word boundaries.  There could never
be a character of any sort before the beginning (or after the end) of
a string.  \A and \Z are absolute string anchors (like ^ and $ but not
affected by /m); they're not relevant to your problem.  Hope this
helps.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: Thu, 05 Mar 1998 04:49:58 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: Matching words anywhere in strings: need \A, \Z?
Message-Id: <6dnvf9$oat$1@hirame.wwa.com>

In article <6dnhg6$cd8@netline.jpl.nasa.gov>, pse@euclid.jpl.nasa.gov wrote:
>Wanting to detect and count number of occurrences of the word "abc" in $str,
>I wrote:
>
>        $str = "abc def abc def abc ghi abc";
>        $count= () = $str =~ /\Wabc\W/ig;  # require 5.004 :-)
>
>but this misses the first and last "abc".  My next attempt was:
>
>        $count = () = $str =~ /(?:\W|\A)abc(?:\W|\Z)/ig;
>
>which works.  But it looks darn ugly.  Am I missing an easier way?

I must be missing something because:

#!/perl/bin -w

use strict;

my $str = "abc def abc def abc ghi abc";
my $count= () = $str =~ /abc/g;

print $count;


happily prints out 4, which seems to be the proper number of 
"abc"s.

Troy Denkinger


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

Date: 06 Mar 1998 00:16:51 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Matching words anywhere in strings: need \A, \Z?
Message-Id: <g1kwz9do.fsf@news.concentric.net>

troy@whadda.com (Troy Denkinger) writes:

> I must be missing something because:

> my $str = "abc def abc def abc ghi abc";
> my $count= () = $str =~ /abc/g;
> 
> print $count;

> happily prints out 4, which seems to be the proper number of 
> "abc"s.

But he wants only instances of the *word* "abc", not the sequence of
characters "abc".  That's why he needs \b.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 05 Mar 1998 22:00:24 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl Script count lines of c/c++ code
Message-Id: <x7hg5cwmk7.fsf@sysarch.com>

gip <gibson@doitnow.com> writes:

> Does someone have a script that counts lines of C and/or C++ code?  Yeah
> I know I can write it, but I thought it may have already been done ;}

wc *.c

strip empty lines

grep -v '^$' *.c | wc


who needs perl :-)

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 00:46:15 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: jdporter@min.net
Subject: Re: Quiz
Message-Id: <34FF8DA9.1C79DE62@coos.dartmouth.edu>

[posted and mailed]

John Porter wrote:
> 
> All that text is in a perl double-quoted string, which means special
> characters are processed.  In the case of \\, the result is \.
> The remaining single \ is what is passed to the tr command.
> 
> If the string had been single-quoted, the \\ would have been passed
> to tr.

Hmm...

  DB<1> print "abc\\def"
abc\def
  DB<2> print 'abc\\def'
abc\def

Even in single-quoted strings, some backslash escapes are special.
Specifically, \' for a single quote, and \\ for a backslash.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 05 Mar 1998 22:04:51 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Regular Expressions - Real Basic Help.
Message-Id: <x7g1kwwmcs.fsf@sysarch.com>

blanchard@nospam.aiov.com (Bruce Blanchard) writes:

>    I've read quite a bit about Perl(Lama & Camel & other books).  And I can
> figure our everything except regular expressions.

at least you RTFM.

> I understand how they work and how to code them, but what I don't understand
> is how once I know I found a match, to grab information around the area.  

use () and $1, $2, $3 ...
read perlre and the camel page 64.

>    Any one??

me.


-- 
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 05:15:44 GMT
From: doswald@xmission.com (David Oswald)
Subject: Re: Regular Expressions - Real Basic Help.
Message-Id: <34ff85a8.105631682@news.xmission.com>

On Fri, 06 Mar 1998 02:20:23 GMT, blanchard@nospam.aiov.com (Bruce
Blanchard) wrote:

>Hi there,
>   I've read quite a bit about Perl(Lama & Camel & other books).  And I can
>figure our everything except regular expressions.

You need to call in the Owls now.

>   Any one??

Someone:  Friedl  (author of Mastering Regular Expressions, the owl
book, published by none other than O'Reilly & Assoc., Inc.)

Don't miss it! ;)

Good luck.




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

Date: Thu, 05 Mar 1998 21:11:28 -0600
From: Zacary Brown <zbrown@mail.utexas.edu>
Subject: Relative and Absolute URL's:  Parsing
Message-Id: <34FF6960.AB9F7438@mail.utexas.edu>

Say I wanted to find the following in a string:

SRC="xxxx" or src="xxxx" or HREF="xxxx" or href="xxxx"

and replace them with SRC="http://xxxx" , etc...

say further that there will be multiple occurrences of these in the same
string, and that some occurrences already use SRC="http://xxx" in which
case I don't need to do the replace.  Is there a way to do this with a
single regexp?

if (/(src="[^h]xxx")/i || /(href="[^h]xxx")/i) {
  s/$1/src="http:\/\/xxxx"/g;  #don't think this would work at all!
}

The situation is that I have these html files which are all just one big
fat string (looks like they were created on a Mac, which uses only
Carriage Returns to delimit lines) and I would like to substitute
relative urls for absolute ones.  I would also like to be able to do it
in one pass.


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

Date: 05 Mar 1998 23:39:36 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Relative and Absolute URL's:  Parsing
Message-Id: <hg5czb3r.fsf@news.concentric.net>

Zacary Brown <zbrown@mail.utexas.edu> writes:

> SRC="xxxx" or src="xxxx" or HREF="xxxx" or href="xxxx"
> 
> and replace them with SRC="http://xxxx" , etc...

You'll want to take a close look at your perlre document and learn
about zero-width assertions, which enable you to say "match this only
if it is (or is not) followed by this other thing."  Here's a totally
random, hypothetical example.

  s{
     ((?:href|src)=")  # two non-capturing parens
     (?!http://)   # here's the negative lookahead
     /?
     ([^"]*")               #this does *not* allow for escapes
   }{$1http://localhost/$2}gxi;

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 05 Mar 1998 22:36:07 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: safe file modification strategy (w/flock, new_tmpfile, and syscopy?)
Message-Id: <pvk0ze1k.fsf@news.concentric.net>

shaug@gromit.callamer.com (O'Shaughnessy Evans) writes:

>     open(IN, "+>>$file")                    or carp("open:  $!"), return;
>     ($dev_a, $ino_a) = (stat(IN))[0,1];
>     flock(IN, LOCK_EX)                      or carp("flock: $!"), return;
>     ($dev_b, $ino_b) = (stat(IN))[0,1];
> 
>     while ($dev_a != $dev_b and $ino_a != $ino_b) {
>         close IN;
>         open(IN, "+>>$file")                    or carp("open:  $!"), return;
>         ($dev_a, $ino_a) = (stat(IN))[0,1];
>         flock(IN, LOCK_EX)                      or carp("flock: $!"), return;
>         ($dev_b, $ino_b) = (stat(IN))[0,1];
>     }

You could type less with

   while (1) {
      #open file
      #stat file
      #flock file
      #stat again
      last if $dev_a == $dev_b and $ino_a == $ino_b;
      #close file
   }

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 6 Mar 1998 03:34:58 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Special Characters
Message-Id: <6dnqt2$qhq$2@client2.news.psi.net>

Uri Guttman (uri@sysarch.com) wrote on 1648 September 1993 in
<URL: news:x7pvk0wsh1.fsf@sysarch.com>:
++ abigail@fnx.com (Abigail) writes:
++ 
++ > 
++ > Puzzle: How do I escape $, @ and \ in interpolative strings without using \?
++ 
++ print "@{[q|ab$c\@d|]}\n" ;
++ 
++ prints
++ 
++ ab$c\@d
++ 
++ but you can't have \ as the last char since it escapes the closing |
++ quote. it's ugly but solves the puzzle.

Well, no, it doesn't, as you can't escape a backwack. I wasn't considering
putting the entire string in @{}; you could have used '' then.
Assume there's lots of things to be interpolated, and a handful of
$, @ and \ to be escaped, without using a \.



"This is a string with a @{[chr 0x24]}, a @{[chr 0x40]} and a @{[chr 0x5C]}"


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: 05 Mar 1998 22:44:54 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Special Characters
Message-Id: <n2f4zdmx.fsf@news.concentric.net>

Uri Guttman <uri@sysarch.com> writes:

> print "@{[q|ab$c\@d|]}\n" ;

That's hideous.  I am humbled.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: Fri, 06 Mar 1998 07:21:19 GMT
From: kmphillip@spamsuck.hotmail.com (Kat)
Subject: utime not working
Message-Id: <6dnqmr$pfo@dfw-ixnews11.ix.netcom.com>

Hi!
I'm having trouble getting the utime function to work on NT.  The
following is a sample of my code.  
$filename = "file";
$mtime = time;
$atime = time;
utime = ($mtime, $atime, $filename);

I have verified that the file has read/write permissions.  Also, utime
is returning a zero which indicates to me that perl is recognizing the
function.  Also, time is returning the current date and time.  

PLEASE HELP OR TELL ME A BETTER WAY TO CHANGE THE FILE MOD DATE!
Kathy, kmphillip(at)hotmail.com




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

Date: 05 Mar 1998 21:58:07 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <x7iupswmo0.fsf@sysarch.com>

Evan Kirshenbaum <evan@garrett.hpl.hp.com> writes:

> 
> Please remember, I really do prefer Perl for most tasks.  That doesn't
> mean that I don't think that it's perfect or can't be improved.  I
> have several tasks on hold awaiting the release of a multithreaded
> version. 

there is VERY little you can do with threads than without. they are
overhyped. i have designed complex psuedo multithread systems with
select and no threads. it is just a differecnt paradigm and many
programmers don't understand select loop design. when i needed a true
separate "thread" i designed another process and used some form of IPC
to communicate between them (them being >15 in one project).

i recently did a project where we created a large select loop AND some
threads since the system calls (gethostbyname for one and file writing
for another) would block the rest of the system from doing socket I/O
(it was a full web crawler). that could have easily been redesigned
without threads but it was a little more efficient to use them. threads
are NOT the end all in program design, just as objects aren't either. if
you have good software architecture (shameless plug for my business)
engineering skills, you can design with or without threads. they are
just another tool in the box.

select (or poll for SYS V types) rules!!

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: 05 Mar 1998 17:38:19 -0800
From: Evan Kirshenbaum <evan@garrett.hpl.hp.com>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <v9hn2f4mwdw.fsf@garrett.hpl.hp.com>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     Evan Kirshenbaum <evan@garrett.hpl.hp.com> writes:
> :Ok.  Then please explain why the following script got through 1525
> :iterations before running out of memory (the process grew to 344MB): 
> 
> You're arguing definitions, you know.  Refcount is GC, just not
> what you think you want.

Ok, but remember that my initial example wasn't "Perl doesn't do GC",
it was "Perl makes it difficult to use circular structures".

But I'll grant your point, although I'm not sure that everybody in the
GC community would.  Reference counting is a particularly simple form
of garbage collection.  It's limitations are so severe, however, that
I think I'm correct in remembering that much of the literature
considers it an "automatic memory management" technique, but not truly
a form of garbage collection.  From a simple search, I found

    http://www.harlequin.com/mm/reference/

whose FAQ has questions like "Isn't it much cheaper to use reference
counts rather than garbage collection?"  Also, Paul Wilson's ACM
_Computing Surveys_ paper, which details reference counting under
"Basic Garbage Collection Techniques", has a footnote which says

    Some authors use the the term "garbage collection" in a narrower
    sense, which excludes reference counting and/or copy collection
    systems; we prefer the more inclusive sense because of its popular
    usage and because it's less awkward than "automatic storage
    reclamation".

By introspection, my litmus test for "true" garbage collection is
roughly "if I try to allocate a block of memory and there is a larger
block of garbage in a compatible heap, the allocation should succeed".

-- 
Evan Kirshenbaum                       +------------------------------------
    HP Laboratories                    |If the human brain were so simple 
    1501 Page Mill Road, Building 1U   |That we could understand it,
    Palo Alto, CA  94304               |We would be so simple
                                       |That we couldn't.
    kirshenbaum@hpl.hp.com
    (650)857-7572

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


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

Date: 05 Mar 1998 23:16:42 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <k9a8zc5x.fsf@news.concentric.net>

Uri Guttman <uri@sysarch.com> writes:

> select (or poll for SYS V types) rules!!

Have you -- or has anyone else -- written a tutorial for that
technique (the "select() loop")?  I found the discussion in the
Panther to be difficult to follow.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

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

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