[12902] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 312 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 30 12:07:24 1999

Date: Fri, 30 Jul 1999 09:05:27 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 30 Jul 1999     Volume: 9 Number: 312

Today's topics:
    Re: a regular expression to match both upper and lower  <jrennie@mitre.org>
    Re: Filehandle: append and tee at the same time <tchrist@mox.perl.com>
    Re: framekeeper.pl <tchrist@mox.perl.com>
        how good is fork() ? (Ryan Ngi)
    Re: how good is fork() ? <tchrist@mox.perl.com>
    Re: how good is fork() ? (Walter Tice USG)
    Re: how good is fork() ? <garethr@cre.canon.co.uk>
    Re: How to copy a file to another name ? <ron_savage@non-hp-australia-om5.om.hp.com>
    Re: How to determine a date in the past (Abigail)
    Re: How to determine a date in the past <tchrist@mox.perl.com>
    Re: How to trim a String <uri@sysarch.com>
    Re: HTML - perl timeout ? <ndebu@india.hp.com>
    Re: is process still running? (Anno Siegel)
        jpegsize.c (was Re: Getting Height and Width of GIF/JPE <rolf@parallax.co.uk>
        Net::SNMP unabel to $session->get_table <john@hendigital.com.au>
        One File to Handle all the Variations of a Form (Anno Siegel)
    Re: OOP question. (Greg Bacon)
    Re: OOP question. <jcreed@cyclone.jprc.com>
        parallel search <hykit@jps.net>
    Re: parameter doesn't show up <tchrist@mox.perl.com>
        perl IP to OS mapping help <ffr200@my-deja.com>
    Re: Perl Mongers (I.J. Garlick)
    Re: Perl Mongers <gellyfish@gellyfish.com>
    Re: Possible to Change Password for Services? <sweather@fastenal.com>
    Re: Printing lines BTW two strings in file (NOT!) <uri@sysarch.com>
        RE: Removing special characters in perl <tmujak@wcom.co.uk>
    Re: system function broken - ActivePerl - build 517 or  (Michael Allan)
        tom banned me again (was Re: How to trim a String) <uri@sysarch.com>
    Re: variation on  /^=/ .. /^=cut/ (Sean McAfee)
        when writing to data file, last letter is missing vmacri@my-deja.com
        Win32 Perl 'alarm()' substitution? <namekuji@hotmail.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 30 Jul 1999 10:29:01 -0400
From: "Jason D. Rennie" <jrennie@mitre.org>
To: Keith Salomon <salomon@imds.com>
Subject: Re: a regular expression to match both upper and lower case
Message-Id: <37A1B6AD.8B80E158@mitre.org>

Keith Salomon wrote:
> 
> $teststring =~ /^computer administration$/;
> 
> I know this matches the case-sensitive exact match.
> 
> I'd like a "regular expression" that matches either upper or
> lower case letter.

Try

$teststring =~ m/computer administration/i;

(note the 'i' at the end of the regex)
Are you sure that you want the '^' and '$' at either end of the regex? 
These will cause your regex to match lines that contain ONLY "comPuTer
AdmInIstraTion".  Extra characters before or after computer
administration will cause your regex to not match.  The regex I've
listed will match any line that contains the string "computer
administration". (w/ no regard for case)

Btw, if you plan on doing more with regular expressions, I would
recommend purchasing an O'Reilly book.  The second chapter of
"Programming Perl" (second edition) contains lots of useful information
about them.  There is also a good O'Reilly book specifically written
about Regular Expressions.  It shows lots of examples in perl and would 
be very helpful to you if you continue to use regular expressions.

Jason Rennie
781-271-7281
jrennie@mitre.org
http://www.andrew.cmu.edu/~jr6b/


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

Date: 30 Jul 1999 07:18:42 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Filehandle: append and tee at the same time
Message-Id: <37a1a632@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, eric@fruitcom.com writes:
:I am having trouble creating a filehandle that can append to a file and tee
:at the same time.  I can do each thing seperately but not together.
:
:This is what did not work for me:
:open  LOG, "| tee >>/d/u/log/$date"
:this did the tee nicely (i.e output to STDOUT and the file)
:open  LOG, "| tee /d/u/log/"
:
:May I do both at the same time?

% man tee

TEE(1)          OpenBSD Reference Manual             TEE(1)

NAME
     tee - pipe fitting

SYNOPSIS
     tee [-ai] [file ...]

DESCRIPTION
     The tee utility copies standard input to standard output, making
     a copy in zero or more files.  The output is unbuffered.

     The following options are available:

     -a      Append the output to the files rather than overwriting them.

     -i      Ignore the SIGINT signal.

     The following operands are available:

     file  A pathname of an output file.

     The tee utility takes the default action for all signals, except
     in the event of the -i option.

     The tee utility exits 0 on success, and >0 if an error occurs.

STANDARDS
     The tee function is expected to be POSIX IEEE Std1003.2 (``POSIX.2'')
     compatible.
-- 
    "It's ironic that you would use a language as large as English to express
    so small a thought."
    	--Larry Wall


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

Date: 30 Jul 1999 07:16:01 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: framekeeper.pl
Message-Id: <37a1a591@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Benjamin Dälken" <benjamin@daelken.com> writes:
:does anyone now where i can get the script "framekeeper.pl" ?

Did you mean "library names 'framekeeper.pl'" or did you mean "program
named 'framekeeper'"? 

And are you seriously thinking thinking that this is the best way to find 
it?  Do you post to comp.lang.c when you're looking for a C program?

--tom
-- 
I have a different view of the world.  --Andrew Hume. Show&Tell '87


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

Date: Fri, 30 Jul 1999 13:51:10 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: how good is fork() ?
Message-Id: <37a1acf3.20024157@news.inet.co.th>

fork()

i know how to implement it..... 
but don't know how good it is...

what situation lead us to use fork() ?


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

Date: 30 Jul 1999 08:41:56 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how good is fork() ?
Message-Id: <37a1b9b4@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, ryanngi@hotmail.com (Ryan Ngi) writes:
:fork()
:
:i know how to implement it..... 

Really?  Looked around in the kernel source tree lately?

:but don't know how good it is...
:what situation lead us to use fork() ?

A little old thing called "multitasking".  

--tom
-- 
    "They'll get my perl when they pry it from my cold, dead /usr/local/bin."
	    Randy Futor in  <1992Sep13.175035.5623@tc.fluke.COM>


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

Date: 30 Jul 1999 14:37:13 GMT
From: tice@hunch.zk3.dec.com (Walter Tice USG)
Subject: Re: how good is fork() ?
Message-Id: <7nsdap$moa@zk2nws.zko.dec.com>

In article <37a1acf3.20024157@news.inet.co.th> ryanngi@hotmail.com (Ryan Ngi) writes:
>fork()

>i know how to implement it..... 
>but don't know how good it is...

>what situation lead us to use fork() ?

There are a lot of situations where use of fork is advantageous.
For instance, if you are running a number of reports from a common
or closely related set of data, you can do the unique processing
(manip data, format report, write report) under forks.  A couple
of years back in my first sizeable Perl project, I used about 20
forks which cut process time by a factor of 2.5.  In other projects
I've gotten incremental benefits from fork - anywhere from hardly
worth it - to quite useful.  Why not try it for yourself?

W


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

Date: Fri, 30 Jul 1999 14:38:03 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: ryanngi@hotmail.com (Ryan Ngi)
Subject: Re: how good is fork() ?
Message-Id: <siso66mcdw.fsf@cre.canon.co.uk>

Ryan Ngi <ryanngi@hotmail.com> wrote:
> what situation lead us to use fork() ?

Here's a good article by Tom Christiansen on fork():

   http://www.deja.com/getdoc.xp?AN=495645373&fmt=text

-- 
Gareth Rees


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

Date: Fri, 30 Jul 1999 16:39:00 +1000
From: "Ron Savage" <ron_savage@non-hp-australia-om5.om.hp.com>
Subject: Re: How to copy a file to another name ?
Message-Id: <7nrhn8$qdg$1@ocean.cup.hp.com>

See below

--
Cheers
Bus: rons@hpaco.aus.hp.com
Home: ron@savage.net.au
http://savage.net.au/
Yeong Mo/Director Hana co. <factory@factory.co.kr> wrote in message
news:7noeh8$5m2$1@news1.kornet.net...
> What is this ?
>
> File::Copy

It's the standard Perl way of referring to a Perl module.

In your mind convert File::Copy into File/Copy.pm.

Then search for C:\Perl\Lib\File\Copy.pm if using Windows.

Or, search for something like /usr/local/perl5/5.00503/File/Copy.pm under
Unix.

Now you know File::Copy is shipped with recent Perls.

Then 'use' File::Copy in a program.

#!perl -w
use integer; # Say.
use strict;     # Say.
use File::Copy;
 ...etc...
exit(0);







>
> >> How to copy a file to another name  in same directory ?
> >
> >File::Copy
> >
> >> Now, I want to copy this file to bbb.txt through loading perl script
from
> >> web.
> >> and give the new file chmod 777 permission.
> >
> >you don't really want to do that, do you?  then anyone can read and write
> >that file.
> >
> >--
> >brian d foy
> >CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
> >Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
>
>




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

Date: 30 Jul 1999 09:14:40 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to determine a date in the past
Message-Id: <slrn7q3cpg.glu.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLIX September
MCMXCIII in <URL:news:37a19a1a@cs.colorado.edu>:
//      [courtesy cc of this posting mailed to cited author]
// 
// In comp.lang.perl.misc, abigail@delanet.com writes:
// :Several. The most complete one is Date::Manip. That will let you count
// :back in English, French, Dutch, Swedish, Polish, German, Spanish, and
// :Portuguese, using normal days or business days, and in free form as well!
// 
// Its author always leaves me with those feelings of inadequacy that stem
// from being an uneducated American. :-)


Well, it isn't that the author knows all those languages....



Abigail, who supplied the Dutch part of Date::Manip.
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\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: 30 Jul 1999 08:40:54 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to determine a date in the past
Message-Id: <37a1b976@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    abigail@delanet.com writes:
:// :Several. The most complete one is Date::Manip. That will let you count
:// :back in English, French, Dutch, Swedish, Polish, German, Spanish, and
:// :Portuguese, using normal days or business days, and in free form as well!

:Well, it isn't that the author knows all those languages....

Well, I've never spoken to him in Dutch, Swedish, or Polish, but this
may be more due to own my shortcomings than to his. :-(

:Abigail, who supplied the Dutch part of Date::Manip.

Ah.

--tom
-- 
    [End of diatribe.  We now return you to your regularly scheduled
    programming...]
        --Larry Wall in Configure from the perl distribution


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

Date: 30 Jul 1999 11:13:38 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: How to trim a String
Message-Id: <x7d7xanpb1.fsf@home.sysarch.com>

>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:

  TC>      [courtesy cc of this posting mailed to cited author]
  TC> In comp.lang.perl.misc, 
  TC>     abigail@delanet.com writes:
  TC> :Tom will even bounce your mail if he replies on a reply of a posting
  TC> :made from AOL, and you Cc: him on a reply you make to his posting.

  TC> It checks both the From: and the Reply-To: lines.  It should not
  TC> be checking the In-Reply-To: lines.  I don't see why yours was bounced,
  TC> unless you're sending mail and setting your reply-to to a bad place.

and why was mine bounced recently? i saw something about aol in the
bounce message and i surely don't use that service! unfortunately i did
not keep your bounce. this is being cc'ed to you as a test.

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
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Fri, 30 Jul 1999 15:38:29 +0530
From: Naresh Devnani <ndebu@india.hp.com>
Subject: Re: HTML - perl timeout ?
Message-Id: <37A1799C.CA4CF241@india.hp.com>

Hi,

Its true that Browser timeouts, while its waiting for the server
response. It varies from browser to browser. One solution, which I have
used in my programs is to print "." to keep browser happy !! I don't
know how you can achieve this in your program, but you have to send some
data to browser to keep it waiting for longer times.

I hope it helps.

Regards,
Naresh

Frederick Tant wrote:
> 
> Hello,
> 
> Consider the following perl script :
> 
> ####################################"
> #!/opt/perl5/bin/perl
> 
> $html = "";
> 
> $html .= "Content-type: text/html\n\n"
>          . "<HTML>\n";
> 
> @output  = `CLASSPATH=/home/fred ; export CLASSPATH ; /opt/java/jre/jr
> e/bin/jre agent one /tmp/scriptname.sh`;
> 
> $html .=  $output[0]
>          . "<BR>END"
>          .  "</html>";
> 
> ###########################################
> 
> When I execute the above scripts on the unix commandline I get the
> rigth result in @output[1].
> 
> The line   @output  = `CLASSPATH=/home/fred ; export CLASSPATH ;
> /opt/java/jre/jr e/bin/jre agent one /tmp/scriptname.sh`;  takes about
> 10 seconds.
> 
> When I execute it  in a webbrowser the line is not (?)  executed.
> 
> REMARK : when I use a simple scripts (time < 1 sec) I have no problems
> 
> Have I a problem with a timeout in HTML. Any solution(s) for this ?
> 
> Thanks for your reply !
> 
> FRed


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

Date: 30 Jul 1999 15:01:17 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: is process still running?
Message-Id: <7nsent$3f1$1@lublin.zrz.tu-berlin.de>

Tom Christiansen  <tchrist@mox.perl.com> wrote in comp.lang.perl.misc:

[...]

>or
>
>    ${"it's alive and its uid hasn't changed"} = kill(0, $hispid);
>
>Of course, we're assuming that $hispid is positive here.

We're also assuming that a zombie is alive.  Just a side note.

Anno


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

Date: Fri, 30 Jul 1999 15:31:40 +0100
From: Rolf Howarth <rolf@parallax.co.uk>
To: Wayne Venables <wvenable_net@iname.com>
Subject: jpegsize.c (was Re: Getting Height and Width of GIF/JPEG in PERL?)
Message-Id: <37A1B74C.E428CE76@parallax.co.uk>

On Mon, 26 Jul 1999 16:08:06 GMT  wvenable_net@iname.com (Wayne
Venables) asked:
>  
> Hello everyone,
> 
>     Does anyone have any code to retrieve the height and width of GIF
> and JPEG files?  If no code exists (seems unlikely) does anyone know
> how it could be done in Perl?

I've got some plain vanilla C code that will do just what you want, and
can also be used to dump the blocks that form the innards of JPEG and
GIF files and help you analyse corrupt images. It's small and fast and I
invoke it from Perl CGI scripts using system() or backticks. Take a look
at http://www.squarebox.co.uk/~rolf/download/

-Rolf

(PS. I've copied you by email as your original thread seems to have
taken on a life of its own!)


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

Date: 30 Jul 1999 21:42:51 -0800
From: "John Hennessy" <john@hendigital.com.au>
Subject: Net::SNMP unabel to $session->get_table
Message-Id: <01beda90$f43348a0$f34f39cb@stingray>

I have read through the documentation that comes with Net::SNMP version 2.0
but am still unable to get the "get_table" function to return any data.

Where can I find some sample code or additional documentation to help ?

Thanks


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

Date: 30 Jul 1999 14:03:27 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: One File to Handle all the Variations of a Form
Message-Id: <7nsbbf$3be$1@lublin.zrz.tu-berlin.de>

Thomas McLaughlin <tomatocans@erols.com> wrote in comp.lang.perl.misc:
>
>I am currently working on my first PERL assignment and I need to
>develop an object which contains variations of a particular form.
>Currently, this form is coded individually in each page and each 
>page displays its particular fields from the form.  The objective

[snip]

A deja search has turned up a very similar posting.

Anno


   Article 000093 of traffic.horseless-vehicles.construction
   From: "H Ford" <hford@fordcom.com>
   Sender: "H Ford" <hford@fordcom.com>
   Reply-To: "H Ford" <hford@fordcom.com>
   Subject: Rapid Production of Automobiles
   Newsgroups: traffic.horseless-vehicles.construction
   NNTP-Posting-Host: 6.2.1.3
   Message-ID: <37a0acd3@messenger_doves>
   Date: 29 Jul 1911 15:34:43
   
   Dear Sirs,
   
   I am currently working on a plan to produce automobiles faster
   than has heretofore been possible.  The objective is to have many
   more men working on each model than is customary.  Every worker
   will be trained to perform only one simple task very rapidly.

   However it has turned out infeasible to have more than a dozen
   workers assemble a single vehicle because more will tread on
   each others toes.  If anyone knows a solution to this problem
   it would be much appreciated.  As a newbie in this field I need
   your help badly.  Please reply soon, this is urgent.  Thanks in
   advance.
   
   Henry
   -- 
                _________
               /  ;~~~~~~'\
          ____/   |________\________
         /       :                  '\
        |>   .--.:^^          .--.  _<)
       {____/ .. \___________/ .. \____}
            \ '' /           \ '' /
      hf     '--'             '--'



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

Date: 30 Jul 1999 14:02:20 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: OOP question.
Message-Id: <7nsb9c$n6r$2@info2.uah.edu>

In article <slrn7q2f86.fmt.abigail@alexandra.delanet.com>,
	abigail@delanet.com (Abigail) writes:
: So, let's try to tie @ISA. ;-)

    $abigail->reserve($hell->{'pit'}[6]);  # :-)

Greg
-- 
>I need to programmatically reboot a Windows NT 4.0 server using Perl.
Any command NT has a certain chance to reboot the machine, hasn't it?
    -- Abigail in <7a01hc$lvb$1@client2.news.psi.net>


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

Date: 30 Jul 1999 11:02:25 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: OOP question.
Message-Id: <a1g126rxj2.fsf@cyclone.jprc.com>

abigail@delanet.com (Abigail) writes:
> So, let's try to tie @ISA. ;-)

I couldn't help but wonder what would
happen if @Evil::ISA::ISA itself
were tied into class Evil::ISA:

#!/usr/bin/perl -w 
use strict;

package Evil::ISA;

# (Some of the optional subs are left out..)

sub TIEARRAY {
  my $class = shift;
  bless [], $class;
}

sub FETCH {
  my $self = shift;
  my $index = shift;
  print "FETCH $index\n";
  $self->[$index];
}

sub STORE {
  my $self = shift;
  my $index = shift;
  my $value = shift;
  print "STORE $index=$value\n";
  $self->[$index] = $value;
}

sub FETCHSIZE {
  my $self = shift;
  print "FETCHSIZE\n";
  scalar @$self;
}

sub STORESIZE {
  my $self = shift;
  my $size = shift;
  print "STORESIZE $size\n";
  $#$self = $size + 1;
  $size;
}

sub CLEAR {
  my $self = shift;
  print "CLEAR\n";
  @$self = ();
}

sub EXTEND {
  print "EXTEND\n";
}

package Foo;

sub SHIFT {
  print "SHIFT\n";
  my $self = shift;
  shift @$self;
}

package main;

# First just a mundane tie, as a control.

print "### tie X ###\n";
tie @Evil::ISA::X, 'Evil::ISA';
@Evil::ISA::ISA = ("Foo");
@Evil::ISA::X = ("Foo");
print '@Evil::ISA::ISA is (', join (", ", @Evil::ISA::ISA), ")\n";
print '@Evil::ISA::X is (', join (", ", @Evil::ISA::X), ")\n";
print "shift result: ", shift @Evil::ISA::X, "\n";

# Now tie ISA.

print "### tie ISA ###\n";
tie @Evil::ISA::ISA, 'Evil::ISA';
@Evil::ISA::ISA = ("Foo");
print '@Evil::ISA::ISA is (', join (", ", @Evil::ISA::ISA), ")\n";
print "shift result: ", shift @Evil::ISA::ISA, "\n";

__END__

Which results in

 ### tie X ###
 CLEAR
 EXTEND
 STORE 0=Foo
 @Evil::ISA::ISA is (Foo)
 FETCHSIZE
 FETCH 0
 @Evil::ISA::X is (Foo)
 FETCHSIZE
 SHIFT
 shift result: Foo
 ### tie ISA ###
 CLEAR
 EXTEND
 STORE 0=Foo
 FETCHSIZE
 FETCH 0
 @Evil::ISA::ISA is (Foo)
 FETCHSIZE
 Can't locate object method "SHIFT" via package "Evil::ISA" at
 foo.pl line 72.

So perl isn't going through the tied interface to check ISA?
It's not terribly surprising considering the need for ISA
cacheing...
Still, why doesn't the old value of @Evil::ISA::ISA stick around
after the tie?

---Jason
-- 
 perl    -MTie::Scalar -e'@*=split//,q#  JPuesrtl  aHnaoctkheerr#;  @ISA
  =      ( Tie::StdScalar=>);sub FETCH{local*&=shift;$&+=2;$&  =#;     |
$&%@*;   ( $& ||exit,$*[$&])}tie $_, __PACKAGE__;  Z:print qq#$_#;goto Z'


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

Date: Fri, 30 Jul 1999 06:12:49 -0800
From: Kit <hykit@jps.net>
Subject: parallel search
Message-Id: <300719990612493856%hykit@jps.net>

I am wondering where I can find more information about how to implement
parallel processing or parallel search under PERL.  I am trying to
write a search engine that searches serveral websites in parallel
(simultaneously) and outputs the results into one page.
What command(s) in PERL should I be looking at.  Am I in the right
direction if I start reading more about interprocess communication
(IPC)?  Any help is greatly apreciated.

thanks,
   Kit


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

Date: 30 Jul 1999 07:10:57 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: parameter doesn't show up
Message-Id: <37a1a461@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Maria Zevenhoven" <maria.zevenhoven@kolumbus.fi> writes:
:read(STDIN,$in,$ENV{'CONTENT_LENGTH'});

Nope.  That's wrong.  Use the CGI.pm module or die.

--tom
-- 
"Unix *is* Perl's IDE!"         -- Tom Christiansen


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

Date: Fri, 30 Jul 1999 15:19:36 GMT
From: ffr200 <ffr200@my-deja.com>
Subject: perl IP to OS mapping help
Message-Id: <7nsfpu$ick$1@nnrp1.deja.com>

hello,
  I need to write a perl program that receives an IP address and a
hostname, and is able to return an operating system and OS
information.  Does anyone know how to get an OS from a given IP?  Help
is greatly appreciated.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Fri, 30 Jul 1999 13:22:52 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Perl Mongers
Message-Id: <FFoqI5.Ivz@csc.liv.ac.uk>

In article <7ns4gh$i8m$1@nntp0.reith.bbc.co.uk>,
"James Williamson" <james.williamson@bbc.co.uk> writes:
> I was reading the other day about PerlMongers and was pretty intrigued to
> know if there was a group in London (UK). What sort of people participate in
> these get togethers?

Where? There's a list on either the perl.org site or the link to perl
mongers site I think.

I checked it out once to see if there was one closer to me than London
(since I don't get to the capital much).

Go check out deja.com and search for perl mongers London, should give you
enough info. Plus one of the regular attenders will no doubt post soon :-)

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

Fairy Tale, n.:
        A horror story to prepare children for the newspapers.



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

Date: 30 Jul 1999 15:18:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Mongers
Message-Id: <37a1b430_1@newsread3.dircon.co.uk>

James Williamson <james.williamson@bbc.co.uk> wrote:
> I was reading the other day about PerlMongers and was pretty intrigued to
> know if there was a group in London (UK). What sort of people participate in
> these get togethers?

Ay, ay .... get yourself other to <http://london.pm.org> and find out for
yourself - you'll probably subscribe to the mailling list in time for all
the drunks coming back from the pub ;-}

/J\
-- 
"Michael Ancram, you haven't got a hope in hell of winning the next
election" - Huw Edwards, BBC News


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

Date: Fri, 30 Jul 1999 09:35:18 -0500
From: "Sam Weatherhead" <sweather@fastenal.com>
Subject: Re: Possible to Change Password for Services?
Message-Id: <7nsd74$19q7@enews4.newsguy.com>

Thank you for the code, I'll give that a try.

Sam Weatherhead
Fastenal Company

Dave Roth <xrxoxtxhxdx@xrxoxtxhx.xnxextx> wrote in message
news:dG9o3.60566$AU3.1563918@news2.giganews.com...
> Sam Weatherhead wrote in message <7nq2og$2p55@enews2.newsguy.com>...
> >Can perl change the underlying password that is being used for
> >a service to logon with? If so, what module do you use?
>
>
> This is from Script 1 in our white papger "A Networked Machine
> Management System" on our web site:
>   http://www.roth.net/conference/lisant/1999/
>
> This subroutine takes three parameters (in order):
>   service name, userid, password
>
>
> use Win32;
> use Win32::API;
> use Win32::Service;
> use Win32::Lanman;
>
> sub ConfigService
>

>   my( $Service, $User, $Password ) = @_;
>   my $OpenSCManager = new Win32::API( 'advapi32.dll', 'OpenSCManager',
 P,P,L ], L );
>   my $OpenService = new Win32::API( 'advapi32.dll', 'OpenService',
[ L,P,L ], L );
>   my $CloseServiceHandle = new Win32::API( 'advapi32.dll',
'CloseServiceHandle', [ L ], I );
>   my $SCHandle, $ServiceHandle;
>   my $ServiceString, $UserString, $PasswordString;  my %ServiceStatus;
>   my $UnicodeFiller = "";
>   print "Configuring the $Service service ...\n";
>
>   $Result = Win32::Service::GetStatus( '', $Service, \%ServiceStatus );
>
>   # Service status 1 == Service has stopped
>   $Result = Win32::Service::StopService( '', $Service ) if( 1 !=
$ServiceStatus->{CurrentState} );
>     # Convert the string to UNICODE if needed
>   $UnicodeFiller = "\x00" if( Win32::API::IsUnicode() );
>   ( $ServiceString = $Service ) =~ s/(.)/$1$UnicodeFiller/g;
>   ( $UserString = $User ) =~ s/(.)/$1$UnicodeFiller/g;
>   ( $PasswordString = $Password ) = s/(.)/$1$UnicodeFiller/g;
>   # The flag 0x00F003F requests to open the service manager with full
access
>   if( $SCHandle = $OpenSCManager->Call( 0, 0, 0x000F003F ) )
>   {
>     # The flag 0xC0000000 requests GENERIC_READ and GENERIC_WRITE
>     if( $ServiceHandle = $OpenService->Call( $SCHandle, $ServiceString,
0xC0000000 ) )
>

>         my $ChangeServiceConfig = new Win32::API( 'advapi32.dll',
'ChangeServiceConfig', [ L,L,L,L,P,P,P,P,P,P,P ], I );
>
>         # The 0x00000010 flag represents that the servic
> e will logon as a user account
>         # AND it will create it's own process (not share process space
with
> other services)
>         # The 0xFFFFFFFF flag represents no change to this attribute.
>         # The 0x00000002 flag represents the service is to auto start
>         my $Result = $ChangeServiceConfig->Call( $ServiceHandle,
>                                                  0x00000010,
>                                                  0x00000002,
>                                                  0xFFFFFFFF,
>                                                  0,
>                                                  0,
>                                                  0,
>                                                  0,
>                                                  $UserString,
>                                                  $PasswordString,
>                                                  0 );        if( $Result )
>         {
>             print "Granting the $User account the privilege to logon as a
> service\n";
>
>             # Grant the service account with the privilege to logon as a
> service...
>             $Result = Win32::Lanman::GrantPrivilegeToAccount( '',
> 'SeServiceLogonRight', [$User] );
>             if( ! $Result )
>             {
>                 print "  Could not grant the privilege: ";
>                 print
Win32::FormatMessage( Win32::Lanman::GetLastError() );
>             }
>         }
>         else
>         {
>             print "  Could not modify the '$Service' service: ";
>             print Win32::FormatMessage( Win32::GetLastError() );
>         }
>         $CloseServiceHandle->Call( $ServiceHandle );
>       }
>       else
>       {
>         print "Could not open the '$Service' service: ";
>         print Win32::FormatMessage( Win32::GetLastError() );
>     }
>     $CloseServiceHandle->Call( $SCHandle );
>   }
>   else
>   {
>     print "  Could not open the service manager: ";
>     print Win32::FormatMessage( Win32::GetLastError() );
>   }
>   Win32::Service::StartService( '', $Service );
> }
>
> --
> =================================================================
> Dave Roth                                ...glittering prizes and
> Roth Consulting                      endless compromises, shatter
> <rothd at roth dot net>                 the illusion of integrity
> http://www.roth.net
> Win32, Perl, C++, ODBC, Training
>
> Our latest Perl book is now available:
> "Win32 Perl Programming: The Standard Extensions"
> http://www.roth.net/books/extensions/
>
>
>
>




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

Date: 30 Jul 1999 11:15:41 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Printing lines BTW two strings in file (NOT!)
Message-Id: <x7907ynp7m.fsf@home.sysarch.com>

>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:

  TC>      [courtesy cc of this posting mailed to cited author]
  TC> In comp.lang.perl.misc, 
  TC>     Uri Guttman <uri@sysarch.com> writes:
  TC> :that is better done as:
  TC> :	@eks_file = <EKS_FILE> ;
  TC> :	foreach $line ( @eks_file ) {

  TC> I despise reading that.  Please don't suggest it without
  TC> the mandatory paragraph of disclaimer explaining why it's
  TC> almost always a stupid idea.

i agree with you that is is poor code but the disclaimer should not be
needed. there are times i like to slurp in a file into a list or a
string. not that i would tell newbies to do that. and again in this case
i was fixing bad code and not trying to teach the best way to do
something (and i showed the while loop too).

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
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Fri, 30 Jul 1999 14:52:33 +0100
From: "Mujakporue, Trey" <tmujak@wcom.co.uk>
To: "'comp.lang.perl.misc@list.deja.com'" <comp.lang.perl.misc@list.deja.com>
Subject: RE: Removing special characters in perl
Message-Id: <11020643E71FD311ACAA0008C7C563F3AF2202@gblon1c3ex1.wcom.co.uk>

i think this will work it..
s/\+/ /g;

-----Original Message-----
From: Arne Jamtgaard [mailto:arnej@fc.hp.com]
Sent: 28 July 1999 00:01
To: ryan7879@my-deja.com
Subject: Re: Removing special characters in perl


 Message from the Deja.com forum: 
 comp.lang.perl.misc
 Your subscription is set to individual email delivery

ryan7879@my-deja.com wrote:

> I'm new to Perl and I am having trouble removing a "+" character 
> from a string.  The plus exists because the string has it's value
> submitted from one web page to another, so the blank spaces are url
> encoded.  The following works for letters or combinations of letters,
> but fails on the s/+/ /g; line when a plus sign is involved.  Does
> anyone know how to get around this?

Ryan-

	First, to address your problem, you should read up more 
on regular expressions, _particularly_ special characters and 
how to handle them in a literal context.

	Second, read up on the "foreach" statement and you'll
probably find a more perlish, less c-like way of writing your
code.

foreach (@userwords) {
      $_ = substr($_, 6);
      s/\+/ /g;
      }

Arne



 _____________________________________________________________
 Deja.com: Share what you know. Learn what you don't.
 http://www.deja.com/
 * To modify or remove your subscription, go to
 http://www.deja.com/edit_sub.xp?group=comp.lang.perl.misc
 * Read this thread at
 http://www.deja.com/thread/%3C379E3A1F.1DAC%40fc.hp.com%3E





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

Date: Fri, 30 Jul 1999 15:52:10 GMT
From: mike@zelea.com (Michael Allan)
Subject: Re: system function broken - ActivePerl - build 517 or 518
Message-Id: <MPG.120b9418337b7351989691@news1.on.sympatico.ca>

> I verify the behavior you see under 518 with Windows 95.  I also note that:
> 
> ...
> print system 'start calc.exe';
> ...
> 
> works fine.  I have no idea why the problem occurs.

Thanks. I've posted it as bug # 527 at http://www.activestate.com/.
-- 
Mike Allan



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

Date: 30 Jul 1999 11:31:08 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: tom banned me again (was Re: How to trim a String)
Message-Id: <x76732nohv.fsf_-_@home.sysarch.com>


so i found a bug in a posting from tom. here was that post:

>>>>> "UG" == Uri Guttman <uri@sysarch.com> writes:

>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:

  TC> [courtesy cc of this posting mailed to cited author]
  TC> In comp.lang.perl.misc, 
  TC> Uri Guttman <uri@sysarch.com> writes:
  TC> :>>>>> "FN" == Faisal Nasim <swiftkid@bigfoot.com> writes:
  TC> :  FN> ( local $_ = shift ) =~ s/^\s+|\s+$//gs;
  TC> :	$_[0] =~ s/^\s+|\s+$//g;
  TC> :and no need for the /s as there is no . in the regex.

  TC> But there is a ^ and a $.

  UG> them use /m and not /s which only affects . either i am totally
  UG> off base or you should know that.

he replied to me with no post to the group that is was a bug. so i asked
him why he didn't post as well to acknowledge his bug like so many
others (including myself) have done. it might make him seem more human
to this group. 

i got a reply and then my reply to that was bounced like this:

The original message was received at Fri, 30 Jul 1999 09:21:43 -0600
from sysarch.ne.mediaone.net [24.128.120.203]

   ----- The following addresses had permanent fatal errors -----
"|/home/tchrist/.audit_mail tchrist"
    (expanded from: <tchrist@jhereg.perl.com>)

   ----- Transcript of session follows -----
Unauthorized mail delivery from banned user rejected.
554 "|/home/tchrist/.audit_mail tchrist"... Service unavailable

   ----- Original message follows -----

<heeaders snipped>

>>>>> "TC" == Tom Christiansen <tchrist@jhereg.perl.com> writes:

  TC> fuck you.

aw come on tom, lighten up. you can push me around again at monterey. i
will probably laugh again.

uri


---------

so i am on his shit list again.

oh well, such is life with perl.

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
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Fri, 30 Jul 1999 15:32:38 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: variation on  /^=/ .. /^=cut/
Message-Id: <qAjo3.3264$nB.481992@news.itd.umich.edu>

In article <Pine.SOL.3.96L.990729125053.1976G-100000@unix6.andrew.cmu.edu>,
Keith A Arner  <karner@andrew.cmu.edu> wrote:
>Say I have the following file (line numbers added for discussion
>purposes): 
[snip]

>If I run it through:  while(<>) {print unless /^=/ .. /^=cut/}
>I will get lines 1,7-8.  Great.

>If I run it through:  while(<>) {print if /^=/ .. /^=cut/}
>I will get lines 2-6.  Fine.

>What if I want to print the lines between (but not including) the
>delimiters?  In this example, lines 3-5.  That is, I want the transition
>states of either side of the flip flop to evaluate to false, rather than
>true.

The various other responses you've gotten can be condensed into:

while (<>) { print if (/^=/ .. /^=cut/) =~ /^(?!1$)(?!.*E)./ }

Admittedly, this looks slightly yucky, but at least it's concise.

-- 
Sean McAfee | GS d->-- s+++: a27 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Fri, 30 Jul 1999 15:46:17 GMT
From: vmacri@my-deja.com
Subject: when writing to data file, last letter is missing
Message-Id: <7nshc6$jfh$1@nnrp1.deja.com>

This may be a little vague but,
I've got a script that once a user fills in their info the script writes
it to text file. All the info is put into fields in the text file. My
problem is that everything is written to that file correctly except the
email address. The last letter of that field is always missing. An
example is, if you type in your email as you@yourcompany.com the script
wirtes to the text file as you@yourcompany.co The last letter is always
missing. Then if someone goes in to change their info and re-enters the
info again, then a second letter from the end goes missing.

I am totally lost, can anyone help....Please!!!


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Fri, 30 Jul 1999 08:47:24 -0700
From: "Doug Carter" <namekuji@hotmail.com>
Subject: Win32 Perl 'alarm()' substitution?
Message-Id: <7nshj9$grs@news.dns.microsoft.com>

I've been beating my head against the wall trying to figure out a
substitution for the alarm() function. I know it can be done since the
LWP::UserAgent module supports a timeout. I can't find in the code where
it's implemented. I really need to be able to timeout functions in case they
hang. Sleep() won't work since that hangs the process for x amount of time.
If not for the lack of a fork() function, I would start another thread and
have it act as the timer. Has anyone got any clues? I've tried using the
POSIX module, but that didn't work. Do I have to make direct C function
calls? Or some direct call to the Win32API?

Desperate,
DJ




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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 312
*************************************


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