[12549] in Perl-Users-Digest
Perl-Users Digest, Issue: 6149 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 27 22:07:19 1999
Date: Sun, 27 Jun 99 19:00:17 -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, 27 Jun 1999 Volume: 8 Number: 6149
Today's topics:
Re: check for NT process <cassell@mail.cor.epa.gov>
Re: chmod external file <cassell@mail.cor.epa.gov>
Re: compare number and string (Abigail)
David J Pimlott/GB/ITEC/ICI is out of the office. david_pimlott@ici.com
Re: David J Pimlott/GB/ITEC/ICI is out of the office. <tchrist@mox.perl.com>
Re: FAQs and attitudes (was Re: How can I read a whole (Abigail)
Re: FAQs and attitudes (was Re: How can I read a whole <tchrist@mox.perl.com>
Re: FMTEYEWTK on shell globbing (was: Command line para <tchrist@mox.perl.com>
Re: I need help with the Net::FTP module ! (Abigail)
Re: learning perl <cassell@mail.cor.epa.gov>
Re: looking for a free meta search type script ()
matching meta tags (Mark P.)
Re: matching meta tags ()
Re: MySQL vs Oracle zenin@bawdycaste.org
Newbie needs help with system call <argyrodes@sympatico.ca>
Re: Newbie needs help with system call ()
Re: offline testing of Perl/CGI's (Laar)
Re: Pattern matching (Larry Rosler)
Re: Removing spaces from string (Abigail)
Where can I download Perl? <pat4b@hongkong.com>
Re: Why is this broken... <portboy@home.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 27 Jun 1999 17:21:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: check for NT process
Message-Id: <3776C000.9C162100@mail.cor.epa.gov>
Abigail wrote:
> Clinton Carr (ccarr@websocket.com) wrote on MMCXXVI September MCMXCIII in
> <URL:news:3775B05E.DA89CCE1@websocket.com>:
> ## Is there a way to check to see if a Win32 application is running?
> ## Is there a way to kill a running Win32 application?
>
> Press some random keys on the keyboard, or wave with the mouse.
> Chance are the OS will crash, and your application will terminate.
>
> What does Win32 process management have to do with Perl?
Everything. Think about it this way:
How would you do win32 process management *without* Perl?
:-)
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Sun, 27 Jun 1999 16:58:06 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: "Eric v.d. Lugt" <vdlugt@kabelfoon.nl>
Subject: Re: chmod external file
Message-Id: <3776BA8E.E9799FE7@mail.cor.epa.gov>
[courtesy cc sent to poster]
Eric v.d. Lugt wrote:
>
> I have this script, which write's into an HTMLfile.
> The problem is that the HTML file's chmodded 666.
> What I want to do is that the script chmod's the HTML to 666 when it has to
> write to it
> and restores it to 755 when it's finished.
If you had checked first, you would have seen that there is a
chmod() function in Perl. Then you wouldn't have people
telling you to RTFFAQ and stuff.
But that may not solve your problem, if this is in a CGI
script. Depending on your web server, your script may be
run under a variety of constraints. You'll have to talk to
your ISP and read the FAQ for your web server to find out
those details.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 27 Jun 1999 17:54:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: compare number and string
Message-Id: <slrn7ndas8.v72.abigail@alexandra.delanet.com>
Jonas Larsen (jonaslar@online.no) wrote on MMCXXVI September MCMXCIII in
<URL:news:QGwd3.540$o_1.2948@news1.online.no>:
// I have got a problem!
//
// How do I compare these to variables?
//
// Like this:
//
// Suppose that the file has size 17 bytes.
//
// $x=34/2;
//
// $y=stat('filename')[7]; ( I think this gives the size of the file)
//
// Main question is:
// How do I compare x and y?
sub compare_two_integers ($$) {
use constant MAGICAL_CONSTANT => -1;
my ($first, $second) = @_; {
return 1 if $first == 0 && $second == 0;
return 0 if $first <= 0 && $second >= 0 ||
$first >= 0 && $second <= 0;
$first = MAGICAL_CONSTANT + abs $first;
$second = MAGICAL_CONSTANT + abs $second;
redo;
}
}
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 28 Jun 1999 01:00:38 +0100
From: david_pimlott@ici.com
To: comp.lang.perl.misc@list.dejanews.com
Subject: David J Pimlott/GB/ITEC/ICI is out of the office.
Message-Id: <8025679E.00007C8B.00@gbrhn001.ici-group.com>
I will be out of the office from 22/06/99 until 01/07/99.
I will respond to your message when I return.
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the
intended recipient only. Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offence. Please delete if obtained in error and email confirmation to the
sender.
------------------------------
Date: 27 Jun 1999 19:39:59 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: David J Pimlott/GB/ITEC/ICI is out of the office.
Message-Id: <3776d26f@cs.colorado.edu>
Oh boy, another Best of Usenet candidate!
--tom
--
"I've decided I don't want to be a manager. Every time you try to be responsive to your employees, they
say you're being reactive and not proactive. And when you try to be proactive, they accuse you
of being capricious and arbitrary. So I don't wanna be a manager... " --Larry Wall
------------------------------
Date: 27 Jun 1999 17:43:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: FAQs and attitudes (was Re: How can I read a whole file in one go ?)
Message-Id: <slrn7nda84.v72.abigail@alexandra.delanet.com>
Tom Christiansen (tchrist@mox.perl.com) wrote on MMCXXVI September
MCMXCIII in <URL:news:37769795@cs.colorado.edu>:
;; [courtesy cc of this posting mailed to cited author]
;;
;; In comp.lang.perl.misc, abigail@delanet.com writes:
;; :-- I think Randal owes you two Useless Use of Cat Awards for that. Or
;; :-- perhaps only one. :-)
;;
;; I love how has taken up the burden of giving out the awards I long
;; ago invented. That way I don't have to slum in c.u.shell so much. :-)
;;
;; :Oh really? How would you do this without cat then?
;; :
;; :(Hint: grep -ci 'billtax' *.pod doesn't give the same output, and quickly
;; :glancing over the man page of grep didn't enlighten me with a command line
;; :option that did.)
;;
;; The `-h' option, which some but surely not all greps support.
I tried -h on both Linux and OpenBSD. Both greps support -h, but still
don't give the same output as the code I gave.
I guess this is another example of the twisty little maze of Unix tools,
all different.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 27 Jun 1999 17:52:15 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQs and attitudes (was Re: How can I read a whole file in one go ?)
Message-Id: <3776b92f@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, abigail@delanet.com writes:
:I tried -h on both Linux and OpenBSD. Both greps support -h, but still
:don't give the same output as the code I gave.
Apparently you didn't have /usr/local/ppt/bin/grep early enough in your
execution path. :-)
--tom
--
If I have not seen as far as others, it is because giants
were standing on my shoulders. --Hal Abelson
------------------------------
Date: 27 Jun 1999 17:51:12 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FMTEYEWTK on shell globbing (was: Command line parameters / Wildcard characters / Recursive directories)
Message-Id: <3776b8f0@cs.colorado.edu>
Briefly, here are two more points about this matter of whose job it is
to blow up globs.
1. system(SCALAR) vs system(LIST)
Remember when you're calling programs that perl's system() function
to access external commands takes two kinds of arguments. If a single
argument is given, it is subject to shell intervention and metacharacter
munging. But with a list, it's not.
Imagine four files named exactly as follows (well, the non-white space
parts):
Death*Star
DeathOfAStar
"Death*Star"
"DeathOfAStar"
In Perl, you could safely run these through a frobnitz program with:
system('frobnitz', 'Death*Star');
system('frobnitz', 'DeathOfAStar');
system('frobnitz', '"Death*Star"');
system('frobnitz', '"DeathOfAStar"');
Or likewise in C:
execlp("frobnitz", "Death*Star", 0);
execlp("frobnitz", "DeathOfAStar", 0);
execlp("frobnitz", "\"Death*Star\"", 0);
execlp("frobnitz", "\"DeathOfAStar\"", 0);
If you only had the single interface, or if the tool thought that it
was up to *it* to do the globbing/dequoting, you'd be in a whole heap
of trouble. Imagine if every program had to figure out its own quoting
and dequoting strategies. Someting would obviously be in the wrong place.
Which leads us to the next point.
2. Implementing Alternate Shells
Given the right set of primitives, it's easy to write alternative shells
that have their own notions about globbing and quoting. You saw one
example with zsh's **/*.html in the previous posting. Other examples
can be found in the rc and es shells, which use a rather different kind
of quoting than you're likely used to.
Once again, if knowledge of parsing out quotes and blowing up globs had
been stuck into each program, this would have been a daunting task.
Because it was not, these become easy.
Whenever you are trying to choose between a pair of feature sets, look
to see whether one can be easily defined in terms of the other. If one
can but the other can't, then the former is the more powerful of the two,
and you must choose that one for your base system. Anything else precludes
too many possibilities.
Microsoft has never figured this out, of course. Witness the fork(2) fiasco.
--tom
--
"If you can spend a perfectly useless afternoon in a perfectly useless manner,
you have learned how to live."
- Lin Yutang
------------------------------
Date: 27 Jun 1999 17:58:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: I need help with the Net::FTP module !
Message-Id: <slrn7ndb3n.v72.abigail@alexandra.delanet.com>
o_klaus@my-deja.com (o_klaus@my-deja.com) wrote on MMCXXVI September
MCMXCIII in <URL:news:7l64ej$v0n$1@nnrp1.deja.com>:
{} Hi everbody !
{}
{} I was trying to write a Cgi with perl for having FTP-access !
That's silly. You don't need to write a common gateway interface
to get FTP access. Perhaps you meant you want to write a program
that uses CGI for having FTP access. But that's silly as well,
since FTP doesn't use CGI. FTP stands for File Transport Protocol.
So, what you need is writing a script that uses FTP, not CGI.
And that's easy in Perl, as there's the Net::FTP module.
{} But I failed....
{} Is anybody outthere who could send me a detailed description how to use
{} this module - or does anybody know where I can get a short summary ?
{} (URL?)
Did you read the manual? No? Please do. If you did, and you still have
specific question, feel free to ask again.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 27 Jun 1999 16:55:21 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: learning perl
Message-Id: <3776B9E9.96105AB7@mail.cor.epa.gov>
asdfasdfwertwert@my-deja.com wrote:
>
> what are good books or web sites? I found a few tutorials at
> http://devlib.virtualave.net
Start with this URL:
http://www.netcat.co.uk/rob/perl/win32perltut.html
Despite its name, it's not win32-centric.
Then once you feel comfortable with the material presented there,
buy "Learning Perl" [or "Learning Perl for Win32" if you're on
win32].
Once you're up to speed, read the docs which come with every
[correct] install of Perl.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 28 Jun 1999 01:00:06 GMT
From: mr@kells.kells ()
Subject: Re: looking for a free meta search type script
Message-Id: <slrn7ndi8q.3oi.mr@kells.kells>
http://www.isi.edu/lsam/tools/WWW_SEARCH/
On Sun, 27 Jun 1999 15:45:57 GMT, Olindo <olindo@my-deja.com> wrote:
>Does anyone know of a free cgi script that acts like Dogpile or Savy
>Search that searches the major search engines and outputs the results?
>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
------------------------------
Date: Mon, 28 Jun 1999 00:33:06 GMT
From: mag@imchat.com (Mark P.)
Subject: matching meta tags
Message-Id: <3776c1e7.2238176327@news.ionet.net>
Just wondering if anyone can spot my mistake in this script. Its not
getting the meta description or anything for that matter. The script
outputs the files allright though.
#!/usr/local/bin/perl -w
@extension = ('shtml','html','htm');
$dir = "/home/zisman/public_html/working";
open(BRAVO, ">siteindex.html");
print BRAVO "";
close(BRAVO);
foreach $extension (@extension){
opendir (COP, "$dir") || die $!;
@filenames = grep (/\.$extension$/i,readdir(COP));
closedir (COP);
foreach $file (@filenames)
{
open(FILE,"$file");
@LINES = <FILE>;
close(FILE);
$string = join(' ',@LINES);
$string =~ s/\n//g;
$string = /<META\s+NAME="description"\s+CONTENT=".*?">/i;
$string =~ s/<META\s+NAME="description"\s+CONTENT="//ig;
$string =~ s/">//g;
#$string =~ s!<([^>]*?)>! !g;
open(BRAVO, ">>siteindex.html");
print BRAVO "<a href=\"$file\" class=\"alt2\">$file</a>$string<br>\n";
close(BRAVO);
}
}
print "Content-type: text/html\n\n";
print &Template("siteindex.html");
------------------------------
Date: 28 Jun 1999 01:08:31 GMT
From: mr@kells.kells ()
Subject: Re: matching meta tags
Message-Id: <slrn7ndioj.3oi.mr@kells.kells>
On Mon, 28 Jun 1999 00:33:06 GMT, Mark P. <mag@imchat.com> wrote:
>Just wondering if anyone can spot my mistake in this script. Its not
>getting the meta description or anything for that matter. The script
>outputs the files allright though.
>
>#!/usr/local/bin/perl -w
>
>@extension = ('shtml','html','htm');
>
>$dir = "/home/zisman/public_html/working";
>
>open(BRAVO, ">siteindex.html");
>
>print BRAVO "";
>close(BRAVO);
>
> foreach $extension (@extension){
> opendir (COP, "$dir") || die $!;
>@filenames = grep (/\.$extension$/i,readdir(COP));
>closedir (COP);
> foreach $file (@filenames)
> {
>open(FILE,"$file");
>@LINES = <FILE>;
>close(FILE);
>$string = join(' ',@LINES);
>$string =~ s/\n//g;
>
>$string = /<META\s+NAME="description"\s+CONTENT=".*?">/i;
^^^
Martin
mpr@webcamnow.com
>
>$string =~ s/<META\s+NAME="description"\s+CONTENT="//ig;
>$string =~ s/">//g;
>#$string =~ s!<([^>]*?)>! !g;
>
> open(BRAVO, ">>siteindex.html");
>
>print BRAVO "<a href=\"$file\" class=\"alt2\">$file</a>$string<br>\n";
>close(BRAVO);
> }
>}
>
>print "Content-type: text/html\n\n";
>print &Template("siteindex.html");
>
------------------------------
Date: 28 Jun 1999 00:55:17 GMT
From: zenin@bawdycaste.org
Subject: Re: MySQL vs Oracle
Message-Id: <930531555.552491@thrush.omix.com>
Wendell Crenshaw <crensw@yahoo.com> wrote:
: I'm new to Perl, and I need to develop dynamic pages with Perl on Unix
: that utilize an Oracle database. I'm having a problem finding a
: reasonable cost hosting service that offers Oracle, so I'm considering
: using MySQL - and I'm wondering how much syntax difference there is
: between Oracle and MySQL when you consider writing web pages that do
: simple data chores, such as add/change/delete records in the data base.
: Can anyone share insight? I'm hoping the only difference is in the
: connection string to the data base!!!
MySQL doesn't support sub-selects, which makes doing anything that
is normalized over more then one single table (eg, all but the most
trivial uses) extremely painful. Sub-select support is expected in
the .23 release...whenever that happens (no ETA at all right now).
Try PostgreSQL, or install Linux and use the free Oracle for Linux
demo for development.
--
-Zenin (zenin@archive.rhps.org) "Hey, are you one of those Linux coders?"
"Nyet. Linux coder in next office."
"Good man. Ignore the screams."
--www.userfriendly.org
------------------------------
Date: Sun, 27 Jun 1999 23:47:52 GMT
From: Norman Crooks <argyrodes@sympatico.ca>
Subject: Newbie needs help with system call
Message-Id: <3776BA4A.6AD98687@sympatico.ca>
Hi,
I'm having trouble doing a system call to pgp from a perl script. My
script is on a Solaris unix box.
At the command line, the following does what I want it to:
$ perl -e '`/heckler/www/stricker/.pgpdir/pgp -eatw
/heckler/www/stricker/cgi-bi
n/filename.txt Sue`';
It returns the following, and my file is properly encrypted:
Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
(c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
International version - not for use in the USA. Does not use RSAREF.
Current time: 1999/06/27 22:35 GMT
Additionally, this works fine from the command line:
$ perl -e 'system("/heckler/www/stricker/.pgpdir/pgp -eatw
/heckler/www/stricker
/cgi-bin/filename.txt Sue")';
and returns this:
Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
(c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
International version - not for use in the USA. Does not use RSAREF.
Current time: 1999/06/27 22:52 GMT
Recipients' public key(s) will be used to encrypt.
Key for user ID: Sue Stricker <stricker@strickerbooks.com>
1024-bit key, key ID CD393A49, created 1999/06/23
.
Transport armor file: /heckler/www/stricker/cgi-bin/filename.txt.asc
File /heckler/www/stricker/cgi-bin/filename.txt wiped and deleted.
In the script however, neither of these statements work:
`/heckler/www/stricker/.pgpdir/pgp -eatw
/heckler/www/stricker/cgi-bin/filename.txt Sue`;
Returns a SERVER ERROR message
and,
system("/heckler/www/stricker/.pgpdir/pgp -eatw
/heckler/www/stricker/cgi-bin/filename.txt Sue");
returns
Recipients' public key(s) will be used to encrypt. Preparing random
session key...
but doesn't actually do any encryption. My script also 'stalls' at
this point.
If anyone can tell me the proper syntax to call pgp and encrypt from
within a script I would be very appreciative. I should of had this done
a week ago...
Thanks,
-Norm
--
http://www.nobelmed.com/ncrooks
mailto:argyrodes@antispamsympatico.ca
Remove 'antispam' to email.
------------------------------
Date: 28 Jun 1999 01:14:02 GMT
From: mr@kells.kells ()
Subject: Re: Newbie needs help with system call
Message-Id: <slrn7ndj2u.3oi.mr@kells.kells>
Most likely a permissions problem. Check to see who you servers is
running as, su to that user, and try running these commands from
the command line again.
Martin
mpr@webcamnow.com
On Sun, 27 Jun 1999 23:47:52 GMT, Norman Crooks <argyrodes@sympatico.ca> wrote:
>Hi,
>
>I'm having trouble doing a system call to pgp from a perl script. My
>script is on a Solaris unix box.
>
>
>
>At the command line, the following does what I want it to:
>
>$ perl -e '`/heckler/www/stricker/.pgpdir/pgp -eatw
>/heckler/www/stricker/cgi-bi
>n/filename.txt Sue`';
>
>It returns the following, and my file is properly encrypted:
>
>Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
>(c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
>International version - not for use in the USA. Does not use RSAREF.
>Current time: 1999/06/27 22:35 GMT
>
>Additionally, this works fine from the command line:
>
>$ perl -e 'system("/heckler/www/stricker/.pgpdir/pgp -eatw
>/heckler/www/stricker
>/cgi-bin/filename.txt Sue")';
>
>and returns this:
>
>Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
>(c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
>International version - not for use in the USA. Does not use RSAREF.
>Current time: 1999/06/27 22:52 GMT
>Recipients' public key(s) will be used to encrypt.
>Key for user ID: Sue Stricker <stricker@strickerbooks.com>
>1024-bit key, key ID CD393A49, created 1999/06/23
>.
>Transport armor file: /heckler/www/stricker/cgi-bin/filename.txt.asc
>File /heckler/www/stricker/cgi-bin/filename.txt wiped and deleted.
>
>
>In the script however, neither of these statements work:
>
>
>`/heckler/www/stricker/.pgpdir/pgp -eatw
>/heckler/www/stricker/cgi-bin/filename.txt Sue`;
>
>Returns a SERVER ERROR message
>
>and,
>
>system("/heckler/www/stricker/.pgpdir/pgp -eatw
>/heckler/www/stricker/cgi-bin/filename.txt Sue");
>
>returns
>
>Recipients' public key(s) will be used to encrypt. Preparing random
>session key...
>
>but doesn't actually do any encryption. My script also 'stalls' at
>this point.
>
>If anyone can tell me the proper syntax to call pgp and encrypt from
>within a script I would be very appreciative. I should of had this done
>a week ago...
>
>Thanks,
>-Norm
>
>--
>http://www.nobelmed.com/ncrooks
>mailto:argyrodes@antispamsympatico.ca
>Remove 'antispam' to email.
>
------------------------------
Date: Mon, 28 Jun 1999 01:35:39 GMT
From: laar@ix.netcom.com (Laar)
Subject: Re: offline testing of Perl/CGI's
Message-Id: <3776d01b.23514054@nntp.ix.netcom.com>
On 27 Jun 1999 16:18:47 -0500, abigail@delanet.com (Abigail) wrote:
>So, what's your Perl question?
Was it *really* that unclear to you Abigail, or are you just in a bad
mood? Or does it just bother you prefer that a queries was posted here
involving Perl in combination with other factors? As you read, my
dilema involved multiple possible factors, including an HTML doc, a
browser, and a Perl CGI script.
The question is, Why were you compelled to spew out such a snotty
response? Jeez, Abby, cheer up.
--
Laar
www.netcom.com/~laar/index.html
------------------------------
Date: Sun, 27 Jun 1999 18:12:05 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Pattern matching
Message-Id: <MPG.11e06bb9919e4bdd989c5f@nntp.hpl.hp.com>
In article <37768352.38701768@news.inet.co.th> on Sun, 27 Jun 1999
20:15:48 GMT, Ryan Ngi <ryanngi@hotmail.com> says...
> we have
>
> ".*?" <----- for finding any thing is match from Left to Right
>
> such as
>
> $x='/usr/local/bin/perl'
>
> $st=~m!(/.*?)/!;
> $st=$1;
Before using $1 you should check that the match succeeded.
> we would get "/usr"
>
> but if i want to find form Right to Left such as
>
> $st=~s!(/.*)$!!;
>
> it's not work, because there is "/" in front of the string.....
>
> is there anyway to do the job like ".*?" do but do it in the reverse
> way??????
$st =~ s!(/[^/]*)$!!;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 27 Jun 1999 16:27:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Removing spaces from string
Message-Id: <slrn7nd5p8.v72.abigail@alexandra.delanet.com>
Eric v.d. Lugt (vdlugt@kabelfoon.nl) wrote on MMCXXVI September MCMXCIII
in <URL:news:7l5892$fd0$1@news.kabelfoon.nl>:
## Does anyone know how to remove space withing a sting?
##
## $klaas = "mm 11 2 244";
By using magical Perl recursion:
$klaas = "mm 11 2 224";
$klaas = `perl -e 'print \@ARGV' $klaas`;
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 28 Jun 1999 09:37:10 +0800
From: "Patrick" <pat4b@hongkong.com>
Subject: Where can I download Perl?
Message-Id: <7l6jjc$hre$1@imsp009a.netvigator.com>
As title
Patrick
------------------------------
Date: Mon, 28 Jun 1999 00:47:53 GMT
From: Mitch <portboy@home.com>
Subject: Re: Why is this broken...
Message-Id: <3776C60B.8C2A8B1D@home.com>
>
>
> It looks like you need to print OUT $old_line; whenever the test fails.
> Or else you end up only printing lines that look like your $new_line
> variable.
>
Which "test" are you referring to? There are two tests in this code.
.mitch
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6149
**************************************