[8180] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1798 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 3 14:12:10 1998

Date: Tue, 3 Feb 98 11:00:34 -0800
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, 3 Feb 1998     Volume: 8 Number: 1798

Today's topics:
    Re: @INC points to nonexisting directories (Gurusamy Sarathy)
    Re: [perl] accept a char at a time without.. <zenin@best.com>
    Re: can variables be generated on the fly (Earl Hood)
    Re: Converting ISO-8859-1 to IBM DOS-ASCII (PC8) <Russell_Schulz@locutus.ofB.ORG>
    Re: Email Perl script on NT alpha server (Jim Michael)
    Re: Error with analysis of system () return value on Pe <jdporter@min.net>
    Re: Error with analysis of system () return value on Pe <jdporter@min.net>
        Help - need telnet client in perl <richard.karon@ps.net>
        Help on Perl on Win32 with ODBC32 <asokol@jhancock.com>
        How write to a file using "format" & "write" ? <j.garcia@lmco.com>
        I am female, blonde and stupid! <dont@mailmehere.com>
    Re: Including a newline in replacement text (Tom Grydeland)
        m/pattern/o  --  when to use? (Thomas L. Shinnick)
    Re: Need help with editing @INC peter.edlund@capgemini.se
        PERL2EXE <Lakshmanan.Suryanarayanan@MCI.COM>
    Re: recreating sed with perl <mattias.lonnqvist@uidesign.se>
    Re: recursive regex? (Ilya Zakharevich)
        Redesigning the Win32::IPC modules (Mutex,Semaphore,Cha (Christopher J. Madsen)
    Re: Some Questions Regarding Error Messages Generated b lvirden@cas.org
    Re: Survival Of perl <zenin@best.com>
    Re: Tech writer lifts burden from programmers (Michael)
    Re: Time measurements <freter@freter.com>
    Re: TYP21D (was: substitute...) (Tom Grydeland)
    Re: TYP21D (was: substitute...) (Dave Till)
    Re: Win32: Any scripts to shut down all services? (Earl Hood)
    Re: Year 2000 (Y2K) Compliance <merlyn@stonehenge.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 3 Feb 1998 18:47:30 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: @INC points to nonexisting directories
Message-Id: <6b7oo2$j6i@srvr1.engin.umich.edu>

  [ mailed and posted ]

In article <6b61l3$4vc$1@msunews.cl.msu.edu>,
Richard Hensh <hensh@math.msu.edu> wrote:
>Typing the command:
>perl -e "print \"@INC\n\"" returns
>g:\perl5004\lib\site g:\perl5004\lib c:\perl\lib c:\perl\lib\site
>c:\perl\lib\site .
>
>The first two paths are correct but the last three don't even exist on my
>machine.  I've searched through the doc's and some older threads (in this
>and related newsgroups) for help but I have not run across any tips about
>how to %permanently% correct this.

Since the spurious directories don't exist, they can't possibly hurt you.
Just try and ignore them.  Perl will.

If you're interested in your permanent solution, get a C compiler
and compile 5.004_04.

In 5.004_57, there are no superfluous hardcoded paths.

 - Sarathy.
   gsar@umich.edu


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

Date: 3 Feb 1998 17:26:30 GMT
From: Zenin <zenin@best.com>
Subject: Re: [perl] accept a char at a time without..
Message-Id: <886527076.883319@thrush.omix.com>

wakaranai <khoohuit@iscs.nus.edu.sg> wrote:
: 	how do i accept a char input without having to press the
: 	enter key in perl?

	RTFFAQ

	http://language.perl.com/

-- 
-Zenin
 zenin@best.com


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

Date: 3 Feb 1998 16:46:07 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: can variables be generated on the fly
Message-Id: <6b7hkf$r6t@news.service.uci.edu>

In article <6auann$h8c$2@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:

>:Why? There's nothing in the New Testament aka Programming Perl that calls
>:symbolic references depreciated. Hard references are probably better, but
>:symbolic references are convenient, logical and effective. And they act
>:just as you would expect them to.
>
>Oh?  Did you ever realize that they only work on global variables.
>This is virtually useless.

Maybe for variables, but can be handy for subroutines.  For many of the
cases where references are needed, soft references are not needed.
However, they do have there uses, especially when obtaining a reference
to an object can be quite troublesome if you restict your self to hard
references only.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: Tue, 3 Feb 1998 12:27:57 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: Converting ISO-8859-1 to IBM DOS-ASCII (PC8)
Message-Id: <19980203.122757.0y9.rnr.w164w@locutus.ofB.ORG>

Kari Marttila <Kari.Marttila.@tietogroup.com> writes:

> Does anybody know if there is a script or a module that knows how to
> convert ISO-8859-1 text (I believe this is the character set used in
> Windows) to IBM DOS-ASCII (PC8)?

I assume GNU recode will do this.  but if you're desperate for a pure
perl solution, it's just one big ugly tr.

> Kari.Marttila@tietogroup.com

didn't match the (slightly illegal) From: header.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: Tue, 3 Feb 1998 17:57:51 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Email Perl script on NT alpha server
Message-Id: <genepoolEntDwF.4zv@netcom.com>

d2dcleh@fre.fsu.umd.edu wrote:
: I currently created a form through html and I am using a perl script to email 
: the form.  The problem is when I send the form nothing happens, I just get the 

http://www.dejanews.com - search on 'perl nt (mail or email or sendmail)'


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

Date: Tue, 03 Feb 1998 13:13:25 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Error with analysis of system () return value on Perl book page 230
Message-Id: <34D75E45.3CD1@min.net>

I blathered incoherently:
>
> 'elsif ($rc > 0x80) {'  , that should be 0x100, not 0x80.

Rather, 0xFF, not 0x100.
Or, ($rc >= 0x100).
Or, ($rc & 0xFF00).

John Porter


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

Date: Tue, 03 Feb 1998 13:32:45 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Error with analysis of system () return value on Perl book page 230
Message-Id: <34D762CD.43BA@min.net>

Michael Wang wrote:
> 
> Chip Salzenberg <chip@pobox.com> wrote:
> >According to jdporter@min.net:
> >>So if the return value was 0x88, that's 0x0088; the low byte is not
> >>zero, so ignore the high byte.
> >
> >You have that backwards, I'm afraid.  Check the *high* byte first.
> >If it's zero, then the program exited normally, and the low byte
> >is the exit code.  If the high byte isn't zero, then it represents
> >the reason why the program died -- typically a signal number.
> 
> According to my code, which is copied from solaris <sys/wait.h>,
> I have to say jdporter got it right and Chip Salzenberg got it backwards.
> Is there a different kind of machine? I do not know.

I'm tellin' ya, man -- if Chip can get confused on this issue,
lesser mortals can be forgiven. . .

John Porter
"There is not one good among us; no, not even one."


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

Date: Tue, 03 Feb 1998 11:12:54 -0600
From: Richard Karon <richard.karon@ps.net>
Subject: Help - need telnet client in perl
Message-Id: <34D75015.2E68@ps.net>

Does anyone have a telnet client in perl that allows both interactive
and batch modes?

tia

Richard Karon
richard.karon@ps.net


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

Date: 3 Feb 1998 17:44:47 GMT
From: "Alex Sokol" <asokol@jhancock.com>
Subject: Help on Perl on Win32 with ODBC32
Message-Id: <01bd30cb$6b3c9a30$190d47a5@rasokol>

I just installed Perl 5 Win32 by ActivateState, build 315 and
ODBC32 version 970208 to connect to my MS SQL server.

I use "use Win32::ODBC"

when i start up my script i get an error (text is not exact):
"Can not locate module Win32/ODBC.pm"

i tried to use "use lib ..." and unshift @INC with no luck,
including coping ODBC.pm into Perl library directory.

Any ideas what's wrong with my environment (other then
DB code everything else works just fine).

Thanks,
-- 
Alex Sokol
John Hancock Mutual Life
Retail Group, Information Systems


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

Date: Tue, 03 Feb 1998 11:44:16 -0700
From: Joey Garcia <j.garcia@lmco.com>
Subject: How write to a file using "format" & "write" ?
Message-Id: <34D76580.CA4DD97E@lmco.com>

I want to mail a formatted report and I am using the "format" and
"write" command, but that outputs the data to the STDOUT.  How can I
have it write to a file for emailing?  Please be specific, thanks!

Joey G.



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

Date: Tue, 03 Feb 1998 19:44:24 +0100
From: Kati Gaebler <dont@mailmehere.com>
Subject: I am female, blonde and stupid!
Message-Id: <34D76587.10D810C2@mailmehere.com>

Hello,

I copied a pretty nifty address
book from a very good CUT-N-PASTE
Javascript Site www.infohiway.com.

Could someone help me improve this
script adding some Perl functions.

I placed a slightly modified Demo
and the source code of this address
book at the Internet location:
www.mikediver.com/tests/address-book.html

The Javascript works very well
as it is but in order to add new entries
one would obviously need the use of
an editor and time-wasting FTP
procedure. I thought this could
be done alot better with a Web
based form and Perl script
that writes new address entries
directly on the Javascript file.

The Perl script would of course
need to recognise the alphabetical
input of at least the first title
character, then place the new
entry under the right section of
the Javascript, whilst ignoring
strings such as "The". An option
to modify and delete an entry
would also be good - for example
a link from the title of each
address entry could open an editor 
form, with the text of that entry preset, 
giving the options of DELETING, or
SUBMIT modifications and overwriting
the existing entry.

Perhaps the script should disallow
the possibility of entering identical
titles and prevent the DELETE function from
erasing multiply entries of same title.

I do mostly HTML and graphic work. I
have just begun learning this Perl stuff
but find it more than a little complicated
to pick up the basics of this great
language..

I would really appreciate it if someone
give me some hints how to make this script work
and maybe help me make it.

If you chose to reply to this newsgroup, 
please also CC to me at kati@purestar.com

Thank You

Kati


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

Date: 3 Feb 1998 17:00:37 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Including a newline in replacement text
Message-Id: <slrn6dej9l.ppa.Tom.Grydeland@mitra.phys.uit.no>

On Tue, 03 Feb 1998 10:21:42 -0600,
Erik <erik@peak.mrc.montana.edu> wrote:

> Here's the code:
> 
> $from=^Description:
> $To=Identification Information:\n\tCitation:\n\t\tTitle:

No it's not.  That doesn't parse.


> but it comes out like this:
> Identification Information:\n\tCitation:\n\t\tTitle:

Try finding out the difference between single-quoted and double-quoted
strings.  man perldata is a good place to start.

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


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

Date: Tue, 03 Feb 1998 11:37:59 GMT
From: tshinnic@io.com.mapSoN (Thomas L. Shinnick)
Subject: m/pattern/o  --  when to use?
Message-Id: <34d6ffab.48025366@news.io.com>

perlre and elsewhere mentions the /o modifier to m// and s///, with
positive words about efficiency!  Specifically:
    PATTERN may contain variables, which will be interpolated (and the 
    pattern recompiled) every time the pattern search is evaluated.  If
    you want such a pattern to be compiled only once, add a /o after the
    trailing delimiter. This avoids expensive run-time recompilations, 
    and is useful when the value you are interpolating won't change over
    the life of the script.

Does this mean that /o is useful _only_ when the pattern contains 
interpolated variables?  Thus m/RTFM/o is a waste of typing?
As is this posting? :<(}


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

Date: 3 Feb 1998 18:44:24 GMT
From: peter.edlund@capgemini.se
Subject: Re: Need help with editing @INC
Message-Id: <6b7oi8$bb6$1@news.capgemini.se>

>I can see "internet.pll" in that path but can't figure out why Perl thinks it's
>not there...  someone suggested I edit the @INC and push the info...

try 'unshift (@INC, "/your/directory/where/ever/it/is");'

that'll put your directory on the top of @INC

//peter.
-- 
-------------------------
Peter Edlund
UNIX development engineer
Cap Gemini
peter.edlund@capgemini.se


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

Date: Tue, 03 Feb 1998 18:22:31 GMT
From: Lakshmanan Suryanarayanan <Lakshmanan.Suryanarayanan@MCI.COM>
Subject: PERL2EXE
Message-Id: <34D75F38.1D54@MCI.COM>

Path: news.internetMCI.com!not-for-mail
Message-ID: <34D74DDC.4B0D@MCI.COM>
From: Lakshmanan Suryanarayanan <Lakshmanan.Suryanarayanan@MCI.COM>
Organization: MCI
X-Mailer: Mozilla 3.01Gold (WinNT; I)
MIME-Version: 1.0
Newsgroups: comp.lang.perl
Subject: PERL2EXE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Date: Tue, 03 Feb 1998 17:08:30 GMT
NNTP-Posting-Host: 166.41.230.106
NNTP-Posting-Date: Tue, 03 Feb 1998 12:08:30 EST
Xref: news.internetMCI.com comp.lang.perl:8124

Hi all,
  Anybody know where i could get  perl2exe for perl binary version
5.004.02 ?

TIA
Lakshmanan



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

Date: Tue, 03 Feb 1998 18:18:58 +0100
From: "Mattias Lvnnqvist" <mattias.lonnqvist@uidesign.se>
Subject: Re: recreating sed with perl
Message-Id: <34D75182.F4DB08A0@uidesign.se>



michael_moore@idx.com wrote:

> Hi.  I'm looking to recreate the Unix sed functionallity in perl on a
> win32 system.  Before I reinvent the whell, I was wondering if anyone
> else has already done this and if they'd be willing to share the code
> with me.
>
> Thanks,
> Mike


Umm, you are aware Sed exists for windows already? Its - if I remember
correctly - part of the Cygnus GnuWIN32 distribution.

/Mattias


--
* I've stopped faking my email, that is NOT an invitation to spam *
* Mattias Lonnqvist  * M. Sc. C. Sc. , Software consultant        *
* Main coder MiT     * http://www.envy.com/~tyme                  *
* c64 addict         * http://www.ctrl-c.liu.se/~malo/            *
*       -----> I speak for myself, and myself only ! <-----       *




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

Date: 3 Feb 1998 18:21:01 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: recursive regex?
Message-Id: <6b7n6d$mj2$2@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Richard Caley 
<spt@cstr.ed.ac.uk>],
who wrote in article <eyhoh0ox0w9.fsf@liddell.cstr.ed.ac.uk>:
> In article <6b59qk$ori$1@cyprus.atlantic.net>, Chip Salzenberg (cs) writes:
> 
> cs> Actually, just such a thing is under active design work even as we
> cs> type at each other here.  Probably won't be in 5.005, but you might
> cs> expect to see it in 5.006.
> 
> Could I put in a vote for a readable syntax. extending the current
> regex syntax is getting silly. Something verbose and understandable
> would be a godsend.

I already sent a patch which makes it possible (I think it will not
come in 5.005, though).  You will have a possibility to do
     
     use RE::COBOLish;
     /literal a several times/;

instead of 
     /a+/;

as far as you have

     package RE::COBOLish;

     sub cobolish_to_re { 
	 my $txt = shift;
	 $txt =~ s/literal a several times/a+/;		# or somesuch
	 return $txt;
     }
     use constants 're' => \&cobolish_to_re;

Ilya


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

Date: 03 Feb 1998 11:52:29 -0600
From: ac608@yfn.ysu.edu (Christopher J. Madsen)
Subject: Redesigning the Win32::IPC modules (Mutex,Semaphore,ChangeNotify)
Message-Id: <uiuqwinj6.fsf@yfn.ysu.edu>

[I'm working with "standard" perl 5.004_04 and libwin32 0.09.]

Recently, I wanted to use Win32 event objects in Perl.  There wasn't a
Win32::Event module, so I just copied Win32::Mutex and made a few
quick changes.

While doing this, I discovered that the Win32::IPC modules are pretty
strange.

For example, Win32::IPC::WaitForMultipleObjects (in the libwin32
distribution) is completely broken.  Its first argument must be an
array reference, but the code that checks that will accept any
reference EXCEPT an array reference.  So, it will never work, but it
may very well crash Perl.

WaitForMultipleObjects is broken in other ways, too.  It erases the
array of objects you pass it (for no good reason), and it won't tell
you which object ended the wait.

There are some other weird things about the IPC modules.  For
instance, the Wait function returns true if the wait was unsuccessful
(eg, it timed out).  It would be more Perl-like if this were reversed,
but it would break all existing code that checked the status.
(WaitForMultipleObjects, on the other hand, returns false if the wait
was unsuccessful (or it would if it worked at all).)

After discussing this with Gurusamy Sarathy, It occurred to me that
all the AS functions have capitalized names.  So, we could create a
new interface using lowercase function names (which are more Perlish)
and write compatibility functions with the old names that preserve the
weird behavior.  Fortunately, there aren't a lot of functions in the
IPC modules.

I came up with the following redesign.

NOTE: One more improvement would be to improve the type checking.
Right now, all classes derived from Win32::IPC also derive from the
same C++ class.  The class names are hard coded in Win32::IPC.
Suggestions for improving this are welcome.

Please mail a copy of any followups to me, as our news server has been
a bit unreliable lately.  (2 drives died last week.)

----------------------------------------------------------------------
Win32::IPC

wait_all(@objs, [$timeout])
wait_any(@objs, [$timeout])
  These replace WaitForMultipleObjects.  They'll be functions, but
  they could accept method syntax as well.  I can't decide if that's a
  good idea.
    Return value:
      Positive number indicates object that signalled us (1 - scalar @objs)
      0 means timeout or error
      Negative number means WAIT_ABANDONED (-1 - -scalar @objs)

$obj->wait([$timeout])
  Wait for a single object
  Returns 1 (WAIT_OBJECT_0), 0 (timeout), or -1 (WAIT_ABANDONED)

----------------------------------------------------------------------
Win32::ChangeNotify

Win32::ChangeNotify->new($path, $subtree, $filter)
$change->reset
  Replaces FindNext

----------------------------------------------------------------------
Win32::Event

Win32::Event->new([$manual, [$initial, [$name]]])
Win32::Event->open($name)
$event->pulse
$event->set
$event->reset

----------------------------------------------------------------------
Win32::Mutex

Win32::Mutex->new([$mine, [$name]])
Win32::Mutex->open($name)
$mutex->release

----------------------------------------------------------------------
Win32::Semaphore

Win32::Semaphore->new($initial, $maximum, [$name])
Win32::Semaphore->open($name)
$semaphore->release([$increment, [\$previous]])
  $increment defaults to 1

-- 
Chris Madsen        chris_madsen@geocities.com       ac608@yfn.ysu.edu
 ------- http://www.geocities.com/SiliconValley/Heights/3222/ -------


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

Date: 3 Feb 1998 17:27:42 GMT
From: lvirden@cas.org
Subject: Re: Some Questions Regarding Error Messages Generated by the -w switch
Message-Id: <6b7k2e$nik$1@srv38s4u.cas.org>


According to V. Chandrasekhar <vchandra@mail.delcoelect.com>:
:main resource. I am aware of perlfaq1 to perlfaq9 - I should get into
:the habit of spending more time with them. (By the way, do people use
:these online mostly or do they print them out and use as a printed
:reference ? I work on a unix system. I tried a
:
:man perlfaq9 > file9
:
:There are unprintable characters in the file. A couple of years
:ago, I remember jumping through some hoops to print man pages
:without these characters.) I am very interested in acquiring 

Actually, getting output is pretty simple these days.  If you have a
postscript printer, you can use the pod/roffitall script that comes
with the Perl source.   If you don't, and want a nice vanilla output,
look into pod/pod2text, which should get you going.  Oh - in
the pod directory you also can find pod2html and pod2latex, in case
you want to use these as the basis of creating formatted output.

If you poke around on <URL:http://cpan.perl.org/> or one of the other
CPAN archives, you will find other pod2* commands that will translate
into Windows HLP formats and perhaps even FrameMaker or PDF output.

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


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

Date: 3 Feb 1998 17:25:11 GMT
From: Zenin <zenin@best.com>
Subject: Re: Survival Of perl
Message-Id: <886526998.569612@thrush.omix.com>

Chip Salzenberg <chip@mail.atlantic.net> wrote:
: Well, even then, you could run Linux on your Sun.
	>snip<

	<shutters> :-)

-- 
-Zenin
 zenin@best.com


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

Date: 3 Feb 1998 17:34:56 GMT
From: mike@paperclip.temple.edu (Michael)
Subject: Re: Tech writer lifts burden from programmers
Message-Id: <6b7kg0$61c$1@cronkite.ocis.temple.edu>

Cliff High (chigh@vallier.com) wrote:

: In article <68u4nd$7k$1@mainsrv.main.nc.us>, scott@softbase.com says...
: >
: >This issue, like the command not to ever split infinitives, is mostly
: >something invented by style guide writers that wanted more stuff to pad
: >out their books. There's no particular reason for it. "That" can
: >apply to people as well, and often sounds more natural.

: Bullshit. That is not used in refering to people or other 'personified' 
: elements 
: within the writing. Your simplistic view that the that use rules originate 
: with style 
: guide authors betrays a lack of understanding of the grammar of the english 
: language. 
: That attitude (please note that we are not elevating the attitude to the state 

Learn to keep your ramblings within 80 columns and THEN start a pointless
argument on usenet with an honest person trying to help the free software
movement.


I'm out,

M.

Michael Jastremski
michaelsjunkmail@westphila.net




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

Date: Tue, 03 Feb 1998 17:55:37 GMT
From: Craig Freter <freter@freter.com>
To: Imran Hussain <hussain_imran@jpmorgan.com>
Subject: Re: Time measurements
Message-Id: <34D75A51.3533@freter.com>

Imran,

> I need to extract and mathematically (subtract) manipulate times from a
> text file which are stored as:
> 
> 27/01/98 23:45:06       #i.e: date & time
> 
> 28/01/98 14:20:41
> 
> Is there a straight forward way in Perl of finding the difference in
> minutes and perhaps converting to hours.

Here's the straight forward way.

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

use strict;
use Time::Local;

my @time_ary;
while (<>) {
    my ($date, $time) = split;
    my ($day, $mon, $year) = split(/\//, $date);
    my ($hour, $min, $sec) = split(/:/, $time);
    push @time_ary, timelocal($sec, $min, $hour, $day, --$mon, $year);
}

my $delta_sec = $time_ary[1] - $time_ary[0];
my $delta_min = $delta_sec / 60;
my $delta_hr = $delta_min / 60;

print "Delta Seconds = $delta_sec\n";
print "Delta Minutes = $delta_min\n";
print "Delta Hours = $delta_hr\n";

-- 
Craig Freter    <freter@freter.com>   <http://www.freter.com>
PGP fingerprint 61 A5 E2 51 F5 AC 9D 79 DD 15 56 90 F2 0A 97 25
Axis Data Management  <http://www.admc.com>


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

Date: 3 Feb 1998 16:45:51 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: TYP21D (was: substitute...)
Message-Id: <slrn6deidv.ppa.Tom.Grydeland@mitra.phys.uit.no>

On 2 Feb 1998 15:46:02 -0500,
Dave Till <davet@angel.uunet.ca> wrote:

> But your example does print 3 (albeit with a warning).  Isn't that what
> I just said?

Yes, that's what you said.  No, that's not what it does.  The first one
does *not* print a warning, which was my point.

Since the incrementation of undefined variables (taken to be zero) is
common in idiomatic constructs like

    @uniq = grep {!$seen{$_}++} @list;

this is explicitly *allowed* under -w.

To recap:


% perl -wle 'print $a++'		# increment; no warning
0
% perl -wle 'print $a+=1'		# stepwise increment; no warning
1
% perl -wle 'print $a+1'		# operand in addition; warning
Use of uninitialized value at -e line 1.
1
% 


> Hairsplittingly yours, :-)

Likewise :-)

> --Dave

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


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

Date: 3 Feb 1998 12:40:02 -0500
From: davet@angel.uunet.ca (Dave Till)
Subject: Re: TYP21D (was: substitute...)
Message-Id: <6b7kpi$kje@angel.uunet.ca>

In article <slrn6deidv.ppa.Tom.Grydeland@mitra.phys.uit.no>,
Tom Grydeland <Tom.Grydeland@phys.uit.no> wrote:
>On 2 Feb 1998 15:46:02 -0500,
>Dave Till <davet@angel.uunet.ca> wrote:
>
>> But your example does print 3 (albeit with a warning).  Isn't that what
>> I just said?
>
>Yes, that's what you said.  No, that's not what it does.  The first one
>does *not* print a warning, which was my point.
>
>Since the incrementation of undefined variables (taken to be zero) is
>common in idiomatic constructs like
>
>    @uniq = grep {!$seen{$_}++} @list;
>
>this is explicitly *allowed* under -w.

Okay, point noted.  Cool -- a "grandfather clause" for a warning message.
The joys of an evolving language. :-)

And because -w will flag variables that are used only once,
almost all typos in constructs like "$var++" will be caught, I suppose.

I suppose the worst-case is something like this:

	$myvar = 1;
	while ($myvar < 10) {
		print ("hello there\n");
		$myva++;
	}
	print ("$myva\n");

This program sails right through -w.  (Obviously, this is a
contrived example -- but a larger program with multiple nested
loops might get tripped up by this.)

Since there are zillions of programmers using incremented undefined
variables who probably don't want them flagged by -w, I suppose
there's no way to please everybody in this case.


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

Date: 3 Feb 1998 17:02:51 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Win32: Any scripts to shut down all services?
Message-Id: <6b7ijr$rnm@news.service.uci.edu>

In article <6atgqn$659$2@nz12.rz.uni-karlsruhe.de>,
Marc Haber <Marc.Haber-usenet@gmx.de> wrote:
>Hi!
>
>Did anyone write a script that shuts down all services on a Windows NT
>machine? Any hints will be appreciated.

If using the Activeware/ActiveState/whatever it is called these days,
there is a Win32::Service module.  The docs are pretty weak, but should
be enough to get what you need.  There is a routine (cannot remember
name off-hand) you can call to get all the services defined on an NT
system.  Then there is another, Win32::Service::StopService, to stop a
service.  There is also a Win32::Service::GetStatus to query the status
of a service.

Note, you may need to run the program you write with admin privledges.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: 03 Feb 1998 09:52:26 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: billl@ctgusa.com
Subject: Re: Year 2000 (Y2K) Compliance
Message-Id: <8cafc8pr5h.fsf@gadget.cscaper.com>


(There is *no* comp.lang.perl group.  Hasn't been for 2 years.  And
comp.lang.perl was never made Y2K compliant.)

>>>>> "Bill" == Bill  <billl@ctgusa.com> writes:

Bill> Could someone guide me to any information or discussion on
Bill> Perl's Year 2000 compliance? Got a Government contract and they
Bill> are real concerned about Year 2000 (Y2K) compliance and I really
Bill> want to assure them about Perl.

Perl5 itself seems to have no known Y2K problems, although code written with
Perl5 can certainly be non-Y2K.  Check your applications.

HOWEVER, There are no known plans to make Perl4 Y2K compliant.  Don't
use Perl4.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 209 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

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

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