[7099] in Perl-Users-Digest
Perl-Users Digest, Issue: 725 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 12 04:37:10 1997
Date: Sat, 12 Jul 97 01:02:01 -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 Sat, 12 Jul 1997 Volume: 8 Number: 725
Today's topics:
Re: Pattern Matching (Tim Smith)
Perl 4 to Perl 5? (Marshall Pierce)
Re: Perl 5.003, NT, IIS, and GIFs <burleigh@hackberry.chem.niu.edu>
Re: Perl and Porter Stemming Algorithm <rpsavage@ozemail.com.au>
Perl install location <bbaars@casecorp.com>
PERL system call <aw4@sanger.ac.uk>
Perl Win32 on NT with IIS3.0 <jl-muir@cat.ncsa.uiuc.edu>
Re: Perl/Remote Sendmail (Nathan V. Patwardhan)
Re: Perl/Remote Sendmail (Ronald E. Fortin)
Re: receiving variable from web page with <cgiscript>?< (Tung-chiang Yang)
Re: REGEX <sfairey@adc.metrica.co.uk>
Regular experssions and delimiters. (Dr. Philip Carinhas)
Re: regular expressions <uma@heidelbg.ibm.com>
Re: reverse chop? <ajohnson@gpu.srv.ualberta.ca>
Re: RFC: Net::Finger <gbarr@ti.com>
Re: Running/building Perl 5 for msdos mlinvle@inlink.com
Sending mails from perl <andrejc@tyr.fe.uni-lj.si>
Re: Sending mails from perl (Greg Bacon)
Re: SSI on apache <cwood@ichat.com>
Re: Stripping text from a file (Bill Costa - UNH Computing & Information Srvs)
Re: substitution question <ajohnson@gpu.srv.ualberta.ca>
Re: tr.problem (Tung-chiang Yang)
Re: using array elements in regexps (Tad McClellan)
Re: What does "UNIX" stand for.. (Walter Tice USG)
Re: what's going on here?? (Tung-chiang Yang)
while (<FILEHANDLE>) <jcoursey@sed.nist.gov>
Re: Win32 & FTP <vcuya@inch.com>
writing documents (and .pl's) to an user directory <meert@esg.nl>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Jul 1997 12:42:27 -0700
From: trs@azstarnet.com (Tim Smith)
Subject: Re: Pattern Matching
Message-Id: <5q3dv3$jl7@web.azstarnet.com>
In article <33C518AA.76B3@ainet.com>,
Joseph M. Scott <jmscott@ainet.com> wrote:
>I've been asked to split up some data that is quoted and separated by
>commas, but so can have commas in the quotes.
Search the FAQ (http://www.perl.com/perl/faq/) for "comma-separated files"
and you'll get an excellent answer.
Tim
------------------------------
Date: 9 Jul 1997 16:45:24 GMT
From: piercem@col.hp.com (Marshall Pierce)
Subject: Perl 4 to Perl 5?
Message-Id: <5q0f74$8v0$1@nonews.col.hp.com>
Well, I'm finally forced to start work on converting my perl 4 scripts
to perl 5.003 - and guess what? My very first script has a problem
writing my _TOP format.
- why, if I open a file for write, and have filehandle_TOP and filehandle
formats defined, select $~=filehandle and write, does the _top not
get written in 5?
--
Marshall V Pierce /_ __ TIS - WWUSP Technology Team
marshall_pierce@hp.com / //_/
USA (719) 590-3461 / http://hpweb.cs.itc.hp.com/wwusp/piercem/
------------------------------
Date: Thu, 10 Jul 1997 09:33:07 -0500
From: Darin Burleigh <burleigh@hackberry.chem.niu.edu>
Subject: Re: Perl 5.003, NT, IIS, and GIFs
Message-Id: <33C4F2A3.1B96@hackberry.chem.niu.edu>
Erik Y. Adams wrote:
>
> Why doesn't this work?
>
what does 'not work' mean?
maybe you want to ask in the comp.infosystems.www.authoring.cgi
newsgroup.
> $|=1;
> open (TEMP, "<myimage.gif");
> binmode TEMP;
> print "HTTP/1.0 200 OK\n";
> print "Content-type: image/gif\n\n";
> binmode STDOUT;
> print <TEMP>;
> close TEMP;
>
> It used to work. The only thing I'm aware of that's changed is an
> over-zealous fellow employee recently installed the NT 4.0 Service Pack 3.
> I'd like to think that it didn't muck anything up, but I'm open to
> suggestions.
>
> Erik
--
==========================================================
- darin
burleigh@hackberry.chem.niu.edu
\\//\\//.\\//\\//.\\//\\//. http://hackberry.chem.niu.edu/HOME/dcb/
'2 kinds of green, look out!' - dieter rot
------------------------------
Date: Fri, 11 Jul 1997 09:53:05 +1100
From: Ron Savage <rpsavage@ozemail.com.au>
To: akil1@mindspring.com
Subject: Re: Perl and Porter Stemming Algorithm
Message-Id: <33C567D1.4D5@ozemail.com.au>
Kevin Bass wrote:
>
> Is there a perl version of the Porter Stemming Algorithm? If so, where
> can I find it.
>
> Kevin Bass
Kevin,
I found a copy, presumably on CPAN, called Stem-0_1.tar.gz.
--
PO`!1a
------------------------------
Date: Thu, 10 Jul 1997 15:34:22 -0500
From: Bryan Baars <bbaars@casecorp.com>
Subject: Perl install location
Message-Id: <33C5474E.5212@casecorp.comxxxxxxx>
I am currently having a debate on where the perl distribution should be
installed on a Unix platform. There are over 40 Unix servers that I
support. I realize the "de facto" standard would be to install it
locally in /usr/bin, however, maintenance and configuration problems
prevent me from doing this (40 servers could take awhile). Another
suggestion was to install it locally in /usr/local, but once again, this
could be a maintenance nightmare. The last suggestion is to install it
on an NFS server and automount the directory to all the servers.
I would like to take a survey to find out where other people have
installed it and is it local or NFS mounted. Any comments about why you
did it your way would be appreciated.
Thanks,
Bryan
PS: remove the x's in my return address to send me email.
------------------------------
Date: Thu, 10 Jul 1997 17:52:42 +0100
From: Andrew Williams <aw4@sanger.ac.uk>
Subject: PERL system call
Message-Id: <Pine.OSF.3.95.970710175206.9607D-100000@waiy>
Please could some one help me!
I am trying to use system to call an external program. This works fine
but I don't really want to see the output on the screen or pipe it to a
file as there is a lot of output (approx 1Mb). Therefore I would like to
send it to null but don't seem to be able to.
Please email me if you have any ideas.
Thanks
Andy
aw4@sanger.ac.uk
------------------------------
Date: Thu, 10 Jul 1997 17:05:01 -0500
From: "J. Lewis Muir" <jl-muir@cat.ncsa.uiuc.edu>
Subject: Perl Win32 on NT with IIS3.0
Message-Id: <33C55C8D.71AD@cat.ncsa.uiuc.edu>
Hi.
I have a problem with the @INC array on NT Server 4.0 with IIS3.0. I
want to require a file that is in the same directory as the PERL script
being run. The problem is that the current directory that the PERL
script being run in does not get added to the @INC array when it gets
run.
I think this might have to do with how IIS3.0 handles perl and cgi. I
have IIS3.0 configured to use perl.exe for *.cgi files. And what path
is in the @INC array is the path to the perl libraries. When I push the
local path onto the @INC array, my script works fine, but that is not
the solutions I want.
An example follows:
I have a perl script at the following location:
C:\users\bob\public_html\test.cgi
And I have another file with perl functions I want to include, located
at:
C:\users\bob\public_html\functions.pl
IIS3.0 has a virtual directory set up so that I can access my test.cgi
file through the URL:
http://www.blah.com/bob/test.cgi
In my test.cgi file I have the following line at the top:
require "functions.pl";
And when I try to access the test.cgi script through the web, I get an
error something like, "could not find functions.pl file in @INC".
So, I hard code the correct path into the @INC array before the require
statement so I now have two lines toward the top of my test.cgi file
that look like:
push(@INC, "C:\\users\\bob\\public_html");
require "functions.pl";
And things work.
I tried the following:
push(@INC, ".");
and it did not work.
Thanks for any help.
J. Lewis Muir
jl-muir@uiuc.edu
------------------------------
Date: 10 Jul 1997 16:46:34 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl/Remote Sendmail
Message-Id: <5q33la$dcb@fridge-nf0.shore.net>
Blake Kritzberg (kritzber@ucsub.Colorado.EDU) wrote:
: How can I tell perl that sendmail's on a separate machine?
Yes. Well, yes by the fact that you can talk to port 25 of the remote
server and conduct an SMTP session that way. You should probably read
up about sockets in the Perl documentation; you should also be using
NTPerl 5.003 PL303 or newer.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Thu, 10 Jul 1997 20:58:24 GMT
From: ref@mesasys.com (Ronald E. Fortin)
Subject: Re: Perl/Remote Sendmail
Message-Id: <5q3iio$4od$2@hal.brainiac.com>
In article <5q2qb5$1l6@lace.colorado.edu>, kritzber@ucsub.Colorado.EDU (Blake Kritzberg) wrote:
>
>Hi, all -- this is a weird question, but Perl seems to be
>the common thread.
>
>I've written a tiny script that uses sendmail. I need
>to port it to NT (retch, gag), but I don't need to use BLAT
>(I don't think) because a UNIX box running sendmail
>is on the local network. I have the IP address for the sendmali
>box.
>
>How can I tell perl that sendmail's on a separate machine?
>
>Thanks so much,
>Blake
>
>
checkout http://www.geocities.com/SiliconValley/Park/8312/
There are several perl scripts for sending mail. The one you may want uses
SMTP protocol over the net. Works great for me.
---
Ronald E. Fortin
Senior Engineer
ref@mesasys.com
Mesa Systems Guild, Inc.
60 Quaker Lane
Warwick, RI 02886
401-828-8500
www.mesasys.com
------------------------------
Date: Sat, 12 Jul 1997 06:11:04 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: receiving variable from web page with <cgiscript>?<var>=x
Message-Id: <tcyangED6zuG.M3w@netcom.com>
Check out the thread '$ENV{'QUERY_STRING"} problem' in CLPM. Hope
this helps!!!!
=================================
Frank Liney wrote after zapping the scum of the universe:
: It's a very simple question, but I'm floundering and despite numerous
: faq's I'm not getting anywhere even though I seem to be far beyond this
: stage in other perl work.
: If I call a perl cgi script with, for example:
: <img src="/cgi-bin/Count.pl?df=wibble.dat">
: How do I then read the content of df into a variable in Count.pl?
: ie what line would I put into the script to put wibble.dat into say
: file$
: I know it's basic, but I seem to be going round in circles on this one,
: if someone would help me out I'd be more than gratefull.
--
====== Try the low-crossposting robomoderated 'alt.culture.taiwan' ======
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: Thu, 10 Jul 1997 12:22:53 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: Tom Creedon <tomcat77@erols.com>
Subject: Re: REGEX
Message-Id: <33C4C60C.CACBE31@adc.metrica.co.uk>
Tom Creedon wrote:
> I have been trying to convert a URL to REGEX. Specifically I want the
>
> "." character to be escaped, eg. "\.", but I have some URLs with ".*"
> in
> the path for wild cards and I don't want to escape them. Everything I
>
> have tried has not worked. I am new to REGEX and would appreciate some
>
> help.
>
> Example http://www.wiget.co.jp/.*
>
> I want to convert it to http://www\.wiget\.co\.jp/.*
>
> Thanks in advance,
>
> Tom
>
> --
> Thomas Creedon
> G056
> MS W431
> The MITRE Corporation
> 1820 Dolly Madison Blvd.
> McLean, VA (USA)
> 22102-7492
>
> Ph: (703) 883--3353
> Fax: (703) 883-7978
> tcreedon@mitre.org
Try the following
$string = "http://www.widget.co.jp/.*";
$string =~ s/(\.[^*])/\\$1/g;
print "\n$string\n";
This is looking for any '.' that is not followed by a '*'.
Simon
------------------------------
Date: 10 Jul 1997 15:36:38 -0700
From: carinhas@gde.GDEsystems.COM (Dr. Philip Carinhas)
Subject: Regular experssions and delimiters.
Message-Id: <5q3o5m$hd0$1@gde.GDEsystems.COM>
I just ran across a strange problem where my regular expression
would always match false if I would pass the delimters in via a string:
$reg_exp = "/$some_other_exp/" ;
if ($string =~ $reg_exp) .. # Wrong ?
if ($string =~ /$some_other_string/) .. # Right ?
Anyway It gave me big greif.. I tried al sorts of metaquote and
alternate combinations.. Now it works ok... Of course it could be that I am
using
&GetOptions(
"from=s" => \$from,
"to=s" => \$to,
"db=s" => \$db,
"password=s" => \$passwd,
"loginame=s" => \$loginame,
"reg_exp=s" => \$reg_exp,
"maxsize=i" => \$maxsize,
"passive!" => \$passive,
"verbose!" => \$verbose,
"simulation!" => \$simulation,
"donttrymdtm" => \$nomdtm,
"dashe!" => \$dashe,
"deleteold!" => \$deleteold,
"recurse!" => \$recurse);
to pass in the parameters... Go figure... Please comment if you
are SuPerLative..
-Phil
--
| P. A. Carinhas |
| GDE Systems, Inc., | Tel: (619) 592-5099 |
| 16250 Technology Dr, MZ 6500-E | Fax: (619) 592-1680 |
| San Diego, CA 92127-1008 | http://gdesystems.com |
------------------------------
Date: Wed, 09 Jul 1997 13:50:41 +0200
From: Uma Shanker <uma@heidelbg.ibm.com>
Subject: Re: regular expressions
Message-Id: <33C37B11.446B@heidelbg.ibm.com>
Tri Tram wrote:
>
> Can somebody please help me with the regular expressions? I have the
> following:
> text #(text)
> text #(more test)
> test #(text and more text)
>
> I want to change it to:
> text add_text(text)
> text add_text(more_text)
> test add_text(text_and_more_text)
>
there are always more than on eway to do it in larry's PERL.
so read the text in array like you are reading it in /etc/passwd case in
next posting lets say @lines..
or otherwise search for # then you have $' and $` (read in man pages)
then like
print $' and here you new text $`
keep on trying. well that tutorial is great
--
uma shanker
uma@heidelbg.ibm.com
bad mail go to /dev/null <<
------------------------------
Date: Thu, 10 Jul 1997 21:23:46 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: reverse chop?
Message-Id: <33C59932.3B7DE497@gpu.srv.ualberta.ca>
M.J.T. Guy wrote:
>
> In article <5q19t0$97o$3@info.uah.edu>, Greg Bacon <gbacon@CS.UAH.Edu> wrote:
> >
> >In article <33C27DF2.578@mathematica-mpr.com>,
> > the count <eglamkowski@mathematica-mpr.com> writes:
> >: Is there any trivial way to remove the first character of a string?
> >
> >$str =~ s/^.//s;
>
> It's almost certainly more efficient to write
>
> substr($str,0,1) = '';
>
> Regular expressions aren't the solution to _all_ the problems of the universe.
>
actually, it appears that assignment to subtr() is not all that
efficient ---however, $str=substr($str,1) is certainly quicker
according to benchmarking:
use Benchmark;
$count=1000000;
timethese($count,{
substr1=>'$var="this is a string";$var=substr($var,1);',
substr2=>'$var="this is a string";substr($var,0,1)=""',
regex =>'$var="this is a string";$var=~s/^.//;'
});
gives:
Benchmark: timing 1000000 iterations of regex, substr1, substr2...
regex: 16 secs (16.38 usr 0.00 sys = 16.38 cpu)
substr1: 9 secs ( 8.80 usr 0.00 sys = 8.80 cpu)
substr2: 17 secs (17.25 usr 0.00 sys = 17.25 cpu)
I'm guessing that assignment to substr() has some extra
string copying overhead that isn't optimized out when
assigning a null string?
regards
andrew
------------------------------
Date: Thu, 10 Jul 1997 16:51:45 -0500
From: Graham Barr <gbarr@ti.com>
To: Dennis Moore <*arch0n@tamu.edu>
Subject: Re: RFC: Net::Finger
Message-Id: <33C55971.61440632@ti.com>
Dennis Moore wrote:
>
> several people noticed that the lack of a Net::Finger module, so i wrote
> one. i'm not going to post the code here because i don't think it's ready
> for release yet. this is my first attempt at oop, writing a module, and
> using sockets in perl, so i'm sure i didn't do some things the Right Way.
> nevertheless, it appears to work. if you're familiar with the
> aforementioned subjects (or even if you just want to test it out), i would
> appreciate it if you'd take a look and give me your opinions/comments.
> when i'm satisfied it's ready, it will be submitted to CPAN.
>
Ah good, I kept meaning to do this myself, I think I have a note
in the libnet readme file for it, but it was so simple I
just never got around to actually writing the code.
> @response = Net::FTP->new ('Username' => 'foobar',
> 'Host' => 'some.domain.com',
> 'Port' => '79');
As you are not really creating an object, snf the connection does not
stay open. I would suggest that Net::Finger just export a sub
called 'finger'. Also if called in a scalar context return
a reference to an array instead of the array. This can save
needles copy-ing of data.
ie the user would
use Net::Finger;
@response = finger('Username' => 'foobar',
'Host' => 'some.domain.com',
'Port' => '79');
or
$response = finger('Username' => 'foobar',
'Host' => 'some.domain.com',
'Port' => '79');
--
Graham Barr <gbarr@ti.com>
It doesn't matter what you do, it only matters what you say you've done
and what you're going to do.
-- Dilbert's Laws
------------------------------
Date: Thu, 10 Jul 1997 11:07:46 GMT
From: mlinvle@inlink.com
Subject: Re: Running/building Perl 5 for msdos
Message-Id: <33c4c190.1176054@news.inlink.com>
On Thu, 26 Jun 1997 14:30:37 +0100, Robert Rainthorpe
<R.J.Rainthorpe@gre.ac.uk> wrote:
>Put a backslash (\) in front of the @ signs (\@). Perl 5 treats @s a
>little differently to Perl 4.
>
>Rob.
I haven't found this to work. Unless I've done something *else*
wrong!! :-)
This is the file (hello5.bat):
\@REM=(qq!
\@bigperl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
\@goto end !) if 0 ;
'print "Hello, world\n"';
\@REM=(qq!
:end !) if 0 ;
This is what I get:
[WINDOWS] C:\PERL-->hello5.bat
[WINDOWS] C:\PERL-->\@REM=(qq!
Bad command or file name
[WINDOWS] C:\PERL-->\@bigperl hello5.bat.bat
Bad command or file name
[WINDOWS] C:\PERL-->\@goto end !) if 0 ;
Bad command or file name
[WINDOWS] C:\PERL-->'print "Hello, world\n"';
Bad command or file name
[WINDOWS] C:\PERL-->\@REM=(qq!
Bad command or file name
[WINDOWS] C:\PERL-->
[WINDOWS] C:\PERL-->
Also, I've got access to the 'blue' Camel book. Anything I should
look at in there??
Thanks!
mark <mlinvle@inlink.com>
------------------------------
Date: Thu, 10 Jul 1997 13:03:14 -0700
From: Andrej Cedilnik <andrejc@tyr.fe.uni-lj.si>
Subject: Sending mails from perl
Message-Id: <33C54002.66A3@tyr.fe.uni-lj.si>
Hello!
I'm writing cgi, that has to send lot's of mails. It is written in perl.
It does something like:
foreach (@maili) {
sendmail($email,$reply,$subject,$body);
}
How could I make this script?
Andy
Please send answers to andrejc@tyr.fe.uni-lj.si
------------------------------
Date: 11 Jul 1997 00:20:02 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
To: andrejc@tyr.fe.uni-lj.si
Subject: Re: Sending mails from perl
Message-Id: <5q3u7i$fhi$3@info.uah.edu>
[Posted and mailed]
In article <33C54002.66A3@tyr.fe.uni-lj.si>,
Andrej Cedilnik <andrejc@tyr.fe.uni-lj.si> writes:
: I'm writing cgi,
A CGI what?
: that has to send lot's of mails.
"send lots of email" seems to ring better in my native ears.
: It is written in perl.
Excellent choice. :-)
: It does something like:
:
: foreach (@maili) {
: sendmail($email,$reply,$subject,$body);
: }
:
: How could I make this script?
sub sendmail {
my $address = shift;
my $reply_to = shift;
my $subject = shift;
my $body = shift;
unless (open MAIL, "| /usr/lib/sendmail -t") {
warn "$0: failed fork: $!\n";
return undef;
}
print MAIL <<EOMessage;
To: $address
Reply-To: $reply_to
Subject: $subject
X-Comment: I deserve a slow, tortuous death if I'm spamming you.
$body
.
EOMessage;
close MAIL or warn "$0: sendmail exited " . ($? >> 8) . "\n";
1;
}
# assuming format like:
# $maili[$idx] = {
# address => recipient address,
# reply => Reply-To: header,
# subject => message subject,
# body => message body,
# }
for (@maili) {
sendmail @{$_}{'address', 'reply', 'subject', 'body'};
}
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Thu, 10 Jul 1997 10:14:42 -0500
From: Charlie Wood <cwood@ichat.com>
Subject: Re: SSI on apache
Message-Id: <33C4FC62.AA8F4A29@ichat.com>
This is a cryptographically signed message in MIME format.
--------------msD7E42A97407DAA47AD898B4B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
cREATURE dEM0N wrote:
> I want to use SSI on my site, for a banner rotator. But how do i
> configure apache to use SSI. My provider uses apache as webserver. But
>
> he does'nt know how to do it.
>
> Someone told me to put as .htacces file in my directory. This is how
> my .htaccess file looks :
>
> Options Indexes FollowSymLinks Includes ExecCGI
> Options includes
> AddType text/x-server-parsed-html .shtml
>
> ErrorDocument 401 /cgi-bin/guardian.cgi?401
> ErrorDocument 403 /cgi-bin/guardian.cgi?403
> ErrorDocument 404 /cgi-bin/guardian.cgi?404
> ErrorDocument 500 /cgi-bin/guardian.cgi?500
>
> I have chmodded 644 the file. But it dont want to do it, he even don't
>
> load the guardian script. Does someone know how to do this ?
You need to set the execute bit in the permissions. chmod 755 should do
the trick.
-c
--
Charlie Wood
cwood@ichat.com
--------------msD7E42A97407DAA47AD898B4B
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature
MIIQjwYJKoZIhvcNAQcCoIIQgDCCEHwCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCC
Dv0wggpDMIIJrKADAgECAhB/tzgyvOZdOINKI37feZVtMA0GCSqGSIb3DQEBBAUAMGIxETAP
BgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVy
aVNpZ24gQ2xhc3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2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QkPMREwDzANBggqhkiG9w0D
AgIBKDANBgkqhkiG9w0BAQEFAARASabN7pF7+w4AhcIo42BfnfSUhDHiSwHmR4cBQ5C5Irnl
0+ZawimLVapq9qSBCXtUDlQI6kU4eYcy3bODV5qLYA==
--------------msD7E42A97407DAA47AD898B4B--
------------------------------
Date: 10 Jul 1997 10:08 EST
From: w_costa@unhb.unh.edu (Bill Costa - UNH Computing & Information Srvs)
Subject: Re: Stripping text from a file
Message-Id: <10JUL199710081340@unhb.unh.edu>
In article <33C4CBD1.1EAEA118@nation-net.com>, Steve Burton
<steveb@nation-net.com> writes...
> What i am trying to achieve it for perl to search a text file and find
> "abc" and strip the line that is on and the next line and generate a
> file with what is left.
Try this.
Later....BC
- - - - - - - - - cut here - - - - - - - - - 8< - - - - - - - - - - - - - -
#!/bin/perl -w
use strict;
# Find and remove lines containing a target string along with
# a set number of following line(s).
my $targetStr = "abc"; # What we want to match and save.
my $inLine; # Next line of text read from input.
my $nxtLns; # Count of lines following match.
my $grabNxtLns = 1; # How many additional lines to remove
# after a hit.
open(INFILE, "<example.in") or die "$0: unable to open input\n$!\n";
open(OUTFILE, ">example.out") or die "$0: cannot open output\n$!\n";
open(JUNKTXT, ">example.junk") or die "$0: cannot open log\n$!\n";
while ($inLine = <INFILE>)
{
if ($inLine !~ $targetStr)
{
print(OUTFILE $inLine);
}
else
{
print(JUNKTXT $inLine);
for ($nxtLns = 1; $nxtLns <= $grabNxtLns; $nxtLns++)
{
if ($inLine = <INFILE>)
{
print(JUNKTXT $inLine);
}
else
{
warn "$0: no line $nxtLns after initial matched line\n";
last;
}
}
}
}
close(INFILE) or warn "$0: error closing input\n$!\n";
close(JUNKTXT) or warn "$0: error closing log file\n$!\n";
close(OUTFILE) or die "$0: error closing output\n$\n";
# EOF example.pl
------------------------------
Date: Thu, 10 Jul 1997 02:04:57 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: substitution question
Message-Id: <33C48999.38FB53EC@gpu.srv.ualberta.ca>
Mona Wong wrote:
!
! Hi Perl programmers:
!
! I'm a new Perl programmer and I have a simple question ...
!
! How do I substitute a string's content?
!
! I've tried:
!
! $new_string = s/:/%3A/g $old_string;
!
! and that didn't work. What am I missing?
!
you are missing the binding operator =~ and a little
re-ordering of the statement...try:
($new_string=$old_string)=~s/:/"%3A"/g;
regards
andrew
------------------------------
Date: Sat, 12 Jul 1997 06:11:11 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: tr.problem
Message-Id: <tcyangED6zun.M6C@netcom.com>
Have you purchased a copy of the Camel book and failed to find the
documentations?
It is more useful to learn by a book than posting questions here,
where your questions will be distributed to all news servers all over
the world.
We will be glad to refer to the page number on the Camel book for your
questions, but you need to buy a copy first.
========================================
Fan Ng wrote after zapping the scum of the universe:
: Hi all:
: I had seem a example in book whick is
: tr[\200-\377]
: [\000-\177]; #delete 8th bit
: I don't know that delete 8th bit means and why in the [ ] need \ in front of
: number?? Thank you
: fanng@prdigy.net
--
====== Try the low-crossposting robomoderated 'alt.culture.taiwan' ======
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: Thu, 10 Jul 1997 06:28:37 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: using array elements in regexps
Message-Id: <51h2q5.cj.ln@localhost>
Shaun O'Shea (lmisosa@eei.ericsson.se) wrote:
: Can anyone tell me if you can use array elements as regexps and if so
: how do I phrase it.
>From the Perl FAQ:
"How do I efficiently match many regular expressions at once?"
Which answers exactly this question...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 10 Jul 1997 16:53:23 GMT
From: tice@hunch.zk3.dec.com (Walter Tice USG)
Subject: Re: What does "UNIX" stand for..
Message-Id: <5q3423$o0k@zk2nws.zko.dec.com>
In article <33A562FC.3126@cs.odu.edu> Eddie Brown <eddie@cs.odu.edu> writes:
>
>If operating systems were programming languages UNIX would be C
>and Win95 would be BASIC with line numbers. :)
Mildy disagree, UNIX would be perl5, and Win 3.1 would be BASIC, 95 would be BASIC2,
NT would be VB+.
W
------------------------------
Date: Sat, 12 Jul 1997 06:11:06 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: what's going on here??
Message-Id: <tcyangED6zuI.M4K@netcom.com>
You really need to buy a copy of the 2nd edition of the Camel book
so gurus can attempt to answer questions which are not covered by
the book.
==========================================
Fan Ng wrote after zapping the scum of the universe:
: Hi all:
: I saw this in a book and I realy don't what's this means?
: who can explain to me, thank you.
: $/ = " ";
: while ($paragraph=<>) #Here I can't see any relate with first line.
: { while ($paragraph =~ /[a-z] [' ")] * [.!?] + [' " )] * \s/g) {
: $sevtences++;
: }
: }
: print "$sentences\n";
--
====== Try the low-crossposting robomoderated 'alt.culture.taiwan' ======
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: Thu, 10 Jul 1997 15:44:18 -0400
From: Jack Coursey <jcoursey@sed.nist.gov>
Subject: while (<FILEHANDLE>)
Message-Id: <33C53B92.41C6@sed.nist.gov>
Try to teach myself Perl out of a poor book for those new to the
language and it doesn't tell me what the hell something like while
(<FILEHANDLE>) means. I must have missed a day of class because I don't
see how to evalute this logically.
Thanks in advance,
Jack
------------------------------
Date: 10 Jul 1997 07:37:28 GMT
From: "Victor Antonio Cuya Francia" <vcuya@inch.com>
Subject: Re: Win32 & FTP
Message-Id: <01bc8cfd$7fd6a840$a386f0cf@vcuya>
You can also use the Win32::Internet module. It uses MS' Win32 Internet
functions as provided
by wininetd.dll.
Good Luck.
Neil Kohl <neilkohl@netaxs.com> wrote in article
<slrn5s73gc.430.neilkohl@unix5.netaxs.com>...
> On Tue, 08 Jul 1997 09:21:35 -0500, Buxx <buxx@buxx.com> wrote:
>
> >anyone know of a NET:FTP module for Win32 Perl or
> >a multi-file ftp upload/download script without
> >using the FTP module.
>
------------------------------
Date: Thu, 10 Jul 1997 14:20:07 +0200
From: Maarten Reumer <meert@esg.nl>
Subject: writing documents (and .pl's) to an user directory
Message-Id: <33C4D377.26BB@esg.nl>
I'm busy trying to get this script working and now I'm kinda stuck..
The following script should save a cgi-script as post-query.pl into a
userdirectory (obtained from a cookie and called trainusername1)
This is what's under de submit buttons:
<INPUT TYPE="hidden" NAME="save"
VALUE="../onlinetraining/student/user/post-query.pl">
<INPUT TYPE="hidden" NAME="redirect"
VALUE="../onlinetraining/student/user/query.html">
<INPUT TYPE="submit" VALUE="Save">
The redirect works, but the saving into the directory doesn't. The
directories are accesible and writable. Can anybody help me on this?
Thank you in advance, Maarten Reumer
meert@esg.nl
---
#!/ntreskit/perl
require 'cookielib/cookie.lib';
if (&GetCookies('TRAINUSERNAME1')) {
&SetCookies('TRAINUSERNAME1',$Cookies{'TRAINUSERNAME1'});
}
$user = $Cookies{'TRAINUSERNAME1'};
$server = $ENV{'SERVER_NAME'};
$cgi = $ENV{'SCRIPT_NAME'};
read(STDIN, $data, $ENV{'CONTENT_LENGTH'});
for (split(/&/, $data)) {
($name, $value) = split(/=/);
$value =~ tr/+/ /;
$value =~ s/%([0-9|A-F]{2})/pack(C, hex($1))/eg;
$value =~ s/\cM//g;
$form{$name} = $value
}
$form{'save'} =~ s#user/#$user/#;
open (FILE, ">$form{'save'}");
print FILE "$form{'text'}\n";
close FILE;
if ($form{'save'} =~ /\.pl$/) {
chmod 0755, $form{'save'}
} else {
chmod 0644, $form{'save'}
}
if ($form{'redirect'} eq "return") {
print "Content-type: text/html\n\n";
open (FILE, $form{'save'})
|| print "Can't open $form{'save'}";
while (<FILE>) {print;}
close FILE;
}
elsif ($form{'redirect'} eq "same") {
print "Location: $form{'save'}\n\n";
} else {
$form{'redirect'} =~ s#user/#$user/#;
print "Location: $form{'redirect'}\n\n";
}
------------------------------
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 725
*************************************