[11922] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5522 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 29 20:07:11 1999

Date: Thu, 29 Apr 99 17: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           Thu, 29 Apr 1999     Volume: 8 Number: 5522

Today's topics:
    Re: "learning perl" does not seem to be written well <uri@sysarch.com>
    Re: An explanation of sort <jeromeo@atrieva.com>
    Re: An explanation of sort (Larry Rosler)
    Re: Calling functions iteratively <uri@sysarch.com>
    Re: Calling functions iteratively (Andrew Allen)
    Re: Example Server Code <cassell@mail.cor.epa.gov>
    Re: expect <cassell@mail.cor.epa.gov>
    Re: Help! - Trouble with CGI script written in Perl. <cassell@mail.cor.epa.gov>
    Re: IIS 3.0 and Perl configutation <cassell@mail.cor.epa.gov>
    Re: Need an idea to do Perl-debugging in embedded Perl <cassell@mail.cor.epa.gov>
    Re: Net::FTP question (Charles DeRykus)
    Re: Net::FTP question <mgarber@answerthink.com>
    Re: newbie in need... <swarren@slip.net>
    Re: Newsfeed and Local Weather (Bob Trieger)
        Python and Perl (was: converting perl to python) (Ben Caradoc-Davies)
    Re: RegExp for the following string, w/o using split <jeromeo@atrieva.com>
    Re: RegExp for the following string, w/o using split <cassell@mail.cor.epa.gov>
    Re: Telnet problems <bill@fccj.org>
    Re: what's wrong with $x = $y or "" <uri@sysarch.com>
    Re: what's wrong with $x = $y or "" (Abigail)
        Win32::OLE and Word <david.ritchie@tradenz.govt.nz>
    Re: Win95/98 file locking <cassell@mail.cor.epa.gov>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 29 Apr 1999 18:02:59 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <x7vhef6q5o.fsf@home.sysarch.com>

>>>>> "b" == birgitt  <birgitt@my-dejanews.com> writes:

  b> Somewhere I read an announcement about a book about "Algorithms in
  b> Perl".  I am looking forward to it.

that will be the "wolf" book by jon orwant (publisher of the perl
journal). i heard o'reilly plans to have it out by the next conference
in august.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Thu, 29 Apr 1999 15:01:55 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Rick Delaney <rick.delaney@home.com>
Subject: Re: An explanation of sort
Message-Id: <3728D6D3.D7C377A3@atrieva.com>

Rick Delaney wrote:
> Jerome O'Neil wrote:
> > Larry Rosler wrote:
> > > wouldn't be as silly and seems considerably more perspicuous.
> >
> > I'm well versed in silly, but how would I know if I'm being perspicous?
> > Or, if I were being perspicious, what would I be?
> 
> Don't they have dictionaries in Seattle?

Nope.  We gave them up to save the trees.  Same thing for thesauruses.

> I guess I'm not very perspicacious.  :-)

Is that good or bad?  Now not only am I going to worry about my
persp(ic|icac)iousness, I'm going to worry about the spelling!!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Thu, 29 Apr 1999 15:22:13 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: An explanation of sort
Message-Id: <MPG.11927b733e90159e98997c@nntp.hpl.hp.com>

In article <3728D0A6.FA11976F@home.com> on Thu, 29 Apr 1999 21:37:12 
GMT, Rick Delaney <rick.delaney@home.com> says...
> Jerome O'Neil wrote:
> > 
> > Larry Rosler wrote:
> > >
> > > wouldn't be as silly and seems considerably more perspicuous.
> > 
> > I'm well versed in silly, but how would I know if I'm being perspicous?
> > Or, if I were being perspicious, what would I be?
> 
> Don't they have dictionaries in Seattle?  I'm not sure if there's a joke
> in those misspellings or not.  I guess I'm not very perspicacious.  :-)

Perspicuity is a virtue for programs (except JAPHs and Obscure Perl 
contests, of course).  Perspicacity is a virtue for programmers.  Maybe 
the latter should be added to The Larry's list of three.

Non-native English speakers might find these words more familiar than 
some of us natives, especially if they have backgrounds in Latin (which 
most of us don't).

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 29 Apr 1999 18:13:33 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Calling functions iteratively
Message-Id: <x7so9j6po2.fsf@home.sysarch.com>

>>>>> "AA" == Andrew Allen <ada@fc.hp.com> writes:

  AA> @subs=([\&test1,"a"],[\&test2,"b"]);

  AA> foreach(@subs) {
  AA>   $$_[0]->(@$_[1..$#$_]);
                          ^
                          extra $

and you might need to check the precedence on the $$_[0]->. i think the
first $ is not needed as the -> does a deref.


or this variant which is a little cleaner IMO:

	@subs=( [\&test1, ["a"] ],[ \&test2, ["b"] ]);

	foreach( @subs ) {
		$_[0]->(@{$_[1])) ;
	}

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 29 Apr 1999 23:43:47 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Calling functions iteratively
Message-Id: <7gaqup$nnn$4@fcnews.fc.hp.com>

Uri Guttman (uri@sysarch.com) wrote:
: >>>>> "AA" == Andrew Allen <ada@fc.hp.com> writes:

:   AA> @subs=([\&test1,"a"],[\&test2,"b"]);

:   AA> foreach(@subs) {
:   AA>   $$_[0]->(@$_[1..$#$_]);
:                           ^
:                           extra $

: and you might need to check the precedence on the $$_[0]->. i think the
: first $ is not needed as the -> does a deref.

Nope on both counts; correct as written. $#$_ returns the index of the
last element of the list reference contained in $_. $$_[0] returns the
first element in the list referenced by $_, which is a reference to
sub, therefore ->( is still necessary. May want to double-check using
the interpreter before (mis)correcting people on the newsgroup.

: or this variant which is a little cleaner IMO:

: 	@subs=( [\&test1, ["a"] ],[ \&test2, ["b"] ]);

: 	foreach( @subs ) {
: 		$_[0]->(@{$_[1])) ;
                               ^should be '}'
: 	}

except it doesn't work since neither $_[0] or $_[1] is defined, since
foreach assigns $_, not @_. Perhaps you meant:

  $$_[0]->(@{$$_[1]});

which is a little cleaner (but @subs is messier).

Andrew



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

Date: Thu, 29 Apr 1999 15:35:06 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Example Server Code
Message-Id: <3728DE9A.90B01003@mail.cor.epa.gov>

Steve Crump wrote:
> 
> Can someone send me an example of a perl 5 script that uses the
> IO:Socket
> module to:
> 
> Wait for a network connection on a specified port.
> Read a line of input from the port.
> Print a line to the port.
> Close the connection.
> 
> I have found some examples of servers written in perl 4 but
> I would like to know how to do it with the IO:Socket modules.

There are excellent examples of what you want in the Perl 
Cookbook by Tom Christiansen and Nathan Torkington.  If you 
don't want to go buy the book, you can download the examples
from O'Reilly's website.  You cheapskate.  :-)

But go buy the book for all the other swell code, and for the
detailed discussions on the topics.  Don't wait until you have
to ask a question in front of a bunch of Perlites.  Some of us
are perspicacious.  :-)

HTH,
David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 29 Apr 1999 15:51:38 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: expect
Message-Id: <3728E27A.40C1BC09@mail.cor.epa.gov>

cryptoman@my-dejanews.com wrote:
> 
> Hi,
> 
> I heard about module EXPECT. I would like to use it but I don't know very well
> what it can do. Can you tell me where I can get documentation before I install
> it machine?

When you go to CPAN to get it, take a look around.  You'll find:
(1) a README file for Expect.pm which tells you what it is; and
(2) a tutorial/Readme file that will walk you through it.

Who could ask for anything more?  [and why do I suddenly feel like
bursting into song?]

HTH,
David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 29 Apr 1999 16:00:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Help! - Trouble with CGI script written in Perl.
Message-Id: <3728E489.DCC18040@mail.cor.epa.gov>

Pizdobol wrote:
> 
> David Cassell <cassell@mail.cor.epa.gov> wrote in message
> news:3727A764.8F60B341@mail.cor.epa.gov...
> >
> > It is really pretty rude to dump this amount of trafe on us and expect
> > someone to solve all your problems for free.  And I doubt you can
> > afford the consulting fees.
> Sorry about that.

We live and learn.

> > What works?  What doesn't work?  What OS is it on?  Server?  What
> > version of Perl?  Are there error messages?  What's in the error
> > log?  Why isn't this using CGI.pm?  Does this work from the command
> > line?  Does a test script work on your server?
>
> The server is running Apache/1.3.4 (Unix) FrontPage/3.0.4.2 PHP/3.0.7 on
> Linux, has perl5.004 , and i have a virtual hosting account on that box.
> I don't even have access to the error log. As i try to run the script, it
> gives me the 500 error. All my other scripts work fine.

Okay, now we're getting somewhere.  Specifically, we're getting to
perlfaq9.  If you use the nifty perldoc program that comes with
Perl, you can look up `keywords' to see if there's a Perl FAQ that
answers your question.  It would have saved you a couple days
already.  If I just look for that server error number:

    perldoc -q 500

I find this FAQ:
"My CGI script runs from the command line but not the browser. (500
Server Error)

The short answer we learn from this perusal is that you have a CGI
problem, not a Perl problem.  I know, I know, you wrote the CGI
code in Perl.  But trust me, this is a CGI problem dressed up in a
llama's coat.  Check out the CGI FAQ

http://www.webthing.com/tutorials/cgifaq.html

and the Web FAQ

http://www.boutell.com/faq/

and you should find your answer there.  If not, then you need
to ask in a newsgroup that has CGI in its name, like
comp.infosystems.www.authoring.cgi
for more advice.

David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 29 Apr 1999 15:23:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: IIS 3.0 and Perl configutation
Message-Id: <3728DBD7.F82F52B6@mail.cor.epa.gov>

news.boeing.com wrote:
> 
> I had to re-install my IIS 3.0 and now my Perl scripts do not work.  Does

Ouch.  Have you considered Apache for win32?  It's free, you 
know...

> someone know the configuration in IIS and the Registry?

If you have ActiveState Perl, then the complete directions are on 
your system.  Pull up the HTML docs, go to the ActivePerl FAQ,
then to the Web Server Config section.  And there it is:
"How do I configure IIS 3.0 or lower to support Perl for Win32?"

It even has pointers to a relevant MS Knowledge Base article, and 
to other useful FA Questions.

> [snippo]
>
> Thanks  for the help.

You're welcome,
David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 29 Apr 1999 15:12:30 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Need an idea to do Perl-debugging in embedded Perl
Message-Id: <3728D94E.8D27268C@mail.cor.epa.gov>

L. Kovacs wrote:
> 
> Hello,
> 
> we want to write a Win application that uses embedded Perl to execute
> generated Perl-code in a visual environment and we want to offer the
> possibility to step through the Perl-code, set breakpoints, view and change
> variables etc. We need a breakthrough idea how it can be done.
> 
> Thanks.

Hi,

I want to write a mathematical proof that uses ordinary alphanumeric
characters to prove Fermat's Last Theorem.  I want to consider the
possibility of using previous mathematical theorems, including
algebraic number theory and elliptic function theory, etc.  I want to
do it in 10 pages.  I need a breakthrough idea how it can be done.

See any similarities here?

-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 29 Apr 1999 21:40:43 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Net::FTP question
Message-Id: <FAz07v.GKu@news.boeing.com>

In article <3728843E.E030F3CB@answerthink.com>,
Manuel Garber  <mgarber@answerthink.com> wrote:
>  Does anybody knows how to use Net::FTP  constructor to open a
>connection  to nonstandard port.
>
>  The documentation is cryptic for me.
>
> $ftp = Net::FTP->new("host",  [OPTIONS]);
>
>  where
>"OPTIONS are passed in a hash like fashion, using key and value pairs."
>
>options include "Port".
>
>  But I cannot guess how to actually set the port I need.
>

my $ftp = Net::FTP->new("some.host", 'Port'=>21) or 
   die "Net::FTP failed\n";    

--
Charles DeRykus





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

Date: Thu, 29 Apr 1999 19:29:01 -0400
From: Manuel Garber <mgarber@answerthink.com>
Subject: Re: Net::FTP question
Message-Id: <3728EB3C.C108E3A5@answerthink.com>



Stefaan A Eeckels wrote:

>
> Try:
> my $ftp = Net::FTP->new($remoteHost,
>         (Timeout => 10, Debug => 1, Port => 2121)) ||
>         die "Failed to connect to $remoteHost. $!";
>
> As you can see, the options *are* specified in a hash-like
> fashion.

OK OK, I could not guess this syntax. THANKS a lot, it works!

>
> --
> Stefaan
> --
>
> PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
> ___________________________________________________________________
> Perfection is reached, not when there is no longer anything to add,
> but when there is no longer anything to take away. -- Saint-Exupiry



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

Date: Thu, 29 Apr 1999 22:08:22 GMT
From: "Stephen Warren" <swarren@slip.net>
Subject: Re: newbie in need...
Message-Id: <qL4W2.4596$gv5.2784@news.rdc1.sfba.home.com>

IDT Lab User <nobody+reachable_in_lcc_idt_lab@gatech.edu> wrote in message
news:37288E95.68058E40@gatech.edu...
>
> 3) I have no idea why I don't have "cl.exe", as it seems a perfectly
> reasonable thing to have and everybody should get a free one from the
> government. I'm still trying to figure out what it does.

cl.exe is a C compiler. Certainly, Microsoft c provides cl.exe - I don't
know what other vendors name their executable.

Probably, the Makefile.pl is trying to compile some C source... Not sure why
it would for those modules - perhaps it uses the native OS string-handling
functions to implement its operation. I've never used those modules so I
wouldn't know...





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

Date: Thu, 29 Apr 1999 22:07:31 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Newsfeed and Local Weather
Message-Id: <7gaklv$p9v$1@holly.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
"Skyward Internet Technology" <skyward@frognet.net> wrote:
>Hello Everybody,
>
>Does anybody know of any Perl scripts available that go out to the Weather
>Channel and grab their local forecast?  I've seen this done with a Cold
>Fusion application and just wondered if anybody had a Perl script to do the
>same.


The LWP module will help you with this.

perldoc LWP


Good luck



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

Date: 29 Apr 1999 22:51:19 GMT
From: bmcd@es.co.nz (Ben Caradoc-Davies)
Subject: Python and Perl (was: converting perl to python)
Message-Id: <slrn7ihopk.js.bmcd@ripley.sulaco.net>

[This is not intended to start another pointless language war. Well, at least
not between Perlers and Pythonistas.  :-)  ]

On Thu, 29 Apr 1999 20:29:45 +0300, Moshe Zadka <moshez@math.huji.ac.il> wrote:
>I wonder if Randal came here (2 messages in this group) to spread the
>regular Perl propaganda (summarized by "This language is icky because
>programmers are icky")....
>Randal, while I'm sure you're a good guy, and I liked ``Learning Perl'',
>most of us at c.l.py heard more about Perl then we'll ever want to --
>in fact, I think many of us moved to Python from Perl, and never looked
>back. (Or we'd turn into salt)
>(And hey, Randal, when you wake up and start using Python, I'm sure you'll
>be one of the best c.l.py posters <0.5 wink>)

Hmm ... Randal did have a rather Python-friendly .sig ... I would be reluctant
to start hassling him.

I think that between Tom C. and Randal, some of the nicest things that I have
heard said about Python have come from Perlers.

In my opinion, Perl is one of the best things Python has going for it;
1)	Perl has, because of it's extreme usefulness, very deep "market
	penetration" (ugh, I'm sounding like a suit).
2)	Perl has established the credibility of dynamically typed high level
	languages (I'm trying to stamp out the term "scripting languages")
	for general purpose programming.
3)	The nice people in c.l.p.m mention Python from time to time, and point
	people in the right direction. And then there's Tom C's web page 
	comparing Perl and Python.

Perl is a fertile breeding ground for Pythonistas. I'm sure many expand into
Python from Perl. But Perlers never forget their roots. Some things are just
too succint in perl to do any other way.

e.g. deformatting a document, when you need extended regex and text which sed
can't handle;

perl -e "while(<>){s/\s/\n/g;print;}" file1.txt > temp1.txt
perl -e "while(<>){s/\s/\n/g;print;}" file2.txt > temp2.txt
diff temp1.txt temp2.txt

And this was on a machine which didn't have python (yet!). Even if it had, I
would have still used perl.

Perl is going to be around for a long time. This is a very good thing for
Python.

-- 
Ben Caradoc-Davies <bmcd@es.co.nz>


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

Date: Thu, 29 Apr 1999 15:38:47 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Michael Shavel <mshavel@erols.com>
Subject: Re: RegExp for the following string, w/o using split
Message-Id: <3728DF77.A2C07A58@atrieva.com>

Michael Shavel wrote:
> 
> Hi
> 
> I have a string that looks like this:
> 
> " 4","123456","19990423","","","","","This is the text field","","",""

> I know I could do this using
> split but I was trying not to because I have about 250,000 lines like this
> in each file that I have to parse.  I thought the overhead of a split
> would be too great. Any suggestions please...

Split is what you want.  250,000 lines is pretty trivial.

while(<>){
	my($one,$two,@rest) = split(/,/);
	# Etc...
}

Good Luck!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Thu, 29 Apr 1999 16:56:21 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: RegExp for the following string, w/o using split
Message-Id: <3728F1A5.CFEDB4DE@mail.cor.epa.gov>

Jerome O'Neil wrote:
> 
> Michael Shavel wrote:
> >
> > Hi
> >
> > I have a string that looks like this:
> >
> > " 4","123456","19990423","","","","","This is the text field","","",""
> 
> > I know I could do this using
> > split but I was trying not to because I have about 250,000 lines like this
> > in each file that I have to parse.  I thought the overhead of a split
> > would be too great. Any suggestions please...
> 
> Split is what you want.  250,000 lines is pretty trivial.
> 
> while(<>){
>         my($one,$two,@rest) = split(/,/);
>         # Etc...
> }
> 
> Good Luck!

Or, if you don't need the rest of the line after the second field,
you could specify the LIMIT like this:

          my ($one,$two) = split(/,/,$_,2);

And if you do need the rest that are in @rest [in Jerome's code],
don't forget that the last field will have a newline on it, and
you'll want to chomp() it if you need to work with it.

David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 29 Apr 1999 12:02:48 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Telnet problems
Message-Id: <37288288.0@usenet.fccj.cc.fl.us>

In article <7g7hn3$gtt$1@nnrp1.dejanews.com>, sboss@my-dejanews.com wrote:


> In article <3722335b.0@usenet.fccj.cc.fl.us>,
>   "Bill Jones" <bill@fccj.org> wrote:
>> Are you sure you can login as root over a TTY on your system?
>> (Normally you can't by default.)
>>
>> Refer to the /etc/securetty file to be sure.
>
> Yes, I can login via telnet as root.  It has been setup that way and I can do
> it manualy.
>
> Scott
>

(Wondering what it would be like to attack 16 E10000 domains at once.)

Pretty scary!
-Sneex-  :]
_________________________________________________________________________
Bill Jones  | Data Security Specialist | http://www.fccj.org/cgi/mail?dss
FCCJ  |  501 W State St  |  Jacksonville, FL 32202  |  1 (904) 632-3089

Mentoring:  http://tesla.fccj.cc.fl.us/cgi-bin/mentors.pl?cmd=show&uid=24

         Jacksonville Perl Mongers
         http://jacksonville.pm.org/Letter.cgi
         jax@jacksonville.pm.org


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

Date: 29 Apr 1999 18:16:42 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: what's wrong with $x = $y or ""
Message-Id: <x7pv4n6pit.fsf@home.sysarch.com>

>>>>> "SW" == Stephen Warren <swarren@slip.net> writes:

  SW> Quite useful at times.

  SW> Perhaps we could even have:

  SW> a ?:= b ; // a = b if undef b

ITYM $a = $b unless defined $a

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 29 Apr 1999 17:27:05 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: what's wrong with $x = $y or ""
Message-Id: <slrn7ihn5a.bln.abigail@alexandra.delanet.com>

Stephen Warren (swarren@slip.net) wrote on MMLXVII September MCMXCIII in
<URL:news:Bg4W2.4583$gv5.2711@news.rdc1.sfba.home.com>:
$$ Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> wrote in
$$ message news:37283552.87610075@gmx.net...
$$ > Abigail wrote:
$$ > >
$$ > > Philip Newton (nospam.newton@gmx.net) wrote on MMLXVI
$$ > > September MCMXCIII in <URL:news:3726E92B.F259BE35@gmx.net>:
$$ > > // Abigail wrote:
$$ > > // >
$$ > > // > Now if only we had the ?? operator....
$$ > > //
$$ > > // What would this operator do? Logical ?: or something?
$$ > >
$$ > > EXPR1 ?? EXPR2 would be EXPR1 if EXPR1 is defined, EXPR2 otherwise.
$$ >
$$ > That would appear to be a useful addition. But as Bart points out, it
$$ > probably couldn't be called ??.

Oh. Better tell that to Larry W, as he prefers ?? as name for this 
operator. If it will ever be part of Perl.

$$ 
$$ Well, it's already ?: in C, if you use gcc-specific extensions.
$$ 
$$ Assuming that NULL in C is undef in Perl, then:
$$ 
$$ {
$$    char *a ;
$$    char *b = something ;
$$    a = a ?: b ; // Same as "a = a ? a : b" assuming NULL is false
$$ }

"a ?: b" is the same as "a ? a : b", then ?: and ?? will have two 
differences:
   1)  ?? will only yield the RHS if the LHS is undefined. Not just any
       "false" value.
   2)  ?? will never evaluate one of its operands more than once.


Abigail
-- 
perl -wlpe '}{$_=$.' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
    http://www.newsfeeds.com/       The Largest Usenet Servers in the World!
---------== Over 72,000 Groups, Plus    Dedicated  Binaries Servers ==--------


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

Date: Fri, 30 Apr 1999 10:28:39 +1200
From: "David Ritchie" <david.ritchie@tradenz.govt.nz>
Subject: Win32::OLE and Word
Message-Id: <I45W2.156$ja5.6477@news.clear.net.nz>

I'm having a poor time trying to edit an existing MSWord document using the
Win32::OLE module.

I can read the BuiltInDocumentProperties just fine, and count the number of
tables and paragraphs and other such simple things, but I can't get the hang
of translating the examples in the online VB help into perl.

For example, doing a search-replace function would be useful, as would
italicising or bolding a range. I suspect most of my problems come from not
getting my head around ranges, being a bear of little brain.

If anyone can push me in the right direction, either here or pointing me to
a URL, that would be fly.

Thanks in advance

David




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

Date: Thu, 29 Apr 1999 15:17:15 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Win95/98 file locking
Message-Id: <3728DA6B.99B1B068@mail.cor.epa.gov>

Scott McMahan wrote:
> 
> Collin Starkweather (collin.starkweather@colorado.edu) wrote:
> 
> > Testing seems to indicate that flock does not work in Win95/98.  Is
> > there a way to lock a file in Win95/98 that I am unaware of?
> 
> Not from Perl. The Win32 locking is done as part of the CreateFile
> call, and you can't lock a file after it is opened. The
> open/flock UNIX paradigm doesn't port.

But you can still flock() on many other systems.  Try telling a
VMS programmer he can't do file-locking because his system doesn't
have the unix paradigm.  For that matter, you can flock() in NT.
It's not the unix open/flock paradigm that's the issue.  Perl 
on other systems should adapt transparently to those systems'
file locking systems.. as it does on NT, and as it doesn't quite
do on VMS.

David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

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

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