[6619] in Perl-Users-Digest
Perl-Users Digest, Issue: 244 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 6 22:07:21 1997
Date: Sun, 6 Apr 97 19:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 6 Apr 1997 Volume: 8 Number: 244
Today's topics:
$ Terminator?? - <cottert@sonic.net>
Re: ALPHANUMERIC CHECK!! (brian d foy)
Re: CORRECT Re: Q: sorting by date (Ollivier Robert)
Re: Live Randal Schwartz interview (Eric S. Johansson)
Looking for Perl-based NNTP passthrough utility. (Lloyd Zusman)
Re: Loop-Problem.... <tchrist@mox.perl.com>
Re: Match ? (Brooks Davis)
Need to hack RCS files (Kevin Cline)
Re: No GUI environment for Perl? <jong@mrc-lmb.cam.ac.uk>
Re: Ousterhout and Tcl lost the plot with latest paper <SeeMySignature@for.my.email.address>
Re: Ousterhout and Tcl lost the plot with latest paper (Michael David WINIKOFF)
Re: Ousterhout and Tcl lost the plot with latest paper (Paul Prescod)
Re: Perl, Delphi, Linux, Windows, and databases (VB5E?) <charlys@iname.com>
permission trouble with perl ISAPI under NT 4.0 <tclark@med.unc.edu>
Re: Replace:How do I emulate it? <jong@mrc-lmb.cam.ac.uk>
Split and Print? <hamilte@one.net>
Re: Unix and ease of use (WAS: Who makes more ...) <smallfry@ntr.net>
What does "UNIX" stand for.. (Re: Who makes more $$..) <vladi_mip@uniserve.com>
WinPerl <cristo@consotech.se>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Apr 1997 00:07:21 GMT
From: "Tammy Cotter" <cottert@sonic.net>
Subject: $ Terminator?? -
Message-Id: <01bc42e8$1005e940$24e6c9d0@cottert>
Would appreciate some help. New to PERL, so I have to ask a stupid
question.
What is a string terminator, and where do I put it.
This is the script I'm trying to run: (as you can tell it's borrowed
heavily from formmail - I'll put the copyright statement in when the thing
works).
Keep getting an error 500 when I try to run it from the web and no string
terminator before line 92 when I do perl -w.
Thanks.
#!/usr/bin/perl
$mailprog ='/usr/lib/sendmail';
$domo='majordomo@list.sonic.net';
$subject='subcribe powermail';
$return='http://www.lp-llc.com/powermail/success.htm';
$oops='http://www.lp-llc.com/powermail/oops.htm';
&parse_form;
&check_required;
&return_html;
&send_mail;
sub parse_form {
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
# Split the name-value pairs
@pairs = split(/&/, $ENV{'QUERY_STRING'});
}
elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
}
else {
&error;
}
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if ($name eq 'email' && ($value)) {
$CONFIG{$name} = $value;
}
elsif ($name eq 'required') {
@required = split(/,/,$value);
}
elsif ($name eq 'env_report') {
@env_report = split(/,/,$value);
}
else {
if ($FORM{$name} && ($value)) {
$FORM{$name} = "$FORM{$name}, $value";
}
elsif ($value) {
$FORM{$name} = $value;
}
}
}
}
sub check_required {
foreach $require (@required) {
if ($require eq 'email') {
if (!($CONFIG{$require}) || $CONFIG{$require} eq ' ') {
&error;
}
}
elsif (!($FORM{$require}) || $FORM{$require} eq ' ') {
&error;
}
}
}
sub return_html {
{
print "Location: $return\n";
}
}
sub send_mail {
# Open The Mail Program
{
open(MAIL,"|$mailprog -t");
print MAIL "To: $domo\n";
print MAIL "From: $CONFIG{'email'}\n";
print MAIL "Subject: $subject\n";
print MAIL " $subject\n";
print MAIL
"---------------------------------------------------------------------------
\n\n";
close (MAIL);
}
}
sub error {
{
print "Location: /$oops\n";}
}
------------------------------
Date: Sun, 06 Apr 1997 18:02:35 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: ALPHANUMERIC CHECK!!
Message-Id: <comdog-0604971802350001@nntp.netcruiser>
In article <5htepn$b98@Holly.aa.net>, jouni@website1.carelian.fi wrote:
[redirected to comp.lang.perl.misc]
> How in the hell I could check whether my variable consists of
> alphanumeric data or ot (in PERL) ??
here's checking for alphanumeric characters (but ensuring there aren't
non-alphanumeric characters). you'll have to supply the hell yourself
though.
if ( $string =~ m/[^a-zA-Z0-9]/ )
{
print "Contains non-alphanumeric characters"
}
else
{
print "Contains only alphanumeric characters"
}
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: 6 Apr 1997 22:05:10 GMT
From: roberto@eurocontrol.fr (Ollivier Robert)
Subject: Re: CORRECT Re: Q: sorting by date
Message-Id: <5i96mm$84f$3@polaris.eurocontrol.fr>
[courtesy cc of this posting sent to cited author via email]
In article <crusso-2903971101510001@buzz.russo.org>,
Chris Russo <crusso@alink.net> wrote:
> @sortedkeys = map { $_->[1] }
> sort { $a->[0] <=> $b->[0] }
> map { m!(\d\d)/(\d\d)/(\d\d)!; [ "$3$1$2", $_ ] } keys %ARRAY;
Why not
@sortedkeys = map { $_->[1] }
sort { $a->[0] <=> $b->[0] }
map { [ (split /\//)[-1], $_ ] } keys %ARRAY;
--------------------------------------------------------
#! /usr/local/bin/perl
#
require 5.003;
use Benchmark;
my @dates = (
"03/06/67",
"05/23/02",
"02/03/99",
"03/23/54",
"04/19/67",
"08/12/89",
"12/02/38",
"07/10/90",
"11/17/91",
"03/23/43",
);
my $split_dates;
my $search_dates;
sub split_fn
{
my @out = map { $_->[1] }
sort { $a->[0] <=> $b->[0] }
map { [ (split /\//)[-1], $_ ] } @dates;
$split_dates = \@out;
}
sub search_fn
{
my @out = map { $_->[1] }
sort { $a->[0] <=> $b->[0] }
map { m!(\d\d)/(\d\d)/(\d\d)!; [ "$3$1$2", $_ ] } @dates;
$search_dates = \@out;
}
timethese (1000, {
'split' => \&split_fn,
'search' => \&search_fn,
});
--------------------------------------------------------
Gives:
--------------------------------------------------------
Benchmark: timing 10000 iterations of search, split...
search: 46 secs (43.35 usr 0.12 sys = 43.47 cpu)
split: 34 secs (33.07 usr 0.02 sys = 33.09 cpu)
--------------------------------------------------------
Using split is not only faster but it is not dependent on the year's
length...
--
Ollivier ROBERT -=- Eurocontrol EEC/TS -=- Ollivier.Robert@eurocontrol.fr
Usenet Canal Historique FreeBSD: there are no limits !
------------------------------
Date: 06 Apr 1997 18:17:15 -0400
From: esj@harvee.billerica.ma.us (Eric S. Johansson)
Subject: Re: Live Randal Schwartz interview
Message-Id: <wk4tdjdces.fsf@harvee.billerica.ma.us>
yemm@ucf.edu (Colin Yemm) writes:
>
> On Mon, 31 Mar 1997 18:12:50 -0500, "J. Trudel" <jdt@insight.att.com>
> wrote:
>
> >For some reason, I saw this and wondered what a Dead Randal
> >Schwartz interview would be like.
>
> "He's not dead! He's only sleeping!"
hmm, thought he was pining for the fjords...
(from the famous norwegian blue schwartz skit)
--- eric
------------------------------
Date: 6 Apr 1997 23:39:28 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Looking for Perl-based NNTP passthrough utility.
Message-Id: <slrn5kgd0m.9kn.ljz@sunspot.tiac.net>
I'm looking for a Perl-based NNTP passthrough facility which works as
follows:
Host-A: Contains a news server with standard NNTP access.
Host-B: Contains no news server and therefore no NNTP service.
Host-A will run this passthrough server. This server monitors a user
port of my choosing (probably a port whose ID is >= 1024) and passes
all communication from this port to the NNTP port (119). All
communications coming back from NNTP port 119 will get sent back
through this user port.
On Host-B I want to be able to run standard, NNTP-based newsreaders
which connect via NNTP to Host-A on this user port. As long as the
passthrough server is running on Host-A, Host-B will then be able to
get more or less standard NNTP access.
I don't need anything that's NNTP-specific. A generic, lightweight
facility for passing data back and forth between two ports would be
more than sufficient for my needs.
I vaguely remember seeing something like this in the Perl world over
the past year or so, but despite having searched in CPAN, I can't find
anything resembling this.
Any ideas?
Thanks in advance.
--
Lloyd Zusman 01234567 <-- The world famous Indent-o-Meter.
ljz@asfast.com ^ Indent or be indented.
------------------------------
Date: 6 Apr 1997 22:31:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Loop-Problem....
Message-Id: <5i988k$5fi$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, clay@panix.com (Clay Irving) writes:
: &SendEmail("$address");
Quotes of doom.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"Espousing the eponymous /cgi-bin/perl.exe?FMH.pl execution model is like
reading a suicide note -- three days too late."
--Tom Christiansen <tchrist@mox.perl.com>
------------------------------
Date: 6 Apr 1997 23:36:42 GMT
From: brdavis@orion.ac.hmc.edu (Brooks Davis)
Subject: Re: Match ?
Message-Id: <5i9c2a$7le$1@cinenews.claremont.edu>
Geoffrey Hebert (soccer@microserve.net) wrote:
: # Let's check the URL's format
: /http:\/\/([^\/]*)\/*([^ ]*)/;
: $site=$1;
: if (!$site) {die("invalid URL format")}
:
: #
: # http:// first part we got it is matching for http://
: # ([^\/]*) one or more /nnnnnn sets
: Why would I not have to include .*
: like [^\/.*]*
The '^' in [^\/]* causes the the []'s to match anything EXCEPT what
follows the '^'. Thus, in this case, [^\/] matches anything BUT a '/'.
For more information, look at the perlre manpage and search for "Version 8'
The third instance (in the perl 5.003 version anyway) has a paragraph
which tells you what you want to know.
-- Brooks
--
Brooks Davis +------------------------------------------------+
brdavis@hmc.edu | "_Slackware_ [Linux] is the MacOS of UNIXes." |
Harvey Mudd College | -- Richard Garnish |
340 E. Foothill Blvd. | on alt.sysadmin.recovery |
Claremont, CA 91711 +------------------------------------------------+
------------------------------
Date: Sun, 06 Apr 1997 21:31:54 GMT
From: clines@airmail.net (Kevin Cline)
Subject: Need to hack RCS files
Message-Id: <3348162c.1911280@news.airmail.net>
Does anyone have any code to parse RCS files?
------------------------------
Date: Sun, 06 Apr 1997 23:44:11 +0100
From: Jong <jong@mrc-lmb.cam.ac.uk>
To: blueox@mail.cyberhighway.com
Subject: Re: No GUI environment for Perl?
Message-Id: <3348273B.2781@mrc-lmb.cam.ac.uk>
blueox@mail.cyberhighway.com wrote:
>
> Is there any gui environment for programming available? I don't mind
> working with text files made in dos, but a gui wouldn't hurt. Also, it
> seems that if I try to run a .pl file from windows explorer, it just
> flashes on the screen for a second. Do I have to keep the dos shell up and
> running all the time to be able to run Perl? Are any other shells
> available? Again, I might be overlooking something in the FAQ.
>
> Thanks in advance,
>
> blueox
No not yet. The best so far is Tk for perl.
You can use Qt extension etc, if you want
to make GUI by perl.
Why don't you try to make one?
Jong
--
I support Perl, Linux ...
With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?
) Linux Newsletter
http://www.smli.com/people/john.ousterhout/scripting.html
------------------------------
Date: 04 Apr 1997 10:09:13 -0800
From: Christopher Hylands <SeeMySignature@for.my.email.address>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <v5upvwa8xti.fsf@kahn.eecs.berkeley.edu>
In article <E83MAz.IA1@undergrad.math.uwaterloo.ca> papresco@csclub.uwaterloo.ca (Paul Prescod) writes:
In article <3343D13C.41C6@acm.org>, Thant Tessman <thant@acm.org> wrote:
>Chris Bitmead wrote:
>
>> [...] Remember that Sun is pushing Tcl for some obscure reason, and
>> Ousterhout is apparently working for Sun now, [...]
>
> I've been told (by friends who follow this stuff more closely than
> I do) that Sun has already lost control of Java to the Evil
> Empire. This might explain it.
Sun is pushing Java more than ever. The reason for their interest
in TCL seems to be this dichtomy between systems programming
languages and scripting languages.
----
Seems to me that the combination of Java and Tcl is _very_ powerful.
My point is that you have your lunch and eat the other guy's too :-)
It seem like most Java GUIs are ugly as sin (misaligned entry boxes of
different lengths etc.). Tk GUIs are easy to tune because you can
keep evaluating a proc until it looks right. With Java, you usually
have to recompile and restart. (SpecJava might help here, I don't know)
However, the numerical performance of Tcl is rather abysmal, whereas
if you do big numerical operations in Java, then you can see a good
performance increase.
John Reekie here at UC Berkeley has shown some promising results of
combining Itcl with Java so that you can have easy access to Java
objects from Itcl. If anything, this seems to make testing Java
classes very easy.
I updated the tcljava0.4 interface to run with JDK1.1 under NT4
and it seems to be useful, check out:
http://ptolemy.eecs.berkeley.edu/~cxh/ptpub/tcljava.html
-Christopher
--
Christopher Hylands, Ptolemy Project Manager University of California
cxh@eecs.berkeley.edu US Mail: 558 Cory Hall #1770
ph: (510)643-9841 fax:(510)642-2739 Berkeley, CA 94720-1770
home: (510)526-4010 (if busy -4068) (Office: 493 Cory)
------------------------------
Date: 7 Apr 1997 00:25:54 GMT
From: winikoff@mundook.cs.mu.OZ.AU (Michael David WINIKOFF)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5i9eui$d56@mulga.cs.mu.OZ.AU>
ouster@tcl.eng.sun.com (John Ousterhout) writes:
> Come on! All this shows is the inconveniece of using the MFC
> classes. An interface exactly the same as the Tcl one could easily be
> written in C++.
>I invite anyone who believes this to try to do it, and post the results.
>I've had this argument before, and when people do this, one of two things
>happens: either they eventually concede that this is hard to do in C++, or
>they define new C++ APIs that are essentially untyped (e.g. they use
>strings for everything). This just supports my arguments that types get
>in the way of gluing. You can build untyped APIs in strongly typed
>languages, but they tend to be clumsy because the languages are designed
>to encourage strong typing. If you need an untyped approach, you might
>as well use a language designed for that.
Another conclusion that could be drawn is that the type systems of C++, Java
etc. don't allow the convenience that can be achieved using untyped languages.
Type systems are advantageous. The white paper states that TCL/Tk is safe
in that errors are caught. This is a great improvement over C. However, the
problem is *when* the errors are caught -- with a dynamically typed language
errors can easily turn up after the product is delivered. With a statically
typed language there is a *guarantee* that certain classes of errors can not
occur in running programs.
The best of both worlds would be a language that allows (most) of the
convenience of a dynamically typed language but has a static type system.
One such language is TkGofer
http://www.informatik.uni-ulm.de/abt/pm/ftp/tkgofer.html
By using a more advanced type system than C++ or Java it enables convenient
programming which is checked at compile time.
For example, a program which creates a yellow label and a button can be written as
(taken from http://www.informatik.uni-ulm.de/fakultaet/abteilungen/pm/ftp/tkgofer/user.html)
ex_button :: IO ()
ex_button = start $
do w <- window [title "My Example2"]
l <- label [text "hello world", background "yellow"] w
b <- button [text "press me", command quit] w
pack (l << b)
This is not far from being as readable as the TCL/Tk equivalent:
toplevel .w
wm title .w "My Example2"
label .w.l -text "Hello World" -bg yellow
button .w.b -text "Press me" -command exit
pack w.l w.b -side left
The packing mechanism provided in TkGofer is actually *more* readable than
TCL/Tk's.
Whereas in TCL/Tk an attempt to write "button .b -command 12" will not be
caught until the button is actually hit, the equivalent TkGofer code will
not be accepted by the compiler.
There is little doubt that so called "scripting" languages are significantly
more productive than traditional "system" languages (C, C++, possibly Java)
for appropriate application domain. The interesting question is which aspects
of "scripting" languages helps in achieving this advantage.
The white paper suggests that dynamic typing is the source of the higher
productivity. I feel that it is more accurate to say that the sort of static
typing used in traditional "system" languages is a disadvantage.
Cheers,
Michael
winikoff@cs.mu.oz.au
http://www.cs.mu.oz.au/~winikoff
--
Michael Winikoff winikoff@acm.org http://www.cs.mu.oz.au/~winikoff
Computer science research fellow. University of Melbourne, Australia.
"Computer Science is no more about computers than astronomy is about
telescopes." -- E. W. Dijkstra
------------------------------
Date: Sun, 6 Apr 1997 21:09:04 GMT
From: papresco@csclub.uwaterloo.ca (Paul Prescod)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <E88Ir4.EK4@undergrad.math.uwaterloo.ca>
In article <5i7euq$cmg@engnews2.Eng.Sun.COM>,
John Ousterhout <ouster@tcl.eng.sun.com> wrote:
> His arguments on "typeless" languages is useless.
> You don't need a "scripting language" to
> get usable abstractions without the need
> to deal with low-level issues.
>
> button .b -text Hello! -font {Times 16} -command {puts hello}
>
> In Macintosh Common Lisp I'll write this as:
>
> (make-instance 'button-dialog-item
> :dialog-item-text "Hello"
> :view-font '("Times" 16)
> :dialog-item-action (lambda (item) (print "hello")))
>
>I think this example supports my claim that scripting languages are a
>lot easier to use when you need to mix and match lots of things of
>different types. The MCL example is a lot more verbose and complicated
>than the Tcl example.
Easier to use for people who are not knowledgable about the language? Yes.
Easier to use for people who are? No. The latter is certainly no harder
for a MCL programmer than the former is for a TCL programmer. It will also
be easier to maintain, for all of the usual reasons.
Paul Prescod
------------------------------
Date: 7 Apr 1997 00:19:48 GMT
From: "Karlheinz Spdth" <charlys@iname.com>
Subject: Re: Perl, Delphi, Linux, Windows, and databases (VB5E?)
Message-Id: <01bc42e9$9c1709e0$2a99c5c1@charly>
> Chris Schoenfeld wrote:
>
>
> Delphi wants to use Oracle, Sybase, Informix, or Interbase.
> From what I understand, Perl has modules for some/all of these in
> various stages of robustness.
> NONE of these databases support Linux - GRRRR!!!
>
It is possible to use the ODBC driver of mysql to access a Linux server.
--
-------------------------- EMAIL ONLY ------------------------
Karlheinz Spaeth
Werkstr. 5
73312 Geislingen, Germany
-------------------------------------------------------------------
------------------------------
Date: Sun, 06 Apr 1997 19:48:08 -0400
From: "Thomas B. Clark" <tclark@med.unc.edu>
Subject: permission trouble with perl ISAPI under NT 4.0
Message-Id: <33483638.7ED3@med.unc.edu>
I am attempting to run perl ISAPI (build 304) on NT 4.0
server with IIS 3.0, including all updates and patches.
I need to have some public trees (i.e. executable by
IUSR_EVE) and some private trees, requiring authentication.
Unfortunately, it seems that I cannot have both.
It appears to me that NT is checking for permissions on
c:\perl\bin, but not the .pl file. Example: When I make
c:\perl world-executable, everything works for the public
trees, but the private trees (directories containing .pl
scripts that require authentication) fail with a permission
error.
When I change permissions on c:\perl\ to deny IUSR_EVE, the
private trees work as they are supposed to, allowing
authentication, but the public trees also request a
password, as you would expect.
I am at a total loss to understand why this is happening
with perl, since Microsoft's own database connector seems
to manage both public and private trees.
Incidentally, the same thing happens when NT is configured
to run c:\bin\perl on scripts instead of the isapi .dll
file.
------------------------------
Date: Sun, 06 Apr 1997 23:42:29 +0100
From: Jong <jong@mrc-lmb.cam.ac.uk>
To: Steve Oldridge <steveo@nortel.ca>
Subject: Re: Replace:How do I emulate it?
Message-Id: <334826D5.167E@mrc-lmb.cam.ac.uk>
Steve Oldridge wrote:
>
> I'm currently working on a script that searches all files on a system
> and replaces one string with another. I'm fairly new to perl and unix
> and I can't figure out how to search the line for instances of the
> string and then replace them. I'm also looking for a way to tell
> whether what I'm looking at is a file or a directory. Right now I
> simply use the fact that files normally have a "." in their name, but
> obviouselly this isn't going to be the case all of the time. Any help
> would be greatly appreciated.
> Thanks in advance
> Steve Oldridge
use if(-f $file){ .. }
if(-d $file){ .. }
etc to see if it is a file or dir.
I enclose a quick hack by me.
Note the code replaces string in one single line.
If there are two instances, it will ignore the
second one.
Jong
#!/usr/bin/perl
# Last Update by ./update_subroutines.pl: Thu Jan 2 03:26:51 GMT 1997
# Made by ./make_standalone_subroutines.pl at: Tue Aug 27 13:17:55 EDT
1996
#________________________________________________________________________
# Title : replace_text.pl
# Usage : &replace_text(@ARGV);
# Function : finds patterns of text and replaces them in multiple input
files
# Example : replace_text.pl old_text new_text FILE_NAME
# Warning : This produces a temporary file and rename it...
# Keywords :
# Options :
# Returns : nothing
# Argument : reference of one array of file names in pwd
# Version : 1.1
# Enclosed :
#--------------------------------------------------------------------
&replace_text(@ARGV); # replace_text.pl old new file1 file2,,,,,
#________________________________________________________________________
# Title : replace_text
# Usage : &replace_text(\@input_array_of_filenames);
# Function : finds patterns of text and replaces them in multiple input
files
# Example :
# Warning : This produces a temporary file and rename it...
# Class :
# Keywords :
# Options :
# Package :
# Reference :
# Returns : nothing
# Tips :
# Argument : reference of one array of file names in pwd
# Todo :
# Author : jong
# Version : 1.3
# Enclosed :
#--------------------------------------------------------------------
sub replace_text{
my ( @input_files );
$|=1;
my $old=shift ;
my $new=shift;
@input_files=@_;
my($file);
for $file(@input_files){
open (IN, "$file");
my @lines=<IN>;
close(IN);
open (OUT, ">$file");
for (@lines){
if($_=~/^(.*)($old)(.*)$/){
print "\nmatched $_ in $file\n";
$temp="$1$new$3\n";
print OUT $temp;
}else{
print OUT $_;
}
}
close OUT;
if($file =~/\.pl$/){ chmod 0755, $file; } # this makes it execu..
}
}
#________________________________________________________________________
# Title : read_dir_names_only
# Usage : @all_dirs_list =
@{&read_dir_names_only(\$absolute_path_dir_name, ....)};
# Function : read any dir names and and then put in array.
# Example :
# Warning : This does not report '.', '..'
# Only file names are reported. Compare with &read_any_dir
# Class :
# Keywords :
# Options :
# Package :
# Reference :
# Returns : one ref. of array.
# Tips :
# Argument : takes one or more scaler references. ('.', \$path, $path,
... )
# Todo :
# Author : A Biomatic
# Version : 3.1
# Used in :
# Enclosed :
#--------------------------------------------------------------------
sub read_dir_names_only{
my($in_dir, $i,$k, @possible_dirs,
@final_files, $full_dir, $pwd, $path,@read_files);
$pwd=`pwd`; chomp($pwd); $full_dir=1;
for($k=0; $k < @_; $k++){
if ( ($_[$k] eq '.') || !(defined($_[$k]))){ $in_dir=$pwd; }
elsif(!(ref($_[$k]))){ $in_dir=$_[$k]; }
elsif(ref($_[$k])){ $in_dir =${$_[$k]}; }
if($in_dir =~ /^([\w\-\.]+)$/){ $in_dir="$pwd\/$in_dir"; $full_dir =
0; }
else{ $full_dir =1; }
########## Main READING PART ##########
opendir(DIR1,"$in_dir");
@read_files = readdir(DIR1);
for($i=0; $i < @read_files; $i ++){
$read_files[$i]="$in_dir\/$read_files[$i]";
if( ($read_files[$i] !~ /\/\.\.?$/) && ( -d $read_files[$i]) ){
$read_files[$i]=~s/\.\///; ## removing ./ in front of dirs (in bash)
push(@final_files, "$read_files[$i]");
}
}
}
return([sort @final_files]);
}
--
I support Perl, Linux ...
With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?
) Linux Newsletter
http://www.smli.com/people/john.ousterhout/scripting.html
------------------------------
Date: Sun, 06 Apr 1997 20:47:29 -0400
From: Elizabeth Hamilton <hamilte@one.net>
Subject: Split and Print?
Message-Id: <33484421.4624@one.net>
I have a text file that I have been able to parse for particular
patterns. The file handles are defined in an earlier piece of code.
This program worked fine until I tried to split and print!
Example:
while (<INFILE>){
# This version of the if clause works fine.
if (m#/gclc/members.html#) {
print OUTFILE;
print MAIL;
}
# This one produces error messages (See below)
if (m#/gclc/members.html#) {
($hits, $bytes, $size, $304, $URL) = split(/\s+/, $_);
print $hits >OUTFILE;
print MAIL;
}
}
close <INFILE>;
clsoe <OUTFILE>;
-------------------------
Error messages:
Identifier "main::size" used only once: possible typo at ./gclclog6.pl
line 33.
Identifier "main::bytes" used only once: possible typo at ./gclclog6.pl
line 33
Identifier "main::URL" used only once: possible typo at ./gclclog6.pl
line 33.
Modification of a read-only value attempted at ./gclclog6.pl line 33,
<INFILE>
hunk 106.
Thank you in advance for your help!
Elizabeth
--
Elizabeth Hamilton
University of Cincinnati Libraries
Coordinator, GCLC Web Site:
http://www.libraries.uc.edu/gclc/
------------------------------
Date: 6 Apr 1997 20:44:44 GMT
From: "Jere" <smallfry@ntr.net>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <01bc42cb$6954f120$49b850ce@smallfry.ntr.net>
I don't believe that you have seen the meaning of "crude" in context. The
only newsgroup to which this will post that I read regularly is visual
basic. The cross posting to push your technology is CRUDE way to vent
disappointment in being in a secondary operating system. I also work in a
secondary operating system which I will not mention because I do not wish
it to be added to your cross post.
It has been around for 25 years and is not as popular as I would like to
see it. I am, however, able to see why it lacks the popularity of either NT
or UNIX.
In business today companies want a system that will do what they want with
minimal technical staff and without the opportunity for techies to screw
things up. They want to be able to communicate with other systems, have a
turnkey system but be able to respond to business changes with a minimum of
development investment. That seems to be a better description of Windows
than it does of UNIX.
the "crude" in UNIX has less to do with lack of capability than it does
with how easily a pseudo tech can crash the system.
The issue is not operating system but personnel. Us technical folks are
useless if we are not first attuned to the needs of our bosses. UNIX has
its place and always will but PROBABLY not in business. Business is about
profits (income - expenses) and the best computer technology is the one
that creates the best supplement to profits. Regardless of operating
system, if a picture does not provide information faster than the written
word it is useless to business.
[snip]
> : For over 25 years I've been hearing two explanations for why Unix is
not
> : more popular:
> : 1) Computer users are stupid.
> : 2) Marketing forces cloud peoples judgement.
>
> Unix is 25 years old, but still is in the front of the latest directions
> of technology, like "The Web", "TCP/IP", "Java".
[chop]
------------------------------
Date: Sun, 06 Apr 1997 17:23:33 -0700
From: Da Borg <vladi_mip@uniserve.com>
Subject: What does "UNIX" stand for.. (Re: Who makes more $$..)
Message-Id: <33483E85.1B8427A3@uniserve.com>
Lawrence Kirby wrote:
>
> In article <E844tC.I6p@hphbbs.ruhr.de> hph@hphbbs.ruhr.de "H.P.Heidinger" writes:
>
> > `Unix' stands for `UNIfied eXecutive' and is nothing but a
> > philosophy for a unified executive
>
> False - Unix doesn't stand for anything. It is a pun on the name of OS from
> which it was derived - Multics. Check the relevant FAQs.
Actually, "UNIX", (originally intended to be spelled as "Unics" and
later, "Unix") was a pun on Multics which was one of Unix predecessors.
Multics stood for "MULTiplexed Information and Computer System"
(watch for those capitals). "UNIX" stands for "UNiplexed Information
and Computer System". My references: FAQ for comp.unix.shell and a
copy of original Multics manual. I think I also saw "UNIX" interpreted
that way in one of O'Reilly books on Unix programming.
Regards,
Da Borg
--
When sending private email, please remove underscores in "vladi_mip".
#include <disclaimer.h> | *Good pings come in small packets*
vladimip AT uniserve.com | Ceterum censeo Microsoftam delendam esse
Vancouver, B.C. | SIGSIG -- signature too long (core dumped)
------------------------------
Date: Mon, 07 Apr 1997 00:53:58 -0700
From: Cristo <cristo@consotech.se>
Subject: WinPerl
Message-Id: <3348A816.15DE@consotech.se>
I have a little question:
Info: I got Win95, PC
Software: WinPerl beta 3 for Windows(of course)
Question: Is there a new version of WinPerl? If true then
{
Where can I get it?
else
{
Ignore this message
}
# Cristo...A Perl Fan :-)
------------------------------
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 244
*************************************