[9752] in Perl-Users-Digest
Perl-Users Digest, Issue: 3346 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 4 18:06:00 1998
Date: Tue, 4 Aug 98 15:01:31 -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 Tue, 4 Aug 1998 Volume: 8 Number: 3346
Today's topics:
Re: hiding user input <upsetter@ziplink.net>
Re: hiding user input (I R A Aggie)
Re: hiding user input <brian@Emma.COM>
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Chris Nandor)
Re: hiding user input (Chris Nandor)
Re: Inheritance broken when objects share a file? (Tye McQueen)
Re: Oraperl <gwr@novia.net>
Perl FORMAT in subroutine/function calls "broken" ? <mikeg@slpma8.ed.ray.com>
Perl Question... <dmckeown@istar.ca>
Problem converting a MS Word 97 doc to PDF format via P <ozette.brown@infotechfl.com>
Regexp question (Tony Galway)
Re: Regexp question (Larry Rosler)
Re: Regexp question (Craig Berry)
Re: Regexp question (Abigail)
response.pm brejen@intercall.com
Re: subroutine name <ajohnson@gpu.srv.ualberta.ca>
test (Mark Cornick)
Re: Win95 Server and Perl CGI Scripts <thomas@daimi.aau.dk>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Aug 1998 20:04:24 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: hiding user input
Message-Id: <6q7pg8$nqh@fridge.shore.net>
Abigail <abigail@fnx.com> wrote:
: ++
: ++ You definitely used it more than once... I recall seeing it two or three
: ++ times in a single thread.
: ++
: Supply some message IDs, and maybe people will believe you.
Gee, sorry, Abby. I didn't realize at the time that my credibility was
going to be on the line, so I neglected to save Greg's pithy little pearls
of wit. If you choose to believe that I'm just making this up to make you
or Greg look bad, I can offer no defense, nor do I particularly care.
Other people obviously remember seeing multiple posts, or it wouldn't have
been mentioned in the first place.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 04 Aug 1998 16:57:37 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: hiding user input
Message-Id: <fl_aggie-0408981657380001@aggie.coaps.fsu.edu>
In article <news-0408981041000001@buzz.hq.alink.net>, news@russo.org
(Chris Russo) wrote:
+ I hope that everyone realizes that the best thing to do in this situation
+ is to simply ignore him.
Bingo! He's one of the few people permanently entrenched in my kill file.
I'm sure he's heartbroken, too.
Folks, Brunore simply isn't worth worrying about.
James
------------------------------
Date: Tue, 04 Aug 1998 17:33:43 -0400
From: Brian Fuller <brian@Emma.COM>
Subject: Re: hiding user input
Message-Id: <35C77E37.8759F733@Emma.COM>
John Porter wrote:
>
> Russ Allbery wrote:
> >
> > You do realize that Gary isn't the only person who doesn't appreciate
> > courtesy copies in e-mail, don't you?
>
> Yeah, but that's not the issue here.
> I think we all understand -- except Gary, that is -- that there
> are times when it is appropriate to take a discussion out of
> the public forum into a private one -- which for most people
> means email, but it could just as well be a private IRC channel.
>
> --
> John Porter
This whole thread has a hole in it and the perl fell through it, lost
forever. :-)
------------------------------
Date: Tue, 04 Aug 1998 21:31:09 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35c87d50.65613237@nntpd.databasix.com>
On 4 Aug 1998 14:25:17 GMT, in article <6q75kd$g4f$4@info.uah.edu>,
gbacon@cs.uah.edu (Greg Bacon) wrote:
>In article <35cb3368.105610800@nntpd.databasix.com>,
> gburnore@databasix.com (Gary L. Burnore) writes:
>: On 3 Aug 1998 20:21:25 GMT, in article <6q5645$jki$2@info.uah.edu>,
>: gbacon@cs.uah.edu (Greg Bacon) wrote:
>: >I'm not trying to be clever. Whose fault is it if the point zips
>: >right by someone's head? It's not as though I'm being obscure in
>: >pointing out Gary's propensity toward the ad hominem.
>:
>: Yet you used it over and over to those who simply disagreed with you during
>: the RFD for .moderated.
>
>Over and over? Perhaps you should check your memory and DejaNews.
>Perhaps your threshold for over and over is extremely low. When I
>searched DejaNews for articles in news.groups from gbacon@cs.uah.edu
>that contain the words beating and wife, I found one single article,
><6lon2q$ajj$2@info.uah.edu>. I don't use X-No-Archive, either.
>
>: >Why don't you call Gary on his abuse of ad hominem?
>:
>: Translation:
>: "Whaaah, he can do it so I can too even tough I was doing it before. Waaaah".
>
>Ummm.. no. Why don't you crawl back into the cow's ass from which
>you emerged?
Ah, more shit from little pissass bacon, which btw is the ass end of a pig.
Your consistant attacks are infamous in the news.groups discussions.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Tue, 04 Aug 1998 21:35:23 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cb7e5b.65881258@nntpd.databasix.com>
On 4 Aug 1998 14:18:20 GMT, in article <6q757c$g4f$3@info.uah.edu>,
gbacon@cs.uah.edu (Greg Bacon) wrote:
>In article <35C6CB6A.38701D12@m.block>,
> "B. Oiledanimalbyproducts" <sp@m.block> writes:
>: Greg Bacon wrote:
>: > Bullshit. It is not an attack, but a demonstration. Do not blame me
>: > for the fact that 95% of people don't know anything about arguing.
>:
>: Umm if 95% of the people get annoyed with you and only 5% don't, then t
>: suggests the problem is yours not the 95% - have you thought that maybe
>: can't be bothered trying to get you to see what the other 95% obviously
>: to
>
>I'll invoke Thoreau:
>
> "If a man is more right than his neighbor, then that constitutes a
> majority of one."
>
>: "Chi tace non consente -vuole essere solo gentile" - those who don't sp
>: are just being polite
>
>Ahhh.. who am I to contradict such vast numbers of silent supporters?
>Isn't it hypocritical to get annoyed over the wife beating question
>while invoking the infinitely more annoying and fallacious silent
>supporters argument?
Isn't it infinitely hypocritical to complain about ad-hominims while throwing
them?
<Cue another "i didn't say anything bad" post from bacon.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Tue, 04 Aug 1998 21:36:45 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cc7ea8.65957452@nntpd.databasix.com>
On 4 Aug 1998 14:28:33 GMT, in article <6q75qh$g4f$5@info.uah.edu>,
gbacon@cs.uah.edu (Greg Bacon) wrote:
>In article <m3sojd14i5.fsf@windlord.stanford.edu>,
> Russ Allbery <rra@stanford.edu> writes:
>: Greg Bacon <gbacon@cs.uah.edu> writes:
>: > Why do you maintain this position in the face of documents that claim
>: > otherwise?
>:
>: You do realize that Gary isn't the only person who doesn't appreciate
>: courtesy copies in e-mail, don't you?
>
>I'm not referring to just courtesy copies. Sometimes it's more
>appropriate to take certain discussion to private email rather than
>belabor the entire group with it. (I can't think of any examples
>right now, though. :-)
Well of course you can't. But then you bitch and whine when someone calls you
on your shitty posts saying you didn't make them. It's NEVER appropriate to
continue to email someone after they've told you or asked you to stop.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Tue, 04 Aug 1998 21:38:22 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cd7f37.66100348@nntpd.databasix.com>
On Tue, 04 Aug 1998 14:30:27 GMT, in article
<6q7566$1j5$1@rand.dimensional.com>, Daniel Grisinger
<dgris@rand.dimensional.com> wrote:
>[posted to comp.lang.perl.misc and mailed to the cited author]
Again, why? You KNOW he's reading the thread. WHY do you email him? What
sense does it make?
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Tue, 04 Aug 1998 21:42:05 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cf8008.66310003@nntpd.databasix.com>
On Tue, 04 Aug 1998 14:30:27 GMT, in article
<6q7566$1j5$1@rand.dimensional.com>, Daniel Grisinger
<dgris@rand.dimensional.com> wrote:
>I wrote a little bot named Mortimer last night that will monitor
>clpm and automatically repost any X-No-Archive messages without
>that header. Unless someone can provide a compelling reason
>not to, I am going to start Mortimer monitoring this group
>later today, and this will hopefully no longer be an issue.
I won't even wait to see if you do. I'll be sure to let dimensional.com know
what I think of your abusive threat.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Tue, 04 Aug 1998 17:51:31 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: hiding user input
Message-Id: <pudge-0408981751310001@192.168.0.3>
In article <35cd7f37.66100348@nntpd.databasix.com>,
whatpartofdontemailme@dontyouunderstand wrote:
# On Tue, 04 Aug 1998 14:30:27 GMT, in article
# <6q7566$1j5$1@rand.dimensional.com>, Daniel Grisinger
# <dgris@rand.dimensional.com> wrote:
#
# >[posted to comp.lang.perl.misc and mailed to the cited author]
#
# Again, why? You KNOW he's reading the thread. WHY do you email him? What
# sense does it make?
If making sense were a requirement for posting or e-mailing, I imagine we
would hear from you a lot less.
Burnore, do you realize that people only persist because you get so mean,
defensive, abrasive, etc.? Let it drop, and so will everyone else. We
like to see you get upset, so we persist. Stop getting upset, we stop.
It may be childish, but c'est la vie.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Tue, 04 Aug 1998 17:56:48 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: hiding user input
Message-Id: <pudge-0408981756480001@192.168.0.3>
In article <35cf8008.66310003@nntpd.databasix.com>,
whatpartofdontemailme@dontyouunderstand wrote:
# On Tue, 04 Aug 1998 14:30:27 GMT, in article
# <6q7566$1j5$1@rand.dimensional.com>, Daniel Grisinger
# <dgris@rand.dimensional.com> wrote:
#
# >I wrote a little bot named Mortimer last night that will monitor
# >clpm and automatically repost any X-No-Archive messages without
# >that header. Unless someone can provide a compelling reason
# >not to, I am going to start Mortimer monitoring this group
# >later today, and this will hopefully no longer be an issue.
#
# I won't even wait to see if you do. I'll be sure to let dimensional.com know
# what I think of your abusive threat.
Make sure to tell adelphia.net was my idea!
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: 4 Aug 1998 16:37:11 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: Inheritance broken when objects share a file?
Message-Id: <6q7uu7$nsb@fumnix.metronet.com>
) Tye McQueen <tye@fumnix.metronet.com> wrote:
) >Or just
) >
) > use base SomeClass;
) >
) >which is included in the standard distrubition but not documented yet.
mjtg@cus.cam.ac.uk (M.J.T. Guy) writes:
) Eh? Seems to be documented to me (in perl5.004_04 and perl5.005):
[...]
) NAME
) base - Establish IS-A relationship with base class at
) compile time
)
) SYNOPSIS
) package Baz;
) use base qw(Foo Bar);
)
) [ etc ]
Interesting that you stopped here since there is hardly any
documentation left, including:
> =head1 BUGS
>
> Needs proper documentation!
But I was really refering to is that it isn't mentioned in
the documentation dealing with how to do inheritance.
Whatever.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 4 Aug 1998 16:43:01 -0500
From: George Rapp <gwr@novia.net>
Subject: Re: Oraperl
Message-Id: <5fLx1.25330$CR4.4273752@newscene.newscene.com>
Mike Gahan <ccaamrg@ucl.ac.uk> wrote:
: We have been using Oraperl for DB scripting, but now we are
: upgrading our Oracle server to 7.3.3, which does not support
: SQL*Net V1 any more.
: I have been looking for a recent version of oraperl which we can
: use (Platforms: AIX, Solaris).
: Is anyone using Oraperl for remote connection to Oracle using
: SQL*Net V2? Is such a version of oraperl available?
When you say "Oraperl", I'm assuming that is the older (perl 4) version of
the Oraperl code, using static linking to produce a new 'perl' (or
'oraperl') binary. Thankfully, that's no longer necessary.
Database support has now been split into the database-independent and
-dependent modules. The DBI module is required to any database
connections from Perl 5, as is the appropriate DBD module for the
database(s) to which you wish to connect.
In your case, I'd suggest these (have a look at www.perl.com/CPAN/, then
proceed down to modules/by-category/07_Database_Interfaces):
DBI/DBI-0.93.tar.gz
DBD/DBD-Oracle-0.53.tar.gz
I'm using an earlier version of DBD::Oracle against SQL*Net 2.3 and it
works just fine. HTH.
George
--
George Rapp Home: gwr@novia.net Work: MSUSDFAS.GRAPP01@eds.com
When solving a "panic" you must first ask yourself what you
were doing that could possibly frighten an operating system.
--- P. van der Linden and his uncustomary theories.
------------------------------
Date: Tue, 04 Aug 1998 11:55:10 -0400
From: Michael Genovese <mikeg@slpma8.ed.ray.com>
Subject: Perl FORMAT in subroutine/function calls "broken" ?
Message-Id: <35C72EDE.1115@slpma8.ed.ray.com>
I first noticed this behaviour in a much larger module, but have
reproduced a much smaller pgm that exhibits the problem behavior.
Using Perl FORMATs to produce output in a subroutine call, and
passing data TO the subroutine for printing, things don't
work quite as expected.
For instance, the program:
*********************************************************
#!/usr/local/bin/perl -w
ShowStuff("Text1", 30);
ShowStuff("Text2", 600);
ShowStuff("Text3", 6000);
sub ShowStuff {
my $Label = shift @_;
my $Num = shift @_;
format STDOUT =
Label = @<<<<<<<<<<<<<<< Number = @######
$Label, $Num
.
write;
}
************************************************
Produces the output :
Label = Text1 Number = 30
Label = Text1 Number = 30
Label = Text1 Number = 30
I believe this is wrong.
If, however, the "my" is dropped from the declarations
of "$Label" & "Num", all is fine.
Am running perl 5.003 (yes, I KNOW it's an older version,
but I haven't the authority to update the "main" copy
of perl (/usr/local/bin/perl) myself.
Is this correct, or have I found a bug ?
Also, does it exist in the more recent versions of perl ?
--
Mike Genovese
My opinions are my own, and not necessarily those of my employer.
------------------------------
Date: Tue, 04 Aug 1998 21:56:30 GMT
From: Dave Mckeown <dmckeown@istar.ca>
Subject: Perl Question...
Message-Id: <35C78496.F1D7FDF2@istar.ca>
Is it possible to have a script automaticlly execute at a certian time
say 2:00 am without any outside intervention? I would like to do it
without and ssi but have the script aware of what time it is and them at
the certian time execute. It would help me for a script I'm working on
thanks...
--
Icq# 14056739
mailto:dmckeown@istar.ca
------------------------------
Date: Tue, 04 Aug 1998 16:53:44 -0400
From: Ozette Brown <ozette.brown@infotechfl.com>
Subject: Problem converting a MS Word 97 doc to PDF format via Perl and Win32::0le
Message-Id: <35C774D8.EBEC56E7@infotechfl.com>
Anyone,
I am currently working on a Perl script to convert a MS Word 97 to Adobe
Acrobat format. I've seen the example file from the
GSAR_libwin32.0.12.zip "word2xxx.pl". I've been able to convert to all
the formats the script lists but not PDF. I have Adobe Acrobat
installed, there are two ways to create a PDF file:
1. Open the word document and click "Create PDF"
2. Open the word document and click "Print"-->(the default Printer will
be Adobe PDF Writer 3.0) and say OK.
The example program "word2xxx.pl" states that it may be possible to use
"PrintToFile" to print to PostScript. I've tried just about every
possible notion to PrintToFile and nothing seems to work. If this will
work, I assume that my default printer setting will take care of the
rest.
Can you direct me as to how to PrintToFile using "Word.Application"?
I'm using the Win32::Ole module, naturally. Or, if there is an easier
method than the steps I'm taking, please let me know.
Also, is there a way to find the Properties-->Methods of MS Word. An
example script lists the properties but I can't seem to list the methods
for MS Word. Also, the Adobe Writer isn't part of Word's filetype list
so I couldn't do the following:
$Doc->SaveAs("c:/testdir/test3.pdf"); A PDF file will be created but an
error message appears when viewing it.
I will greatly appreciate any help you may offer.
Thanks,
Ozette
--
Ozette Brown <Ozette.Brown@Infotechfl.com>
Webmaster, Infotech Inc.
5700 S.W. 34th St. Suite 1235 Phone: 352-375-7624
Gainesville, FL 32608-5371 Fax: 352-373-9586
------------------------------
Date: 4 Aug 1998 19:35:01 GMT
From: tony@engr.mun.ca (Tony Galway)
Subject: Regexp question
Message-Id: <6q7np6$ffq$1@coranto.ucs.mun.ca>
A simple question I am sure, but all the same: (I have RTFM'd ... I may
have missed what I am looking for, but I have read it)
Given string
$string = 'hostname/result/data';
I want to place hostname in a separate variable directly, I can do this
$host = $string;
$host =~ s/(.*)\/result\/(.*)/$1/;
or I can do
$_ = $string;
/(.*)\/result\/(.*)/ && { $host = $1 };
which will work fine ... and I will live with this if need be. However, I
would prefer to not have to do the initial assignment of $host or $_.
I just want to know the proper way to get my information into $host.
Thanks
-Tony
--
Tony Galway
Midrange/Unix Support Specialist
Newtel Information Solutions The truth is usually just an excuse
tony@engr.mun.ca for a lack of imagination.
------------------------------
Date: Tue, 4 Aug 1998 13:51:18 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regexp question
Message-Id: <MPG.10311423df172ecc989754@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <6q7np6$ffq$1@coranto.ucs.mun.ca> on 4 Aug 1998 19:35:01 GMT,
Tony Galway <tony@engr.mun.ca> says...
...
> Given string
> $string = 'hostname/result/data';
>
> I want to place hostname in a separate variable directly, I can do this
>
> $host = $string;
> $host =~ s/(.*)\/result\/(.*)/$1/;
>
> or I can do
>
> $_ = $string;
> /(.*)\/result\/(.*)/ && { $host = $1 };
>
> which will work fine ... and I will live with this if need be. However, I
> would prefer to not have to do the initial assignment of $host or $_.
> I just want to know the proper way to get my information into $host.
($host) = $string =~ m!(.*)/result/!;
Note the parentheses around $host. This is really an array assignment
(of, in this case, a one-element array).
I have taken the liberty of medicating your acute case of LTS (Leaning-
Toothpick Syndrome).
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 4 Aug 1998 21:14:13 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Regexp question
Message-Id: <6q7tj5$nkh$3@marina.cinenet.net>
Tony Galway (tony@engr.mun.ca) wrote:
: A simple question I am sure, but all the same: (I have RTFM'd ... I may
: have missed what I am looking for, but I have read it)
:
: Given string
: $string = 'hostname/result/data';
:
: I want to place hostname in a separate variable directly, I can do this
There are a zillion ways to do this. For example,
($host) = split m!/!, $string;
($host) = $string =~ m!^([^/]*)!;
(Both of these assume that the part immediately following the hostname and
a / need not be 'result' -- an assumption your examples below make me
unsure about.)
: $host = $string;
: $host =~ s/(.*)\/result\/(.*)/$1/;
A better way to express this form might be
($host = $string) =~ s!/.*!!;
That is, assign $string to $host, then ditch everything from the first /
onward. It's often worth checking if it's easier to tell the regex what
you don't want, rather than what you do.
: or I can do
:
: $_ = $string;
: /(.*)\/result\/(.*)/ && { $host = $1 };
A lot easier to write as
($host) = $string =~ m!(.*)/result/.*!;
...but even that is a bit wasteful compared to (for example)
($host) = $string =~ m!^([^/]*)/result/!;
(assuming you really insist on the '/result/' part, or
($host) = $string =~ m!^([^/]*)!;
if you don't.)
: which will work fine ... and I will live with this if need be. However, I
: would prefer to not have to do the initial assignment of $host or $_.
: I just want to know the proper way to get my information into $host.
Hope this has helped. Your instincts are right...any explicit assignment
to $_ should set off warning bells that you may be expressing something in
too complicated a way.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 4 Aug 1998 21:31:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Regexp question
Message-Id: <6q7uil$5ij$1@client3.news.psi.net>
Tony Galway (tony@engr.mun.ca) wrote on MDCCXCIX September MCMXCIII in
<URL: news:6q7np6$ffq$1@coranto.ucs.mun.ca>:
++
++ Given string
++ $string = 'hostname/result/data';
++
++ I want to place hostname in a separate variable directly, I can do this
++
++ $host = $string;
++ $host =~ s/(.*)\/result\/(.*)/$1/;
++
++ or I can do
++
++ $_ = $string;
++ /(.*)\/result\/(.*)/ && { $host = $1 };
++
++ which will work fine ... and I will live with this if need be. However, I
++ would prefer to not have to do the initial assignment of $host or $_.
++ I just want to know the proper way to get my information into $host.
($host) = $string =~ m {^(.*)/result/};
Look up what m// does in list context.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: Tue, 04 Aug 1998 19:45:25 GMT
From: brejen@intercall.com
Subject: response.pm
Message-Id: <6q7ocl$kg7$1@nnrp1.dejanews.com>
I am getting an error regarding the lines:
sub error_as_HTML
{
my $self = shift;
my $msg = $self->{'_msg'} || 'Unknown';
my $title = 'An Error Occurred';
---------------------------
my $code = $self->code;
---------------------------
return <<EOM;
The message is "can't call method 'code' without a package
or object reference. Please somebody give me a clue.
Thanks
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 04 Aug 1998 15:33:13 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: subroutine name
Message-Id: <35C77009.2A07C9C9@gpu.srv.ualberta.ca>
Bob Lockie wrote:
>
> How can I get the name of the currently running subroutine?
>
> I can use the function "caller" to get the package, file, line.
>
> I want to log the executing subroutine.
check out using the 'caller EXPR' form, it might
give you what you need.
regards
andrew
------------------------------
Date: Tue, 04 Aug 1998 21:01:18 GMT
From: mcornick@antimony.ml.org (Mark Cornick)
Subject: test
Message-Id: <slrn6sercn.6am.mcornick@oriole.antimony.ml.org>
should NOT propogate to pizzle
------------------------------
Date: Tue, 04 Aug 1998 23:57:37 +0200
From: Thomas Jespersen <thomas@daimi.aau.dk>
Subject: Re: Win95 Server and Perl CGI Scripts
Message-Id: <35C783D1.F0AD1FD5@daimi.aau.dk>
DMOtto2 wrote:
> Message: CGI output from C:/WebSite/perl/search.pl contained no blank
> line separating header and data
Remeber to put \n\n after the Content-type stuff to make a blank line.
(like the message said)
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3346
**************************************