[6651] in Perl-Users-Digest
Perl-Users Digest, Issue: 276 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 11 03:07:18 1997
Date: Fri, 11 Apr 97 00:00:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 11 Apr 1997 Volume: 8 Number: 276
Today's topics:
Re: [Q] Unpack or split? (Abigail)
Assigning a List to an Array Element <jputnam@nwu.edu>
Calling sendmail on a NT Machine ? <ken@acme-brain.com>
Re: cls || ClrScr?? (Kenneth Albanowski)
Correct timelines [was: Reply to Ousterhout's reply ] <sdm7g@virginia.edu>
Re: Date <mgjv@comdyn.com.au>
Re: hard carriage return problem (Eric Bohlman)
Re: Help on integer segmenting into an Array (Tad McClellan)
HELP! Trying to automate creation of hundreds of new em <ksansom@worldnet.att.net>
HELP: Recursive directory mapping <abadri@worldnet.att.net>
Is LD_LIBRARY_PATH needed for every .so? (Robert Nicholson)
Pattern match scope problem (Mark W. Manley)
Re: Pattern matching.... (Joshua Lerner)
Re: Perl and MSDOS <imbe@primenet.com>
Re: Perl on a PC <davidw@efn.org>
Re: perl parsing slashing question (David Alan Black)
Re: Regular expression help (Joshua Lerner)
Re: Regular expression help (Tad McClellan)
Re: Reply to Ousterhout's reply (was Re: Ousterhout and (James Logajan)
Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Jete Software Inc.)
Re: Reply to Ousterhout's reply (was Re: Ousterhout and (marduk)
Re: system & variables in perl (Tad McClellan)
Re: Unix and ease of use (WAS: Who makes more ...) (Hume Smith)
Re: Unix and ease of use (WAS: Who makes more ...) <critter@quack.kfu.com>
Re: Unix and ease of use (WAS: Who makes more ...) <jhickey@hpcc.nectec.or.th>
Re: Unix and ease of use (WAS: Who makes more ...) (Martin Sohnius x24031)
Re: Unix and ease of use (WAS: Who makes more ...) (Martin Sohnius x24031)
Re: Who makes more $$ - Windows vs. Unix programmers? <jhickey@hpcc.nectec.or.th>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Apr 1997 02:40:19 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: [Q] Unpack or split?
Message-Id: <E8GCr8.8Bp@nonexistent.com>
On Thu, 10 Apr 1997 18:20:43 -0400, Michael S. Kerry wrote in
comp.lang.perl.misc <URL: news:334D67BB.6217@hrb.com>:
++
++ Here's a newbie question, but at least it's quick...
++
++ I have fixed-length record data like the following:
++
++ 12345 78901 3456 8 abcdefghijkl
++
++ (a 5-digit number, a space, another 5-digit #, a space, a 4-digit #, a
++ space, a 1-digit #, a space, a 12-character (unquoted) string).
++
++ The numeric fields are pre-padded with zeros (if necessary) to maintain
++ the record positioning (i.e., the forth value is always in position 18).
++
++ What is the best (easiest? most reliable?) way to parse this record into
++ the 5 fields (4 numeric, one string)? Unpack or split? The string might
++ contain spaces (usually does, in fact...).
If you use the third argument of split, indicating how many fields
at most have to be split, spaces in the string won't be special.
$ perl -w
my $f = "12345 78901 3456 8 abcde ghijkl";
my ($n1, $n2, $n3, $n4, $str) = split / /, $f, 5;
print "The string is >$str<\n";
print "And the numbers are $n1, $n2, $n3 and $n4.\n";
__END__
The string is >abcde ghijkl<
And the numbers are 12345, 78901, 3456 and 8.
$
Abigail
------------------------------
Date: Fri, 11 Apr 1997 00:24:30 -0500
From: John Putnam <jputnam@nwu.edu>
Subject: Assigning a List to an Array Element
Message-Id: <334DCB0E.4016@nwu.edu>
Howdy,
Is there a way to have an array of lists or an associative array with a
list as a data element?
I have built a list from a parse of field definitions and wanted to load
an associative array with the field name and the list describing it. But
it seems to be a scalar context and converts the @list to the # of
items. Is it possible to do this at all?
as in
@fielddef = (color, 1, 5, a); #--color starts in col 1->5, alpha
$fields{$fielddef[0]} = @fielddef;
in a loop of course. Or is there a way to effectively come up with an
equivalent structure?
Thanks for any insight.
John Putnam jputnam@nwu.edu
------------------------------
Date: Thu, 10 Apr 1997 23:49:52 -0400
From: Ken Hodges <ken@acme-brain.com>
Subject: Calling sendmail on a NT Machine ?
Message-Id: <334DB4E0.14A@acme-brain.com>
I have installed Perl5 with no difficulties, got the "Hello World" to
working fine, can make a *.html form create and display another *.html
file with no problems, but have run into a brick wall making scripts
call sendmail and then mailing the form information.
I keep getting the respomnse:
could not exectute "C:\sendmail\sendmail"
I've tried *.bat files, *.pl files (several of them) and still get this
error message, or the message "...has caused an error, probably due to a
misconfiguration....."
I'm using metainfo's "sendmail" for windows NT.
What am I missing ?
Thanks,
Ken
--
**********************************************************************
ACME BrainWorks
Internet Services
Ken Hodges
Rabun County, Georgia
"Where Spring Spends the Summer"
http://www.acme-brain.com
**********************************************************************
------------------------------
Date: 10 Apr 1997 07:19:19 -0400
From: kjahds@kjahds.com (Kenneth Albanowski)
Subject: Re: cls || ClrScr??
Message-Id: <5iiibn$9n0@kjahds.com>
In article <3333d716.8842512@iiscgate.iisc.co.uk>,
Simon Hyde <shyde@poboxes.com> wrote:
>On Fri, 21 Mar 1997 17:36:26 -0500, Peter Tapolyai <peter@uhu.com>
>wrote:
>
>>How do you clear the screen in perl ?
>
>well...you could try system("clear") or print "\n"x100;
>but really there is no proper way to do it.
Term::Cap is probably available, you know.
--
Kenneth Albanowski (kjahds@kjahds.com)
------------------------------
Date: Fri, 11 Apr 1997 05:43:22 GMT
From: "Steven D. Majewski" <sdm7g@virginia.edu>
Subject: Correct timelines [was: Reply to Ousterhout's reply ]
Message-Id: <AF734804-B1B9E@128.143.7.209>
On Wed, Apr 9, 1997 8:03 PM, cosc19z5@bayou.uh.edu
<mailto:cosc19z5@bayou.uh.edu> wrote:
>John Ousterhout (ouster@tcl.eng.sun.com) wrote:
>
JO>: In contrast, various flavors of Lisp have been around since at least
JO>: the early 60's and Smalltalk first appeared in the late 60's.
>
>I was under the impression that Smalltalk first appeared in the early
>70s.
>
As one of the greybeards (literally) in this group, I have to correct you
both on your history:
Smalltalk was being developed at Xerox in the 70s, but except for a
few academics, it was pretty much unknown outside of PARC.
By the mid seventies they had something that would be recognizably
close to today's Smalltalk. Steve Job's came to PARC in 79 and left
impressed ( and then launched work on the Lisa ).
BYTE magazine came out with an issue devoted to Smalltalk in 81 --
that's was the first most people heard of it . [ YES -- in those days,
before internet news connections were ubiquitous, computer magazines
were still a source of "timely" information, and you didn't learn about
the latest computer research or new language the very next day! ]
I bought copies of the first books that came out on Smalltalk-80
in 1983. The books were much easier to get than were any working
systems -- one of the books "SMALLTALK-80 : Bits of History, Words
of Advice" was mostly reports from various groups that had tried to
port it. [ You got a tape image of byte codes for the Smalltalk
virtual machine -- you had to build your own virtual machine to load it.
This was also in the days before C became the "universal assembler" . ]
It was difficult to fit it onto the machines of those days. [ Our main
machine when I was at UPENN was a VAX 750 with the maximum 8MB
memory. ] Most of the implementation reports in that book did not
lead to a commercial product.
Anyone know when the first commercial Smalltalk for PC was released ?
In any case, it can't be *too* far off to say that Smalltalk has been
widely
available only for perhaps less than a decade.
[ This from my greying memory, my ancient copies of
Krasner,Glenn SMALLTALK-80 : Bits of History, Words of Advice. &
Goldberg & Robinson - SMALLTALK-80: The Language and its
Implementations ( both published in 1983 ) and Alan Kays talk in
HOPL-II ( ed. Bergin & Gibson ). ]
JO>: Every single
JO>: programmer who ever wrote a program in Tcl, Perl, C++, Visual Basic,
JO>:or even C could have chosen Lisp, Scheme, or Smalltalk.
>
>Here you show a grievous lack of common sense that goes well with your
>lack of knowledge about language-history. The only programmers who
>would be able to choose Lisp, Scheme, or Smalltalk are those who
>would have known that those languages existed, and you would be
>surprised at how many people do _NOT_ know they exist. I ran into
>these languages because I was _ACTIVELY_ looking for languages,
>this is the same reason I ran into Haskell (my favorite language).
> [ ... ]
There is a recent article in the New Yorker about HDTV, pollution
regulation and technological development, which knocks the notion
that the market can always make the right technology choices -- an
idea that supposes that individuals have perfect knowledge of the
possible choices. That line goes back to Simon's studies on decision
making with imperfect information. The sort of simple minded
market economy argument John Ousterhout uses has become our
ages version of Social Darwinism.
JO>: But they didn't. If you
JO>: want to know the truth, I think you need to stop making superficial
JO>: excuses and ask deeper semantic questions.
I'm afraid I have to agree with Erik Naggum's reply here:
Erik> the way I read this debate, people are asking deep, semantic
questions of
Erik> Tcl and they get superficial excuses for answers.
>Let's see, C became popular for one reason only -- it was almost
>mandatory for programming under Unix which was widespread (and
>still is). So C rode on the coattails of an operating system, and
>was not chosen on any virtue of the language itself.
I think you're off on your history here also.
Going back in time about 20 years:
My friends who did business computing systems used Cobol, BAL
( IBM's BAsic Assembler for 360/370 systems ) and were starting to
use 4GL Database languages where performance and other constraints
allowed.
Everyone I knew in the University used Fortran and some assembler -
mostly on PDP-11s and VAXen -- running RSX11, RT-11 and VMS.
Unix was just starting to make inroads then.
On smaller systems: embedded LSI-11's and early PCs we used FORTH
or Basic.
[ Lisp systems were very incompatible before Common Lisp came around.
I had trouble learning it because none of the Lisp's I had access to
matched the syntax of any of the Lisp books I had ( and they didn't
match each other, either. We got VAX Common Lisp on our 750,
but it was a pig on an 8MB time shared machine. Several companies --
I remember GE and some others -- had some success using Lisp
machines for prototyping and development of expert systems, which
they then ported to FORTH for delivery. ]
C basically filled a need and a vacuum.
"Standard" Pascal was not very usable, and usable Pascal's were not very
standard. Pascal was designed as a teching language -- so even it's
adoption showed the hunger for something better. I used Ratfor
( a preprocessor for Fortran which added some of the features of
C ) for a while. C had and has its faults, but at the time it was
the best thing available. ( as well as Forth, which filled a rather
different niche. In fact, it gave you all of the benefits and more
of Tcl, 20 years ago. ).
Pascal, for all *it's* faults, was neck and neck with C for a while --
especially after Apple chose Pascal for the Mac and Turbo Pascal
became a defacto PC standard. I think Unix and it's close association
with C, the Unix philosophy of programming which spread beyond
Unix by things like Ratfor and books like "Software Tools" , and
finally, Gnu C allowing C compiler backends for every possible
processor to become available, probably gave C a big boost, but
it would be wildly incorrect to say that it's all due to Unix. It
really seemed like the best solution at the time.
> C++ is
>popular for one reason only -- it isn't a far step away from C which
>means that the C crowd flock to it in safety. So C++ rode on the
>coattails of C which rode on the coattails of Unix.
As Steve McQueen says in The Magnificent Seven:
"Reminds me of a feller I once knew -- took off all his clothes
and jumped into a patch of cactus. When they fished him out
and fixed him up, they asked him why he did it."
"He said: 'IT SEEMED LIKE A GOOD IDEA AT THE TIME! ' "
Tcl also seemed like a good idea at the time.
Long Ago, when I was contemplating moving from an LSI-11 running
Forth to a 68000 Unix system, I talked to a programmer in the lab upstairs
who was running Unix system 7 on a PDP-11. I told him that what
I liked about Forth was that I could write new primitive commands
for things like "x y MOVE-BEAM" and 'ACQUIRE-SPECTRUM' ,
and use them and the basic Forth commands to write simple scripts,
test them interactively and do new experiments almost as fast as I
could think of them.
He said: Oh -- that's simple in Unix! There are these tools called Lex
and Yacc you use to write your own command language. You write a
grammar for your language and write the primitive commands in C .
Needless to say, it was not anywhere as simple, easy or fast as what
I had had before. So when I first read John Ousterhout's first Tcl paper,
I though: *Finally* -- something almost as simple as what I had years
ago. But it's a bit of a distortion to write about it as if you've
discovered
some new revolutionary concept in programming languages: Interactivity!
>As for Tcl, it's there for one reason and one reason only -- strong
>corporate backing.
As other have already noted in this thread -- Tcl was developed long
before John Ousterhout was at Sun and it grew without any corporate
backing. Even at Sun, compared to Java, it's getting more what I would
call benign corporate neglect.
- Steve Majewski
<sdm7g@Virginia.EDU>
"Twenty years in the computer business, and all I got to show for
it is this Python T-shirt!" ;-)
------------------------------
Date: Fri, 11 Apr 1997 12:16:11 +1000
From: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: Date
Message-Id: <334D9EEB.3817@comdyn.com.au>
Panason wrote:
>
> How do I get my program to let me know todays date?
man perlfunc (or another way to read the perl documentation)
look for gmtime and localtime.
In the perl modules list on www.perl.com look for the modules starting
with Date:: as well
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Fri, 11 Apr 1997 05:08:00 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: hard carriage return problem
Message-Id: <ebohlmanE8GJLC.Dw9@netcom.com>
James Bland (jamesb@slip.net) wrote:
: basically I'm trying to automate a few things eg.. changing passwords.
: This requires the script to interact with the OS. I need something that
: will send hard carriage returns after a print statement.
: print ("$new_username") I tried \n but that is not interactive also
: tried \r. any suggestions or maybe even a different path to follow. I
: also want to make a autologin for telnet sessions using this script:
Are you sure that carriage returns are really your problem? This sounds
like it could be a buffering problem; have you set $| to force each print
to flush the buffer?
------------------------------
Date: Thu, 10 Apr 1997 22:02:30 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Help on integer segmenting into an Array
Message-Id: <6k9ki5.kbf.ln@localhost>
Leon Stepanian (leonstep@cedep.com) wrote:
: Here's the problem.
: $hold could have any value from 1 - 4 digits long such as:
: 8 or
: 16 or
: 134 or
: 2567
: I have to get integer values held in $hold into an array under their
: seperate digits such as:
: for for for for
: 8 16 134 2567
: @array[0] 0 0 0 2
: @array[1] 0 0 1 5
: @array[2] 0 1 3 6
: @array[3] 8 6 4 7
: If anyone can help me on this, I would greatly appreciate.
@array = split //, sprintf("%04d", $hold);
: Leon Stepanian
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 11 Apr 1997 04:38:15 GMT
From: Kirk Sansom <ksansom@worldnet.att.net>
Subject: HELP! Trying to automate creation of hundreds of new email accounts
Message-Id: <5ikf7n$6v8@mtinsc04.worldnet.att.net>
HELP! Trying to automate creation of hundreds of new email accounts
This message is being cross-posted, please excuse any duplication.
I'm desperate! I've got to create hundreds of user e-mail accounts in the next few weeks on our SGI Origin 200 server running Irix 6.3. No one on our staff is proficient in Unix or programming and they're all satisfied to do the steps manually, one-by-one, the way our sorry excuse for a sales rep showed us. I simply refuse to accept that in a made-for-programmers operating system, there's not an easier, more automated way to add directories with the proper ownership, mode, etc.
Adding users is not the problem. Even though the adduser applet does not exist in this system, it's still pretty easy to add users by editing the passwd file.
But, I'll be darned if there isn't an easier, faster way to create, modify user directories for e-mail storage. I've been experimenting with trying to automate the following on my linux machine at home with the bash shell:
1) create the new user's directory in /usr/people/
2) change directory owner from root to the new user
3) change directory mode to 500
4) change directory group to user
5) list the directory to insure changes are correct
First I tried this running this executable script file:
{
for file in $*
do
mkdir {$file}
chown {$file} {$file}
chmod 500 {$file}
chgrp user {$file}
done
}
ls -l
I entered the command with one variable, but it wouldn't work so I tried this:
mkdir $1
chown $1 $1
chmod 500 $1
chgrp user $1
ls -l
The first time, it worked perfectly, but would only execute the first line after that.
I'm trying to teach myself Perl scripts in my spare time, but right now I just don't have any spare time to learn, and by the time I do, the user accounts will have to be finished.
P.S. Our SGI machine is setup for csh shell, I'm trying (learning) to install the bash shell and put it in the path, but for now, csh is it.
Thanks for any suggestions,
ks
------------------------------
Date: Thu, 10 Apr 1997 23:46:10 -0400
From: "Ameer Badri" <abadri@worldnet.att.net>
Subject: HELP: Recursive directory mapping
Message-Id: <5ikclk$fqd@mtinsc03.worldnet.att.net>
Hi,
I will appreciate if someone can help me with the following problem. I am
looking for piece of Perl code to recursively map a given directory for a
specific file type (ex. *.html).
Thanks for your time and help,
Ameer
------------------------------
Date: 11 Apr 1997 00:11:20 -0400
From: steffi@dgs.dgsys.com (Robert Nicholson)
Subject: Is LD_LIBRARY_PATH needed for every .so?
Message-Id: <5ikdl8$sb8@DGS.dgsys.com>
I have a question about perl loading the object module.
For the core are the paths hardcoded into perl then with the linker?
If I instal my own copy of CPAN stuff do I need to set te LD_LIBRARY_PATH
for each and every .so?
That seems a bit excessive.
------------------------------
Date: Fri, 11 Apr 1997 05:28:50 GMT
From: mwm3q@jefferson.village.Virginia.EDU (Mark W. Manley)
Subject: Pattern match scope problem
Message-Id: <E8GKK2.A19@murdoch.acc.Virginia.EDU>
I am having a problem with what C people would call a "scope" issue in
Perl5. I am working on manipulating a large amount of files with a
script need to move some information from one set of SGML tags to
another. Since the information won't always have easy, convenient
consistent tag structures surrounding the information, I need to be able
to put information from pattern matching into other variables. I tried
this code fragment:
if (/purchasePrice/){
s/<\/patron>\n([^\<]*)<note><\/note>\n\s.*<purchasePrice>([^\<]*)<\/pu
rchasePrice>/<\/patron>\n <originalCost>$2<\/originalCost>\n$1<note><\/note>/g;
$cost = $2;
print "Matched! Cost is $cost\n";
}
I thought this would output "Matched! Cost is [whatever was in the
purchasePrice tag set]". Instead, it prints "Matched! Cost is",
suggesting that no value is coming over from the $2 variable. I know
that it does in fact contain data during the execution of the replace
line as it moves the purchasePrice data into the originalCost tags. For
some reason, perl is discarding this information. I am using multiple
lines of pattern matching expressions like this one in the code, which
is why I'm trying to squirrel the data away into the $cost variable.
Does anyone know why this is acting so bizarre, or if there is a way
around this?
Please email "mwm3q@virginia.edu" if you have any ideas as my news
reader goes into frenzies sometimes.
Thanks!
MM
------------------------------
Date: 11 Apr 1997 00:59:52 -0400
From: jlerner@panix.com (Joshua Lerner)
Subject: Re: Pattern matching....
Message-Id: <5ikgg8$br8@panix3.panix.com>
In article <334D0B16.34CD@kodak.com>,
Sam Mingolelli <slmingol@kodak.com> wrote:
> $pattern="(\S+).*\s(\w+)\s(\w+)\s+(\w+)\s(\S+)\s(\S+)" ;
> ($security,$size,$month,$day,$time_or_year,$filename)=/$pattern/ ;
>My goal is to do a pattern match without having to designate the pattern
>on the same line with the variables which I intend to store them in.
>Is this possible?
Sure, but you have a few problems in the code you posted. You'll need to
make $pattern a single-quoted string so that the embedded backslashes are
not interpreted until pattern-match time. So it should look something
like this:
$pat = '(\S+).*\s(\w+)\s(\w+)\s+(\w+)\s(\S+)\s(\S+)';
($security, $size, $month, $day, $time_or_year, $filename)
= $lsdashl =~ /$pat/;
where $lsdashl contains the text you want the pattern to match against.
Though you may be better of doing a stat here. See the perlfunc man page.
Good luck,
Joshua Lerner
------------------------------
Date: 10 Apr 1997 21:35:01 -0700
From: "Smith A. Cat" <imbe@primenet.com>
Subject: Re: Perl and MSDOS
Message-Id: <334DA4F1.402@primenet.com>
Piet van Oostrum wrote:
> sh.exe will also do this, and there may be some cases where it it more up
> to perls expectations than 4dos.com.
can you explain that? what does perl expect from the shell?
4dos is MOSTLY transparent to perl as a shell. the only problem i've
had is when running some of the perl test scripts, 4dos will get
confused by this:
unlink <something>;
and give a message indicating that it thinks a badly behaved batch is
misusing it's (4dos's) "for" command.
but changing those lines to:
unlink 'something';
fixes that little problem.
> On the other hand it would have been
> nice if you would be able to specify which one to use.
I'm not sure what you mean. I use 4dos. which one what??
> I have the PERLLIB variable set (because of perl4), and I could spawn
> subshells.
yes, i could too, under perl 4 in dos, or perl5 in windows.
under the ilyaz perl5 port running in dos it would affect the memory
usage strangely.
> I didn't do all these things, and still could get these working. But then I
> run it in a DOS box under MS Windows, maybe that's the difference.
yes, it runs fine in a dos box under windows. the trick was to run it
under DOS, and get full functionality. that is, do system and
backticking, use db_file, the perl debugger, etc UNDER DOS.
i admit that running it under windows, with the output in an adjacent
window, is really great for debugging. but i am a troglodyte. i like
dos. (and linux, without the X-gui!). I mostly run relatively short
scripts on thousands of numerical data files, with system calls to an
editor to view the output at points. i only use windows to net surf.
phil
------------------------------
Date: 10 Apr 1997 22:00:57 -0700
From: David Welton <davidw@efn.org>
Subject: Re: Perl on a PC
Message-Id: <87g1wydugm.fsf@efn.org>
"Robert Eaton" <rufus@tesser.com> writes:
>
> I am getting ready to start programming in Perl on my PC. I would like the
> programs to work on a Unix machine as well.
>
> Could I possibly get some opinions on the best PC operating system and any
> developement software for this task?
Both linux (www.linux.org) and FreeBSD (www.freebsd.org) would be
great for this. I personally use linux and love it. Development
software...well.. whatever you use on a UNIX machine:-)
Ciao,
--
David Welton
davidw@efn.org davidw@freenet.hut.fi http://www.efn.org/~davidw
Se quest'email e` in Italiano, mi dispiace per gli errori:-) FORZA PANTANI!
--Linuxista--
------------------------------
Date: 11 Apr 1997 03:00:00 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: perl parsing slashing question
Message-Id: <5ik9fg$eo7@pirate.shu.edu>
Tom Christiansen <tchrist@mox.perl.com> writes:
> [courtesy cc of this posting sent to cited author via email]
>In comp.lang.perl.misc,
> ebohlman@netcom.com (Eric Bohlman) writes:
>:David Alan Black (dblack@icarus.shu.edu) wrote:
>:options, #!/usr/bin/perl -whip
>Why do you guys what backup characters of `p'?
Well, I use a different character each week, and last week was 'o'.
But seriously.... more a matter of spacing out. The un-p'd
version (if the original poster is still with us):
#!/usr/bin/perl -wpi
s/>-</> </g;
(Eric can answer for the 'h' :-)
David Black
dblack@icarus.shu.edu
------------------------------
Date: 11 Apr 1997 01:29:05 -0400
From: jlerner@panix.com (Joshua Lerner)
Subject: Re: Regular expression help
Message-Id: <5iki71$d2b@panix3.panix.com>
In article <334D6CF9.277A6A54@csulb.edu>, <roehnelt@csulb.edu> wrote:
>The end of this line ends with an _is_ I know the i stands for case
>incensitive, but I couldn't find anything telling me what the s does.
>
>while ( $content =~ s#<\s*img.*?alt\s*=\s*"(.*?)".*?>#$1#is ) {}
>From the perlre(1) man page:
To facilitate multi-line substitutions, the "." character
never matches a newline unless you use the /s modifier,
which tells Perl to pretend the string is a single
line--even if it isn't. The /s modifier also overrides
the setting of $*, in case you have some (badly behaved)
older code that sets it in another module.
The _Mastering Regular Expressions_ book has a good but lengthy
description of /s and friends.
Joshua Lerner
------------------------------
Date: Thu, 10 Apr 1997 22:31:48 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Regular expression help
Message-Id: <4bbki5.qgf.ln@localhost>
roehnelt@csulb.edu wrote:
: The end of this line ends with an _is_ I know the i stands for case
: incensitive, but I couldn't find anything telling me what the s does.
: while ( $content =~ s#<\s*img.*?alt\s*=\s*"(.*?)".*?>#$1#is ) {}
The 's' means "make dot (.) match newline"
-----------------------
#! /usr/bin/perl -w
# few lines from the 'perlre' man page. (they come with perl you know...)
$_ =<<ENDVAR;
i Do case-insensitive pattern matching.
m Treat string as multiple lines.
s Treat string as single line.
x Extend your pattern's legibility with whitespace and comments.
ENDVAR
print "dot matched plain\n" if /Treat.*Treat/;
print "dot matched s\n" if /Treat.*Treat/s;
-----------------------
: any help would be appreciated.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Any reading of the regex man page (perlre) when encountering a
question about a regex would be appreciated.
(it is expected that you do this before posting you know)
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Fri, 11 Apr 1997 03:25:58 GMT
From: jamesl@netcom.com (James Logajan)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <jameslE8GEvB.7Jt@netcom.com>
Paul Prescod (papresco@csclub.uwaterloo.ca) wrote:
: Have you considered allowing the user to choose his or her own extension
: language?
Uh, no. Without going into all the horrid details, this wouldn't be such
a good idea, at least for this product.
------------------------------
Date: 10 Apr 1997 17:01:44 -0400
From: jete@dgs.dgsys.com (Jete Software Inc.)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5ijkfo$ice@DGS.dgsys.com>
In article <5ihaol$n3g@Masala.CC.UH.EDU>,
cosc19z5@bayou.uh.edu <cosc19z5@Bayou.UH.EDU> wrote:
>John Ousterhout (ouster@tcl.eng.sun.com) wrote:
>: In article <334B68EC.3F66@maths.anu.edu.au>, Graham Matthews <graham.matthews@maths.anu.edu.au> writes:
>: |>
>
>As for Tcl, it's there for one reason and one reason only -- strong
>corporate backing. We've got a powerful company that wants to
>make a quick buck and therefore is using its clout to force
>Tcl down our throats. This is the same tactic used by charlatans
>like Micro$oft. Indeed that's the only possible explanation
>as to why a glorified text preprocessor would even get a second
>look -- that and the fact that it is riding on the coattails
>of Tk.
>
The beginning of your story was pretty good, but you have run into
some serious plot problems right here.
I am an independent developer (so I was correctly free to choose
any language that I wished). I choose Tcl simply because at that time
it was the only thing that interefaced to TK. At that point in time,
Sun wasn't in the picture. I still use it, because it still has the
most extensive support (interfaces to largest number of extensions,
earliest support for new features) for TK than any other language.
Strong corporate backing is irrelevant!! Except if you believe in
large conspiracy theories than it is a necessity.
-- Norman
------------------------------
Date: 11 Apr 1997 05:28:05 GMT
From: marduk@gte.net (marduk)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5iki55$m98$2@news2.gte.net>
Why does everyone insist on crossposting to every damn newsgroup in
existance?
--
Fights between cats and dogs are prohibited by statute in Barber, North
Carolina.
------------------------------
Date: Thu, 10 Apr 1997 21:05:12 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: system & variables in perl
Message-Id: <o86ki5.4ve.ln@localhost>
nicholas david pesce (pesce@needle.cis.ohio-state.edu) wrote:
: I am trying to write a program that will check to see if anyone is on my
: machine inside a network...
: Thus I want to use the unix who command and translate the output into
: an array that can be checked for my username, and that it is on the console
: I understand that this is a simple program but I am having problems transfering
: the system("who") data into a perl array, could someone help a newbie out on
^^^^^^
use backticks:
@who = `who`;
or, chomp off the newlines at the same time:
chomp(@who = `who`);
: this problem.
: Thanks
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 11 Apr 1997 02:42:31 GMT
From: hclsmith@tallships.istar.ca (Hume Smith)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <5ik8en$896@news.istar.ca>
In article <5ik0lt$cjq$2@news9.gte.net>, olmstj@phat-media.com says...
>I don't mean to be rude, but if they license it to me at no cost to
>me, then it is free. ... Freeware
>means freely distributed software and MSIE falls in that class.
there are two usages of "free" getting mixed up here. there's the
"free"=(price=0), and "free"="liberated"... you get the program and the source,
with no licensing requirements (or even anti-licensing requirements).
MSIE has price zero (at the moment, anyway); but it is not liberated.
(check f*-ups)
------------------------------
Date: Thu, 10 Apr 1997 18:40:41 -0700
From: "Charles F. Ritter" <critter@quack.kfu.com>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <334D9699.2957075A@quack.kfu.com>
"Tim Behrendsen" <tim@a-sis.com> writes:
> But I don't even need to go there. Name one freely available
> *significant* product that is *clearly* better than *any* commercial
> product, regardless of price. There are some good programs of limited
> size that are not worth a commercial entity rewriting (some may
> say Emacs, but I wouldn't...), but I mean products of significant
> size and complexity.
I'm tired of listening to this arguement. People use computers for
_vasty_ different reasons. This is not the MacOS vs. Win95 debate
revisited. Apple and Microsoft both make personal productivity software,
little else. A GPF here a GPF there, who cares: "I guess It's time for a
little coffee break anyway." Computers used for "personal productivity"
are some of the least productive in terms of dollars spent per CPU cycle
- disk I/O too while were at it. Big systems software is almost all
written for mainframe and unix systems. Just because you don't surf the
net with it doesn't mean it's not great (read vital) software. Do you
think the airline reservation system runs on Windows?
Microsoft designed Win95 to compete with MacOS, they designed WinNT to
compete with Novell file servers. Only after seeing unix dominate true
system computing via the internet did Microsoft start worrying whether
or not their OS was good enough to compete. Microsoft will only become
interesting when they have effectively adopted most of the design
methodology that makes unix more powerful.
---
Charles Ritter
Microsoft NT - when they are finally finished it will be the best
documented unix operating system on the market.
------------------------------
Date: Fri, 11 Apr 1997 12:09:32 +0700
From: Justin Hickey <jhickey@hpcc.nectec.or.th>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <334DC78C.167E@hpcc.nectec.or.th>
Tim Behrendsen wrote:
>
> But I don't even need to go there. Name one freely available
> *significant* product that is *clearly* better than *any* commercial
> product, regardless of price. There are some good programs of limited
> size that are not worth a commercial entity rewriting (some may
> say Emacs, but I wouldn't...), but I mean products of significant
> size and complexity.
How about X Windows? It has been accepted by all UNIX vendors as their
windowing system (nothing else has challenged it that I know of ie I'm
talking strictly UNIX here), and I may be wrong and feel free to correct
me, but I do believe that it is free software. And it certainly is
significant in size and complexity IMHO.
--
Sincerely,
Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do. ---Anonymous
Jazz and Trek Rule!!!
==================================================================
------------------------------
Date: Wed, 9 Apr 1997 18:46:37 GMT
From: msohnius@novell.co.uk (Martin Sohnius x24031)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <E8Dw5p.IKz@ukb.novell.com>
Douglas Seay (seay@absyss.fr) wrote:
: Michael Craft wrote:
: >
: > > > Is France a socialist society?
: > >
: > > Yes, it is.
: >
: > France has a stock market, rich people, etc., just like every
: > other country.
: >
: > (The Socialist Party is not socialist.)
: Maybe we have diferent definitions of the idea "socialist".
: The French adopted socialism in 1848 (or there abouts)
: and haven't really looked back since.
Let's all hail that great socialist leader, Emperor Napoleon III.
;)
--
*******************************************************************
Martin F. Sohnius msohnius@novell.co.uk
Novell IS & T, Bracknell, England +44-1344-724031
*******************************************************************
* if (status = UNDER_NUCLEAR_ATTACK) *
* launch_full_counterstrike(); *
*******************************************************************
(C) 1997 M.F.Sohnius -- free distribution on USENET
(Not a spokesperson -- just a cyclist!)
------------------------------
Date: Wed, 9 Apr 1997 17:51:15 GMT
From: msohnius@novell.co.uk (Martin Sohnius x24031)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <E8DtLF.I9D@ukb.novell.com>
Alicia Carla Longstreet (carla@ici.net) wrote:
: Actually, exactly the opposite would be true. Socialism has one major
: flaw, a flaw that will forever make it never more than marginally
: successful (unlike capitalism, which, over time is always very
: successful). Socialism fails to take into account the simple fact that
: any human will work harder and smarter when he/she directly enjoys the
: fruits of his/her labor. Why should any person work harder than needed
: to provide for him/herself when everything beyond their needs goes to
: someone else. Socialism assumes that all people are willing to work for
: the social good.
And your definition of "successful" as applied to a social and political
order ignores anything else but material gains. Is it really the
purpose of society to make everyone work harder? Or rather to provide
a worthwhile and happy life?
--
*******************************************************************
Martin F. Sohnius msohnius@novell.co.uk
Novell IS & T, Bracknell, England +44-1344-724031
*******************************************************************
* if (status = UNDER_NUCLEAR_ATTACK) *
* launch_full_counterstrike(); *
*******************************************************************
(C) 1997 M.F.Sohnius -- free distribution on USENET
(Not a spokesperson -- just a cyclist!)
------------------------------
Date: Fri, 11 Apr 1997 11:58:25 +0700
From: Justin Hickey <jhickey@hpcc.nectec.or.th>
Subject: Re: Who makes more $$ - Windows vs. Unix programmers?
Message-Id: <334DC4F1.41C6@hpcc.nectec.or.th>
Kaz Kylheku wrote:
>
> In article <E8BryA.6Fq@hphbbs.ruhr.de>,
> H.P.Heidinger <hph@hphbbs.ruhr.de> wrote:
> >In article <860344556snz@genesis.demon.co.uk>,
> > fred@genesis.demon.co.uk (Lawrence Kirby) writes:
> ># In article <E844tC.I6p@hphbbs.ruhr.de> hph@hphbbs.ruhr.de "H.P.Heidinger" writes:
> > Unix is what it is ... a ``UNIfied eXecutive'' -- an so it should
> > be understood ... Amen! But if you wish, go fondeling your FAQ ...
>
> Sorry, your silly insistence that UNIX stands for ``UNIfied
> eXecutive'' (ha ha) doesn't make it so.
>
> The fact that UNIX is a pun on Multics is no urban legend, but a simple
> historic fact. If you don't believe Lawrence Kirby, please write mail to
> Brian Kernighan.
OK, here we go. Let's try to end this thread a second time!
This "historic fact" was posted to this thread previously by someone
(I'm sorry, I can't remember your name) which I thought would end this
thread. However, I think it needs to be repeated for those who may have
missed it.
In the book "The UNIX Programming Environment" -- by Brian Kernighan and
Rob Pike, published by Prentice-Hall, copyright 1984 by Bell Telephone
Laboratories, Inc. ISBN 0-13-937699-2, ISBN 0-13-937691-X {PBK} (for
those of you who want to verify the source) -- on the first page of the
preface there is a footnote for the term UNIX which is as follows:
UNIX is a trademark of Bell Laboratories. "UNIX" is *not* an acronym,
but a weak pun on MULTICS, the operating system that Thompson and
Ritchie worked on before UNIX.
For those of you who don't know who Thompson and Ritchie are, they are
Ken Thompson and Dennis Ritchie, who in 1973, rewrote the UNIX kernal in
C, essentially providing the base kernal that the UNIX systems of today
are based on.
Now, since UNIX is a trademark of Bell Laboratories, people can debate
the meaning of UNIX until they are blue in the face and it still will
not change the fact that UNIX is not an acronym!! Unless of course Bell
Laboratories decides to change the meaning of UNIX:)
So, with that said let's end this thread and get on with another
interesting topic.
--
Sincerely,
Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do. ---Anonymous
Jazz and Trek Rule!!!
==================================================================
------------------------------
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 276
*************************************