[7331] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 956 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 1 10:07:11 1997

Date: Mon, 1 Sep 97 07:00:30 -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           Mon, 1 Sep 1997     Volume: 8 Number: 956

Today's topics:
     Re: 5.004 for Win32 <pvhp@forte.com>
     Re: Better than Soundex lvirden@cas.org
     Can HYPNOSIS really improve your Sensuality? Cheri@aol.com
     Cannot store DBM-file <mortensi@idt.ntnu.no>
     Re: Check if a URL exists lvirden@cas.org
     Creation Date of a File <pdenman@ims.ltd.uk>
     Difficulties with \'s  in recursive directory tree scri (Koos Pol)
     Re: filehandle - select problem denis@mathi.uni-heidelberg.de
     Re: Here Document with FILEHANDLE <rpsavage@ozemail.com.au>
     Include external subroutines <ets96aja@student.hk-r.se>
     Re: Is there a perl IDE? (Charlie Stross)
     Re: Matt Wright's Counter on Windows NT (Mike King)
     mod_perl Help.... Invalid command PerlHandler ...Invali <guitarplayer@hotmail.com>
     Re: Multithreading in Perl? (Malcolm Beattie)
     Re: Perl & Shadow Passwords authentitacion. <tom@mitra.phys.uit.no>
     Re: Perl script question for gurus <llamashe@microtec.de>
     Re: Perl-Win32: diagnostics module doesn't work; missin <ule@uni-muenster.de>
     Re: perl/win95/Long File Names <mturk@globalserve.net>
     Perl5.004 on AIX 4.2 Installation problem rey@ilo.org
     Probably a dumb request, but... <andrewsmith@isc-uk.demon.co.uk>
     Re: Probably a dumb request, but... (Eric Bohlman)
     Provider removed <!--EXEC > (Orlando Frooninckx)
     Re: Randal and Intel, Was: Scrambling using tr <tom@mitra.phys.uit.no>
     Re: struct in perl <jbokma@caiw.nl>
     Re: version of Perl5 for NT4 <pvhp@forte.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 31 Aug 1997 22:37:01 -0700
From: Peter Prymmer <pvhp@forte.com>
To: COWBYS <cowbys@aol.com>
Subject: Re: 5.004 for Win32
Message-Id: <340A547D.26B@forte.com>

COWBYS wrote:
> 
> i caught a message in comp.lang.perl.announce the other day from someone
> who stated they were providing the compiled version of Perl 5.004 for Win
> 32 for those of us who are "compiler ignorant",
> 
> does anyone know whereI can download this already compiled version ?
> 
> any advice appreciated, please reply to davef@aasp.net

I thought it was mentioned in the anouncement itself, but anyway
it is available from any CPAN site.  Try going to the muxer at:

    http://www.perl.com/CPAN/authors/Gurusamy_Sarathy/

then look for the most recent file with /bindist/ in the name.

Peter Prymmer


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

Date: 1 Sep 1997 11:50:25 GMT
From: lvirden@cas.org
Subject: Re: Better than Soundex
Message-Id: <5uea61$5td$1@cas.org>

Cc'd to poster...

According to David Greaves  <david@telekinesys.co.uk>:
:I'm after an algorithm thats better than Soundex at generating keys for
:words in spoken language (ascii/western encoding) documents.
:
:I'm also interested in language/rule based stuff like removing 'ing' so
:that word stems can be created: (handling->handl) <> handle :(
:
:Does anyone know anything about this?
:References... gratefully received.

Search thru DejaNews and Reference.com .  Last spring this topic came up
and several people posted code to do alternate, and supposedly better,
string searching algorithms.  Unfortunately, I just checked the CPAN
module list and nothing jumped out at me as being the code in question.

-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Sun, 31 Aug 1997 17:29:12
From: Cheri@aol.com
Subject: Can HYPNOSIS really improve your Sensuality?
Message-Id: <5ud1r0$np2$7941@kayrad.ziplink.net>

Is this the latest fad from California or is it really catching on like they say?  Can Hypnosis really improve a dull love life?  Does HYPNOSEX really make your senses more intense?   
What do you think?   Cheri.
<< Life Publications' hottest product is HYPNOSEX!

   http://www.acoates.com/hypno >>



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

Date: 1 Sep 1997 09:57:36 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Cannot store DBM-file
Message-Id: <5ue3ig$cc5$1@due.unit.no>

This is probably the most silly question of today, but I
still can't figure it out. I have made this testprogram:

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

use Fcntl;
use AnyDBM_File;

tie (%db,"AnyDBM_File","dbfile","O_CREAT|O_RDWR","0664");
$db{'key'}='value';
untie(%db);
----------------------

but when I am done, no file is made. If I use dbmopen instead,
everything works fine. But if I then later tries to overwrite the
new-made dbfile, I am not allowed. In my case I use NDBM.

Can someone please explain to me?

Morten Simonsen


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

Date: 1 Sep 1997 11:15:52 GMT
From: lvirden@cas.org
Subject: Re: Check if a URL exists
Message-Id: <5ue858$49n$1@cas.org>



You could use webget to do the URL verification - here's a little perl script
that reads a file full of URLs, fetches their title tag and uses it.

Frankly, I would love to find a way to speed things up - so if someone
knows of better ways to do this, I would love to know.

#!/usr/perl5/bin/perl -w
#Script reads a file containing URLs one per line and generates an HTML
#page where the links are titled after their title script.  WARNING! 
#a significant number of pages have weird or no titles.
#Authors: Larry W. Virden and Chris Unger
#Copyright 1997

$| = 1;

print "<html>\n";
print "<title>My URLs</title>\n";
print "<body><ul>\n";

while (<>) {
   chop;
   $url = `webget -timeout 120 -q -nf -nr $_`;
	$url =~ s/\r\n|\r|\n/ /g;
	@title = split(/<[ 	]*title[^>]*>|<\/[ 	]*title[ 	]*>/i,$url);
	# $title[1] = $_ if ( $title[1] =~ /^$/ );
	$title[1] = $_ unless ( defined $title[1] && $title[1] );
	$title[1] =~ s/^\s+|\s+$//g;
   print "<LI><A HREF=\"" . $_ . "\">" . $title[1] . "</A>\n" if ( $title[1] =~ /[^\s]+/ );
}

print "</ul></body>\n";
print "</html>\n";

#	In theory, a HTML page should consist of:
#	...misc text...<title>a title sequence</title>...other text...
#	This means that if we split on title and /title, the 2nd entry
#	in the array should contain the title info.  Unfortunately, poorly
#	written html won't have all that we need.

	# $url =~ s#.*(<title>\s*([^<]*)\s*</title>)+?.*#$2#i;
	#$url =~ s/(.*)\s+/$1/;
   #print "<LI><A HREF=\"" . $_ . "\">" . $url . "</A>\n" if ( $url =~ /[^\s]+/ );
#  $url = `/projects/xopsrc/Tclsrc/v7/bin/timed-run 120 url_get $_`;
-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Mon, 1 Sep 1997 12:33:58 +0100
From: "Paul Denman" <pdenman@ims.ltd.uk>
Subject: Creation Date of a File
Message-Id: <b89eu5.q4r.ln@gate.imsport.co.uk>

 I have worked with the '-M' operator to find the last modification time
(and work out the age)
of a file - no problem. I was under the impression that you could also find
out the original
creation date of a file, or am I mistaken?

I am using Perl v5.001 on a Unix box running Irix v4

Regards,

Paul Denman





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

Date: 1 Sep 1997 10:34:51 GMT
From: koos_pol@nl.compuware.com.NO_JUNK_MAIL (Koos Pol)
Subject: Difficulties with \'s  in recursive directory tree scripts
Message-Id: <5ue5ob$fca@news.nl.compuware.com>

I have this recursive script which runs several dir/file functions in a
given directory tree

Have you noticed that in the root you have \ as the directory, but as
soon as you traverse down a level, the last \ disappears.  You get
\subdir i.s.o. \subdir\

How do you handle this, without checking in _every_ function if you are in
the root or not?

-----------------------------------------------------------------------
Koos Pol                                                  P.O Box 12933
PC Systems Admin                                    1100 AX   Amsterdam
Compuware Europe                                   tel:  +31 20 3116122
                                       email: Koos_Pol@nl.compuware.com
-----------------------------------------------------------------------



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

Date: Mon, 01 Sep 1997 14:14:18 +0200
From: denis@mathi.uni-heidelberg.de
Subject: Re: filehandle - select problem
Message-Id: <340AB19A.2781@mathi.uni-heidelberg.de>

denis@mathi.uni-heidelberg.de wrote:
> 
> hi,
> 

> 
> Undefined format "main::ERROR" called at /home/denis/scripts/prog.pl
> line 164, <FILE> line 1

sorry for the posting - i solved the problem... i simply missspelled 
a formatname befor this line...

	denis


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

Date: Fri, 29 Aug 1997 16:38:52 +1100
From: Ron Savage <rpsavage@ozemail.com.au>
Subject: Re: Here Document with FILEHANDLE
Message-Id: <3406606C.3422@ozemail.com.au>

Jerry Xia wrote:
> 
> Howdy,
> 
> Is there any way that I can open a file with using here document? What I am
> trying to do is something like:
> 
> open (FTP, "ftp -n $hostname <<EOF
>                 user xxx
>                 ls -l
>                 ...
>                 bye
>                 EOF
>                 "|);
> 
> But it is not working. I tried to put "|" after first EOF. It didn't work
> either. I can get over this by using a file which contains ftp commands:
> 
> open (FTP, "ftp -n $hostname < $filename |");
> 
> Since I can use here document in Shell script, I am wondering that there
> may be a way to do this in Perl.
> 
> If someone has the answer, please post it or mail to me.
> 
> Thanks a lot.
> 
> Jerry

Hmmm. Isn't the closing EOF meant to be in column 1?

-- 
PO`!1a


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

Date: Mon, 01 Sep 1997 10:16:21 +0200
From: Ake Johansson <ets96aja@student.hk-r.se>
Subject: Include external subroutines
Message-Id: <340A79D5.102A@student.hk-r.se>

Hello, I have a simple question I would appreciate if someone could help
me with.

I have made several Perl programs that are very similar to each other,
my question is if it's possibly to put a subroutine in an external file
and use something like "include" to call it from several other Perl
programs? 

I would not like to make a module, since I'm not very familar with OO
programing, I just want to put a subroutine in an external file...

Friendly Regards, 
Ake Johansson, SWEDEN.


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

Date: Sun, 31 Aug 1997 23:21:30 +0100
From: charlie@nospam.antipope.mapson.org (Charlie Stross)
Subject: Re: Is there a perl IDE?
Message-Id: <slrn60jrja.ld.charlie@SPAMBLOCKED>


Bryan Miller<millerb@fc.hp.com> wrote 
(in article <5u43qg$74k@fcnews.fc.hp.com>):
>Charlie Stross (charlie@nospam.antipope.mapson.org) wrote:
>
>: Apropos which: anyone know how to turn indenting off in cperl-mode? I
>: HATE HATE HATE having some idiot editor decide how to indent my code
>: for me!
>
>If you are using the one true perl mode, cperl-mode, you can
>not only toggle it on or off but you can also select various
>styles of indentation - all from the menu.  Also you can edit
>the cperl-mode.el file and get even more flexibility.

Ahem: in cperl-mode 1.31+ (dated 09/12/96) under 'indent styles'
there is no option for 'no indentation'; under 'toggle' there is
no option for switching indentation on/off.

And I know virtually zip about lisp.

Anyone got any suggestion for how to switch indentation off in lisp?

(For the person who said "use vi", I have this to say: viper-mode is
my friend.)



-- Charlie

"Many computer scientists have fallen into the trap of trying to define
languages like George Orwell's Newspeak, in which it is impossible to
think bad thoughts. What they end up doing is killing the creativity
of programming." -- Larry Wall

>> To reply: remove NOSPAM and anagrams, or see http://www.antipope.org/ <<


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

Date: Mon, 01 Sep 1997 04:43:43 GMT
From: m.king@praxa.com.garbage.au (Mike King)
Subject: Re: Matt Wright's Counter on Windows NT
Message-Id: <340a475d.947461237@news.ozemail.com.au>

On 1 Sep 1997 02:47:43 GMT, tdauria@bu.edu (Thomas Dauria) wrote:

>Has anyone got this counter to work on Windows NT.  I set
>it up and the perl script increments the counter.txt file
>no problem.  I never get the count on my web page however.
>I think the problem is with fly.exe but I am unsure.  
>Any suggestions or pointers to sites with help?

The smartest way to implement counters on WinNT is to use the
registry. You can create as many counters as you like, you simply open
the key, increment it and close it. I found it best to declare the key
as a string, because perl doesn't mind. The OS looks after locking,
and you don't have to worry about a user inadvertently removing the
file, or fiddling with it.

Mike
===== Spam Filter:
===== You can email me at the following address after putting out the trash ...
garbage.m.king@praxa.com.garbage.au


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

Date: Mon, 01 Sep 1997 02:43:50 -0700
From: rocker <guitarplayer@hotmail.com>
Subject: mod_perl Help.... Invalid command PerlHandler ...Invalid command PerlModule
Message-Id: <340A8E56.6FDC@hotmail.com>

Please o' plaueezz someone help me before I go insane and crouch in a
corner by myself and eat peanut butter sandwiches non stop for three
weeks with no sleep, while wearing my socks on my hands! *scary, I
know*.. 

I've successfully installed mod_perl-1.00 on Apache 1.1.3, (like this
matters, but Red Hat 4.2, and kernel 2.0.30).. Now that you know my
inner most pervered secrets, here's my lame problem.

I've installed all the modules needed btw.

Evertime I try and add the Alias path, etc. to my srm.conf or
httpd.conf, (is this wrong), I get errors when attempting to restart web
service. (and it would obviously give me the same error if I were to try
and run anything.. hande no web service).


I get errors with the PerlHandler, as well as the PerlModule.. why?.. 

Starting httpd: httpd Syntax error on line 144 of
/etc/httpd/conf/srm.conf:
Invalid command PerlModule

/etc/rc.d/rc3.d/S85httpd start
Starting httpd: httpd Syntax error on line 151 of
/etc/httpd/conf/srm.conf:
Invalid command PerlHandler

Keep in mind, I've read all the docs and FAQ's, install info, etc. that
I know exsists!.. I've look frantically all over the Net, dejanews,. any
news archive, mod_perl's archive, doug's pages.. everwhere..  still no
info on this that I can see!

I've added the basics like so..

Alias /perl/  /home/somewhere/here/

<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry   
Options ExecCGI
</Location>

I went further and added.. 

AddHandler perl-script .pl
PerlModule Apache::Registry


I added more....
Alias /perl/  /home/somewhere/here/

<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry   
PerlSendHeader On
PerlSetupEnv On
Options ExecCGI
</Location>


I finally decided to see what it'd do if I took out a few things.. just
to see if it made a difference.. 

Alias /perl/  /home/somewhere/here/

<Location /perl>
SetHandler perl-script
Options ExecCGI
</Location>

** of course I didn't get any errors, because there was basically
nothing there!
and in the mysite.com/perl/myscript.pl wants to just download... as does
save the script.. not even a 500 error message.. 

I can't do this--->

<Location /perl-status>
SetHandler  perl-script
PerlHandler Apache::Status     
</Location>

because the PerlHandler just says HUH!?..  

Please.. I've been trying on and off for a month now.. I've looked
everywhere.. My server tech is going nuts trying to figure it out and
finally said screw it.. use fastcgi. Well, I'm running a very hugh
traffic web chat, and I understand mod_perl would be better for this.. I
can't see much of a difference between the two really. Is mod_perl just
hard to get going?.. I mean, everything installed great, and I know what
I'm doing for the most part.. but I only know perl 4-ish, and I'm
guessing it not recognizing the Perlhandler and PerlModule is an easy
fix.. I hope so, because I'd love to get this going!.. Please help..
I'll put your 36th born through college.. :-)
What am I missing here? I can't find ANY info on this problem. I've doen
everythign it says, and it's not happening.. *sobbing*.. (but a "manly"
sob mind you!).. 

		Rob...


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

Date: 1 Sep 1997 11:21:52 GMT
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: Re: Multithreading in Perl?
Message-Id: <5ue8gg$ptq$1@news.ox.ac.uk>

In article <5tr4bp$h3n@newsops.execpc.com>, Oddfellow <zen@execpc.com> wrote:
>I say multithreading because the two contexts of execution will have
>access to the same memory area.  I've read the perlguts, etc man pages
>and have gotten the idea that multithreading using Perl has been
>considered.  What considerations do I need to make when doing
>multithreading in perl?  Since I got the idea that perl's stack is
>global, and xsubs, etc make a local copy of it, how does the
>resynchronization proceed and will it handle several threads using it
>at once?  Ie: how much of perl is threadsafe?
>
>FYI: I'm trying to write an xsub to a library with callbacks, and that
>library will call perl asynchronously (via the xsub, of course), and
>possibly in several threads of execution.

There are two separate issues for perl multithreading. The first is
the ability of a perl program to create and use multiple threads.
Version 5.005 will have that capability on supported platforms
(currently that means those with POSIX threads: the timing for
platforms with other threading APIs is not yet known). The second
issue is the ability to have completely separate perl interpreters
running concurrently in separate threads. As a side effect of the
Win32 integration into core perl, that should also be possible in
version 5.005, provided things work out the way we hope.

--Malcolm

-- 
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"I permitted that as a demonstration of futility" --Grey Roger


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

Date: 01 Sep 1997 12:37:21 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: Perl & Shadow Passwords authentitacion.
Message-Id: <nqo7md1wc9q.fsf@mitra.phys.uit.no>


> On 30 Aug 1997, Michael W Peterson wrote:
> > I've yet to have script running on Solaris
> > 2.5.1 return shadow passwords unless it's running privileged.

Tom Phoenix <rootbeer@teleport.com> writes:
> That's a relief. :-)

> It may be that this feature confused someone into thinking that their
> system was giving out crypted passwords. But until we see some code and
> output, it's just a guess. Cheers!

I'm not going to post the usernames or entire passwords returned, but...

On Solaris 2.5 running NIS+:

palver ~/ > uname -a
SunOS palver 5.5 Generic_103093-02 sun4u sparc SUNW,Ultra-1
palver ~/ > perl -le 'while(($n,$p)=getpwent){print "$n:$p"}'
root:x
daemon:x
bin:x
sys:x
adm:x
lp:x
smtp:x
uucp:x
nuucp:x
listen:x
nobody:x
noaccess:x
XXXXd:eyFF....
XXXXs:micR....
XXXXll:0prB....
XXXX:0gF/....

etc...


And on another machine with YP/NIS (I'm not really sure, actually)

mitra ~/ > uname -a
OSF1 mitra.phys.uit.no V4.0 564 alpha
mitra ~/ > perl -le 'while(($n,$p)=getpwent){print "$n:$p"}'
root:XXXXXXXX		# Whoops! Won't post *that*
nobody:*Nologin
nobodyV:*Nologin
daemon:*
bin:*
uucp:Nologin
uucpa:Nologin
auth:*
cron:*
lp:*
tcb:*
adm:*
ris:Nologin
wnn:Nologin
www:Nologin
XXXXarda:HoyS...
XXXXen:nologin
XXXXne:mmhd....

etc...


So unprivileged code gets the crypted passwords in these systems, and
in one of them it even gets the root password!  None of these have
crypted passwords in the /etc/passwd file.

> Tom Phoenix           http://www.teleport.com/~rootbeer/

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: Mon, 01 Sep 1997 11:01:32 +0200
From: Helmut Llamas Stuhne <llamashe@microtec.de>
To: Scott Henry <scotth@sgi.com>
Subject: Re: Perl script question for gurus
Message-Id: <340A846C.D6A042C8@microtec.de>

> A quick-n-dirty sketch, you may have to do a little debugging:
>
> #!/usr/bin/perl
>
> $dir = shift || ".";    # first argument is directory
> $start = shift || "0";  # second argument is starting number
>
> $fnbase = sprintf "%08d", $start;
> opendir(D, $dir) || die "can't open $dir? $!\n";
>
> @files = map { $_ if (-f $_ and $_ !~ /^0.*txt/)} readdir(D);
> closedir(D);
>
> foreach $file (@files) {
>         rename($file, $fnbase.".txt");
>         $fnbase++;
> }

Only open(D,$dir) you schould change in opendir(D,$dir).Now your script
is runnig, I have test it.

regards
    H.Stuhne



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

Date: Mon, 01 Sep 1997 14:41:38 +0200
From: "Tylman Ule" <ule@uni-muenster.de>
Subject: Re: Perl-Win32: diagnostics module doesn't work; missing perldiag.pod?
Message-Id: <340AB802.B673BF1E@uni-muenster.de>

Terry Carroll wrote:

> Any idea 1) where I could get it; 2) which directory it belongs in; and 3)
> why the install process didn't install it (e.g., is it likely I made an
> error on installation)?

1)
You can find perldiag.pod as
ftp://ftp.datadepo.com/perl5.004/lib/i386-bsdos/5.00401/pod/perldiag.pod

I found it there using ftpsearch (http://ftpsearch.ntnu.no/ftpsearch/)

2)
You should put it into <perlhome>\Pod\perldiag.pod
<perlhome> usually is c:\perl

3)
I'm not sure. My Unix port had it already installed in this directory,
my Win95 port did not.


Hope that helps,
Tylman



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

Date: Mon, 01 Sep 1997 00:33:09 -0400
From: Mike Turk <mturk@globalserve.net>
Subject: Re: perl/win95/Long File Names
Message-Id: <340A4585.F75E9DAB@globalserve.net>

Petri Backstrom wrote:

> Brian P. Moffatt wrote:
> >
> > I am using perl5 on my win95 machine and I need to "opendir" a LFN
> > directory.
> > Any suggestions.
> > /program files/netscape/navigator/program/...................etc.
> you
> > get the point.
> > how do I get in there??
>
> Well, maybe with something like this:
>
>     opendir( DIRHANDLE, 'c:/program files/netscape/navigator/program'
> )
> or
>         die "error opening directory: $!";
>
> regards,
>  ...petri.backstrom@icl.fi
>     ICL Data Oy
>     Finland

   You might want to try opendir( DIRHANDLE, 'c:\\program
files\\netscape\\navigator\\program')

^                      ^               ^                ^
instead.......remember those silly DOS boxes are backwards.

Mike Turk
mturk@globalserve.net



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

Date: Mon, 01 Sep 1997 05:03:02 -0600
From: rey@ilo.org
Subject: Perl5.004 on AIX 4.2 Installation problem
Message-Id: <873107327.9499@dejanews.com>

I installed Perl5.004 on AIX 3.2.5.1 without any problem, but I try to
install on AIX 4.2 using all default values, I received "Failed 22
test
scripts out of 152, 82.89% okay...." when executing make test.
Failing tests produce "Segmentation fault(coredump)".

Could you Help Me ?

Dominique REY
System Engineer
International Labour Office
rey@ilo.org

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 29 Aug 1997 15:51:19 +0100
From: ISC <andrewsmith@isc-uk.demon.co.uk>
Subject: Probably a dumb request, but...
Message-Id: <L4hnxDAnHuB0Ewj4@isc-uk.demon.co.uk>

can anyone point me at a script that will read all files with a particular
extension and force all occurences of a mixed-case string into lower
case?

I suspect this is extremely easy to do in perl, but I'm a total beginner
with hundreds of defective HTML files!

Cheers in advance,
Andrew M Smith (andrewsmith@isc-uk.demon.co.uk)
Editor, International Laboratory
Host, Chrom-L chromatography email discussion forum


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

Date: Mon, 1 Sep 1997 09:48:58 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Probably a dumb request, but...
Message-Id: <ebohlmanEFtpxM.Ipw@netcom.com>

ISC (andrewsmith@isc-uk.demon.co.uk) wrote:
: can anyone point me at a script that will read all files with a particular
: extension and force all occurences of a mixed-case string into lower
: case?

Are you talking about a specific mixed-case string?  If so, and your 
files are all in the same directory, then it's a one-liner:

perl -pi.bak -e 's/SomeString/somestring/' *.ext

If you need to recurse through subdirectories, then you should look into 
the File::Find module.  If you need to translate *all* mixed-case strings 
into lowercase, then you'll need to replace "SomeString" with a regular 
expression that matches mixed-case strings, and "somestring" with an 
appropriate substitution: look in perlre(1) to learn about this.  
Finally, if you're running on a DOS or Windows platform, you'll need to 
change the single quotes on the above command line to double quotes.




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

Date: Mon, 01 Sep 1997 12:10:13 GMT
From: of@lms.be (Orlando Frooninckx)
Subject: Provider removed <!--EXEC >
Message-Id: <340ab055.10301512@193.74.210.130>

Hi,

My ISP removed the <!--EXEC > command, is there a way to do the same
thing by using other commands? Maybe by using javascript?

Greetz,
Orlando


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

Date: 01 Sep 1997 13:27:43 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: Randal and Intel, Was: Scrambling using tr
Message-Id: <nqo67slw9xs.fsf@mitra.phys.uit.no>

Stuart Cooper <stuartc@ind.tansu.com.au> writes:

> If you want to change a lowercase string with the alphabetic-complement like
> Justin does; I suggest:
> 
> #! /usr/local/bin/perl -w
> $_="Intel Put Randal Inside";
> $ZTOA=join('',reverse(('A'..'Z')));
> eval "tr/a-z/$ZTOA/";
> print "$_\n";

Let's try that.  And let's add the same transformation again, which
should reverse the transformation:

% perl
$_="Intel Put Randal Inside";
$ZTOA=join('',reverse(('A'..'Z')));
eval "tr/a-z/$ZTOA/";
print "$_\n";
eval "tr/a-z/$ZTOA/";
print "$_\n";^D
IMGVO PFG RZMWZO IMHRWV
IMGVO PFG RZMWZO IMHRWV

Whoops.  Perhaps you meant

$ZTOA = join '', reverse('A'..'Z','a'..'z');

> Stuart Cooper.

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: 1 Sep 1997 09:21:51 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: struct in perl
Message-Id: <01bcb6b8$904af340$02521e0a@tschai>



Tom Fawcett <fawcett@nynexst.com.spam-me-not> wrote in article
<8jwwl21bfp.fsf@nynexst.com.spam-me-not>...
> bill <bill@dml0.wcupa.edu> writes:
> > okay, sorry if this is a stupid question, but how do i do a
struct in 
> > perl?  i don't want to use the pack/unpack stuff 'cause i don't
want to 
> > have to do that for each record i look at.  i just want to be
able to 
> > say...
> > array_of_recs[i].first_name = "bill";
> 
> A naive translation would be:
> $array_of_recs[$i]{'first_name'} = "bill";
> 
> There might be more intelligent ways of coding it, depending on
what you're 
> doing.  There is at least one struct package in the CPAN, also.
> 
> -Tom
> 

I sometimes use: 

(first_name, ...... , last_record) = split(/#/, $record);

with # a character which is not used in any of the records. I know,
it is almost the same as
using pack and unpack, but I use one record separator.


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

Date: Sun, 31 Aug 1997 22:20:56 -0700
From: Peter Prymmer <pvhp@forte.com>
To: jim.condit@fmr.com
Subject: Re: version of Perl5 for NT4
Message-Id: <340A50B8.13F2@forte.com>

Jim Condit wrote:
> 
> Tom McGee wrote:
> >
> > John Scriven wrote:
> > >
> > > Hi!
> > >
> > > I am looking for a vesion of Perl working under NT4.
> > > I haven't found anything on the homepage of Perl.
> > > Can you help with this please?
> > >
> > > by the way any explanations, tips or links about how to install
> > > Perl on NT4 for is welcome.
> > >
> > > Thanks
> > >
> > > Please reply at this e-mail address :
> > > michauts@adc.port.ac.uk
> > >
> > > --
> > Look at http://www.perl.hip.com/ for the Win32 versions.
> >
> > --Tom
> That URL is no longer valid, use:
> http://www.activeware.com/

You might also consider the latest file with /bindist/ in the name
at:

   http://www.perl.com/CPAN/authors/Gurusamy_Sarathy/

which has a large number of standard unix perl extensions already
compiled and ready to use (includes Tk, CGI, a couple of Date/Time
modules etc.)

Peter Prymmer


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

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

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