[13795] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1205 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 27 23:52:53 1999

Date: Wed, 27 Oct 1999 20:52:42 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941082762-v9-i1205@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 27 Oct 1999     Volume: 9 Number: 1205

Today's topics:
        Why does this simple regexp not work? <ralawrence@my-deja.com>
    Re: Why does this simple regexp not work? <madebeer@igc.apc.org>
    Re: Why does this simple regexp not work? <gellyfish@gellyfish.com>
    Re: Why does this simple regexp not work? (Matthew Bafford)
    Re: Why does this simple regexp not work? <ralawrence@my-deja.com>
    Re: Why does this simple regexp not work? makau@multimania.com
        Why extra junk at end of new file? (Jon)
    Re: Why extra junk at end of new file? (Jon)
    Re: Why extra junk at end of new file? (Malcolm Ray)
    Re: Why extra junk at end of new file? (Jon)
    Re: Why extra junk at end of new file? (Jon)
    Re: Why extra junk at end of new file? (Malcolm Ray)
    Re: Why extra junk at end of new file? <rootbeer@redcat.com>
        Win32 here strings - here documents <allan.hagan@bt.com>
    Re: Win32 here strings - here documents <allan.hagan@bt.com>
    Re: Win32 here strings - here documents (Brett W. McCoy)
    Re: Win32 here strings - here documents <allan.hagan@bt.com>
    Re: Win32 here strings - here documents <jeffp@crusoe.net>
    Re: Win32 here strings - here documents <gellyfish@gellyfish.com>
    Re: Win32 here strings - here documents <gellyfish@gellyfish.com>
        Win32-Tie-Ini - untie attempted while 2 inner reference <dchristensen@california.com>
    Re: Win32::AdminMisc <carvdawg@patriot.net>
        Win32::Internet <nothing@nowhere.com>
    Re: Win32::Internet <perin@panix.com>
    Re: Win32::Internet <nothing@nowhere.com>
        Win32::Process and completing CGI script (Andy Davidson)
        WINNT, Email, MS Outlook and MS Exchange (Jason James)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 25 Oct 1999 12:44:23 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: Why does this simple regexp not work?
Message-Id: <7v1jb6$t5$1@nnrp1.deja.com>

Hi all,

I'm trying to write a simple script that takes a HTML file and extracts
all the viewable words out of it. The problem I have is removing all
the tags in the HTML document. Here is what I have so far:

#!/usr/bin/perl -w

use strict;
use LWP::Simple;

my $content = get("http://www.microsoft.com");

# remove all newlines since they aren't needed
$content =~ s/\n//g;

# remove all html tags
$content =~ s/<.+>//g;

The problem is that after the last line $content contains nothing! Can
someone please point me to what I'm doing wrong?

Thanks

Rich


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 25 Oct 1999 11:35:42 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Why does this simple regexp not work?
Message-Id: <APC&1'0'50775dd6'8ea@igc.apc.org>

ralawrence wrote:
>I'm trying to write a simple script that takes a HTML file and extracts
>all the viewable words out of it. 

Extracting viewable words out of HTML is not easy/possible to do using 
regexp.

Read the FAQ 'How do I remove HTML from a string?'

Search Dejanews for keywords "parse html" , forums "comp.lang.perl.*"
There have been many heated discussions on this topic.

>The problem I have is removing all
>the tags in the HTML document. Here is what I have so far:

Your regexp is too greedy and matches almost the entire file, among 
other errors.

-Michael


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

Date: 25 Oct 1999 14:06:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Why does this simple regexp not work?
Message-Id: <381455ea_1@newsread3.dircon.co.uk>

Richard Lawrence <ralawrence@my-deja.com> wrote:
> Hi all,
> 
> I'm trying to write a simple script that takes a HTML file and extracts
> all the viewable words out of it. The problem I have is removing all
> the tags in the HTML document. Here is what I have so far:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> use LWP::Simple;
> 
> my $content = get("http://www.microsoft.com");
> 
> # remove all newlines since they aren't needed
> $content =~ s/\n//g;
> 
> # remove all html tags
> $content =~ s/<.+>//g;
> 
> The problem is that after the last line $content contains nothing! Can
> someone please point me to what I'm doing wrong?

Er, that Regular Expression will remove everything between the first < and
the last > in the  string yes ...

You probably want to read the section in perlfaq9 entitled:

       How do I remove HTML from a string?

/J\
-- 
"How much fun can a girl have with a rabbit?" - Channel 4 Continuity
Announcer


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

Date: Mon, 25 Oct 1999 13:44:30 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Why does this simple regexp not work?
Message-Id: <slrn818n1p.1rh.*@dragons.duesouth.net>

And so it happened, on Mon, 25 Oct 1999 12:44:23 GMT, Richard Lawrence
<ralawrence@my-deja.com> typed random characters into perl, and ended up
with the following posted to comp.lang.perl.misc: 
: I'm trying to write a simple script that takes a HTML file and extracts
[snip]
: someone please point me to what I'm doing wrong?

You're not reading the documentation?

perldoc -q HTML

clearly states that regular expresions are the wrong method, and it tells
you _why_.

: Thanks

HTH, HAND,
 
: Rich

--Matthew


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

Date: Mon, 25 Oct 1999 14:01:54 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: Re: Why does this simple regexp not work?
Message-Id: <7v1nsg$4fh$1@nnrp1.deja.com>

In article <7v1jb6$t5$1@nnrp1.deja.com>,
  Richard Lawrence <ralawrence@my-deja.com> wrote:
> Hi all,
>
> I'm trying to write a simple script that takes a HTML file and
extracts
> all the viewable words out of it. The problem I have is removing all
> the tags in the HTML document. Here is what I have so far:

Sorry, ignore this posting - I just found the highly helpful perlfaq9.

Regards

Rich


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 25 Oct 1999 14:55:34 GMT
From: makau@multimania.com
Subject: Re: Why does this simple regexp not work?
Message-Id: <7v1r14$6t6$1@nnrp1.deja.com>


> You probably want to read the section in perlfaq9 entitled:
>
>        How do I remove HTML from a string?

I especially liked the part :

===============================================================
Here's one "simple-minded" approach, that works for most files:
s/<(?:[^>'"]*|(['"]).*?\1)*>//gs
===============================================================

hehe :)


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 27 Oct 1999 00:06:14 GMT
From: jmonroe.easystreet@com.spam.sucks.my.ass.com (Jon)
Subject: Why extra junk at end of new file?
Message-Id: <38163d46.11440580@news.easystreet.com>

Hi,

I'm writing a CGI script that requires I create a file. Everything is
working fine, except one rather peculiar and quite annoying thing.
After I close the file, I find information I had written once in the
middle somewhere is being written again.

I can't post the entire script (too long), but it ends w/ something
like:

#################################
# other code that writes tons of junk to IN_TEMP
# write "some coolness" to IN_TEMP
# more other code that writes tons more junk  to IN_TEMP

print IN_TEMP "\nThis should be the very last line!";

close(IN_TEMP) || die("can't close temp");

# end of file
#################################


But, my file contents is something like:

tons of junk
some coolness
tons more junk
This should be the very last line!

some coolness



Why am I getting more stuff ("some coolness") after I close the file?
I'm not using any seek type write commands -- they are ALL print
IN_TEMP $whatever_to_print style writes where everything is
sequential. IN_TEMP is just a file.

I researched buffering and it looks like it could be the problem --
maybe something is being buffered and then dumped AGAIN right when I
close the file (to flush a buffer somewhere somehow). But, I still
don't know how or where. From my books, it looks like I'm only using
buffered type commands -- I didn't mix buffered and unbuffered
commands up. Maybe there's a way to clear the buffer w/o writing
before I close the file?

Thanks for any help,
Jon



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

Date: Wed, 27 Oct 1999 20:48:04 GMT
From: jmonroe.easystreet@com.spam.sucks.my.ass.com (Jon)
Subject: Re: Why extra junk at end of new file?
Message-Id: <381962e3.72951358@news.easystreet.com>

>Ok, I just wanted to confirm that it wasn't being opened with '+<'.
>
>You said you suspect this is happening when you close the file,
>and that disabling buffering for that filehandle hasn't fixed the
>problem.  Now that you've disabled buffering, the file should grow in
>a predictable way, and you could use '-s' at various parts of your
>program to find the file size - particularly immediately before and
>immediately after the close.  This may help you pinpoint the problem.

It's happening right when I close the file... arghhh... After the
close completes, it's too big. Before the close completes, it's fine.

>Hmm, you said this is a CGI script.  That means that there may well be
>multiple instances of it running simultaneously.  Are you sure you're
>not getting more than one process writing to that file?  You haven't
>told us how you generate the filename.

Ah.... it's just a name that is partly based on a year and month --
199910 is year 1999, 10 is 0-11 month -- November. The year/month used
depends on criteria determined within the script.

Anyway, I ran it as a normal script (NOTvia web server Apache) and it
still screws up. And, I know I'm the only one working on this file
right now.

Am I sure that not more than one process is writing to the file? Right
now, no actually. I've never seen this before and so if some wierd
thing was writing the file, I wouldn't be surprised (in effect, it's
happening right now!) However, I know I haven't manually spawned any
processes at this point that write anything anywhere. 

I'm going to go back and take out lines that effect the write, but
don't effect the program flow and see it stuff it still being dumped
to the file. I imagine it probably will, but I'm still curious to see
what happens.


Thanks again,
Jon


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

Date: 27 Oct 1999 16:35:57 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Why extra junk at end of new file?
Message-Id: <slrn81eafd.53v.M.Ray@carlova.ulcc.ac.uk>

On Wed, 27 Oct 1999 15:51:12 GMT, Jon
<jmonroe.easystreet@com.spam.sucks.my.ass.com> wrote:
>On 27 Oct 1999 12:42:13 GMT, M.Ray@ulcc.ac.uk (Malcolm Ray) wrote:
>
>>On Wed, 27 Oct 1999 00:06:14 GMT, Jon
>><jmonroe.easystreet@com.spam.sucks.my.ass.com> wrote:
>>>Hi,
>>>
>>>I'm writing a CGI script that requires I create a file. Everything is
>>>working fine, except one rather peculiar and quite annoying thing.
>>>After I close the file, I find information I had written once in the
>>>middle somewhere is being written again.
>>
>>Show us the section of code which opens the file.
>
>Sure, it's just a standard open statement:
>
>open(IN_TEMP, ">$temp_file") || die("can't open file $temp_file");
>
>where $temp_file is a just a date_sensitive file name.

Ok, I just wanted to confirm that it wasn't being opened with '+<'.

You said you suspect this is happening when you close the file,
and that disabling buffering for that filehandle hasn't fixed the
problem.  Now that you've disabled buffering, the file should grow in
a predictable way, and you could use '-s' at various parts of your
program to find the file size - particularly immediately before and
immediately after the close.  This may help you pinpoint the problem.

Hmm, you said this is a CGI script.  That means that there may well be
multiple instances of it running simultaneously.  Are you sure you're
not getting more than one process writing to that file?  You haven't
told us how you generate the filename.
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Wed, 27 Oct 1999 15:47:04 GMT
From: jmonroe.easystreet@com.spam.sucks.my.ass.com (Jon)
Subject: Re: Why extra junk at end of new file?
Message-Id: <38171b5a.54638155@news.easystreet.com>

On Tue, 26 Oct 1999 20:55:30 -0700, Tom Phoenix <rootbeer@redcat.com>
wrote:

>On Wed, 27 Oct 1999, Jon wrote:
>
>> I'm writing a CGI script that requires I create a file. Everything is
>> working fine, except one rather peculiar and quite annoying thing.
>> After I close the file, I find information I had written once in the
>> middle somewhere is being written again.
>> 
>> I can't post the entire script (too long), 
>
>Maybe you could make a small program which demonstrates the behavior.
>Ideally it would stand alone, not be a CGI program, and take fewer than
>ten lines of code.
>

I'd love too, but I can't. I know which area of the code is causing
the problem, but there's almost 300 lines in that section alone. Alot
of that is array manipulation, string matching, and some while loops
-- all those things Perl does so well :)

>> Why am I getting more stuff ("some coolness") after I close the file?
>
>Could you have forked a child process? Normally, that shouldn't be a
>problem, though.

Nope, didn't fork a process manually. I did open and close several
other files before closing this one though... I did check to make sure
the file names and file handles didn't get mixed up.

>> I researched buffering and it looks like it could be the problem --
>> maybe something is being buffered and then dumped AGAIN right when I
>> close the file (to flush a buffer somewhere somehow).
>
>> Maybe there's a way to clear the buffer w/o writing
>> before I close the file?
>
>No; that always happens. You want to clear the buffer before forking, if
>that's the problem. (This is now automatic as of some recent version of
>Perl, but I don't remember which one. Maybe 5.6. :-) But you could try
>putting this line, replacing FILE with the name of your filehandle, just
>after you've opened the filehandle. Yes, it's somewhat obfuscated....
>
>    select((select(FILE), $| = 1)[0]);	# Turn off buffering on FILE
>
>Good luck!

I tried the select statement above. I didn't work, or alter the output
at all actually.

I'll probably have to start going through and just removing lines that
might effect the output but don't effect program flow. Hopefully I can
figure out where things are getting screwed up.

Thanks again,
Jon



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

Date: Wed, 27 Oct 1999 15:51:12 GMT
From: jmonroe.easystreet@com.spam.sucks.my.ass.com (Jon)
Subject: Re: Why extra junk at end of new file?
Message-Id: <38181e80.55444975@news.easystreet.com>

On 27 Oct 1999 12:42:13 GMT, M.Ray@ulcc.ac.uk (Malcolm Ray) wrote:

>On Wed, 27 Oct 1999 00:06:14 GMT, Jon
><jmonroe.easystreet@com.spam.sucks.my.ass.com> wrote:
>>Hi,
>>
>>I'm writing a CGI script that requires I create a file. Everything is
>>working fine, except one rather peculiar and quite annoying thing.
>>After I close the file, I find information I had written once in the
>>middle somewhere is being written again.
>
>Show us the section of code which opens the file.

Sure, it's just a standard open statement:

open(IN_TEMP, ">$temp_file") || die("can't open file $temp_file");

where $temp_file is a just a date_sensitive file name.


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

Date: 27 Oct 1999 12:42:13 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Why extra junk at end of new file?
Message-Id: <slrn81dsp5.44f.M.Ray@carlova.ulcc.ac.uk>

On Wed, 27 Oct 1999 00:06:14 GMT, Jon
<jmonroe.easystreet@com.spam.sucks.my.ass.com> wrote:
>Hi,
>
>I'm writing a CGI script that requires I create a file. Everything is
>working fine, except one rather peculiar and quite annoying thing.
>After I close the file, I find information I had written once in the
>middle somewhere is being written again.

Show us the section of code which opens the file.
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Tue, 26 Oct 1999 20:55:30 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Why extra junk at end of new file?
Message-Id: <Pine.GSO.4.10.9910262029460.29843-100000@user2.teleport.com>

On Wed, 27 Oct 1999, Jon wrote:

> I'm writing a CGI script that requires I create a file. Everything is
> working fine, except one rather peculiar and quite annoying thing.
> After I close the file, I find information I had written once in the
> middle somewhere is being written again.
> 
> I can't post the entire script (too long), 

Maybe you could make a small program which demonstrates the behavior.
Ideally it would stand alone, not be a CGI program, and take fewer than
ten lines of code.

> Why am I getting more stuff ("some coolness") after I close the file?

Could you have forked a child process? Normally, that shouldn't be a
problem, though.

> I researched buffering and it looks like it could be the problem --
> maybe something is being buffered and then dumped AGAIN right when I
> close the file (to flush a buffer somewhere somehow).

> Maybe there's a way to clear the buffer w/o writing
> before I close the file?

No; that always happens. You want to clear the buffer before forking, if
that's the problem. (This is now automatic as of some recent version of
Perl, but I don't remember which one. Maybe 5.6. :-) But you could try
putting this line, replacing FILE with the name of your filehandle, just
after you've opened the filehandle. Yes, it's somewhat obfuscated....

    select((select(FILE), $| = 1)[0]);	# Turn off buffering on FILE

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 25 Oct 1999 10:53:39 +0100
From: "Allan Hagan" <allan.hagan@bt.com>
Subject: Win32 here strings - here documents
Message-Id: <7v19cc$fsu$1@pheidippides.axion.bt.co.uk>

Is there any documentation or samples which describes how here docs work on
Win32? Is there an equivalent for NT?

Thanks in Advance

                                Allan




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

Date: Mon, 25 Oct 1999 14:13:49 +0100
From: "Allan Hagan" <allan.hagan@bt.com>
Subject: Re: Win32 here strings - here documents
Message-Id: <7v1l3n$lu5$1@pheidippides.axion.bt.co.uk>


snip
>Ugly isnt it ?


It certainly is - Thanks for this I'm now clear what's happening and it
won't work on win32 as it stands.


>
>The best way to do this kind of stuff is to use the Module IPC::Open2
>which gets you filehandles to the STDIN and STDOUT of some command .
>
I now know which way to go.


Thanks again,
                        Allan




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

Date: Mon, 25 Oct 1999 14:40:26 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Win32 here strings - here documents
Message-Id: <slrn818r7o.u3d.bmccoy@moebius.foiservices.com>

Also Sprach Allan Hagan <allan.hagan@bt.com>:

>Is there any documentation or samples which describes how here docs work on
>Win32? Is there an equivalent for NT?

Here docs?  Why would they not work the same as on any other system using
Perl?  Unless you're talking about something that doesn't involve Perl,
which means you're in the wrong newsgroup altogether.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: Mon, 25 Oct 1999 12:24:43 +0100
From: "Allan Hagan" <allan.hagan@bt.com>
Subject: Re: Win32 here strings - here documents
Message-Id: <7v1en5$j61$1@pheidippides.axion.bt.co.uk>

Yes, this code should theoretically issue the set of commands to a sql plus
session.

$ans=`$SQLPLUS -s $SQLCONN <<EGD;
echo set heading on
echo set recsep off
set trimspool on
set colsep !
set wrap off
set tab on
set lin 444
set newpage 0
$sqltext
exit
EGD
`
;

The login commands execute correctly in a command window. But, I get the
following message when trying to run the code. The code is so simple I must
be doing something stupid!

 << was unexpected at this time.

Thanks
                Allan




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

Date: Mon, 25 Oct 1999 07:45:22 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Win32 here strings - here documents
Message-Id: <Pine.GSO.4.10.9910250742020.2694-100000@crusoe.crusoe.net>

[posted & mailed]

On Oct 25, Allan Hagan blah blah blah:

> Yes, this code should theoretically issue the set of commands to a sql plus
> session.

No, this code tries running the program held in $SQLPLUS with the
following arguments:
  -s
  $SQLCONN
  <<END
  echo set heading on
  echo set recsep off
  (etc...)

You want to use IPC::Open2.

  use IPC::Open2;
  open2(\*READ,\*WRITE,"$SQLPLUS -s $SQLCONN") or
    die "can't run $SQLPLUS -s $SQLCONN: $!";
  print WRITE "...";
  # until you're done.
  close WRITE;
  @data = <READ>;
  close READ;

Your code should be based on that, methinks.

-- 

  MIDN 4/C PINYAN, USNR, NROTCURPI
  jeff pinyan      japhy@pobox.com
  perl stuff       japhy+perl@pobox.com
  CPAN ID: PINYAN  http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/



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

Date: 25 Oct 1999 12:51:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Win32 here strings - here documents
Message-Id: <3814445c_2@newsread3.dircon.co.uk>

Allan Hagan <allan.hagan@bt.com> wrote:
> Yes, this code should theoretically issue the set of commands to a sql plus
> session.
> 
> $ans=`$SQLPLUS -s $SQLCONN <<EGD;
> echo set heading on
> echo set recsep off
> set trimspool on
> set colsep !
> set wrap off
> set tab on
> set lin 444
> set newpage 0
> $sqltext
> exit
> EGD
> `
> ;
> 
> The login commands execute correctly in a command window. But, I get the
> following message when trying to run the code. The code is so simple I must
> be doing something stupid!
> 
>  << was unexpected at this time.

Ah - you are conflating the Perl here doc and the Unix shell here doc - I
am not sure if you can actually do this in Windows at all - lets see:

No it doesnt work on Win32.  What you would do in Unix is to have a
shell here-doc inside a Perl one (ugh!)

$ans=<<`EGD`;
$SQLPLUS -s $SQLCONN <<ESHELLHERE
echo set heading on
echo set recsep off
set trimspool on
set colsep !
set wrap off
set tab on
set lin 444
set newpage 0
$sqltext
exit
ESHELLHERE
EGD

Ugly isnt it ?

The best way to do this kind of stuff is to use the Module IPC::Open2
which gets you filehandles to the STDIN and STDOUT of some command .

/J\
-- 
"Pat was wondering if he could put his massive tool in my box" - Mrs
Doyle, Father Ted


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

Date: 25 Oct 1999 10:59:28 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Win32 here strings - here documents
Message-Id: <38142a00_1@newsread3.dircon.co.uk>

Allan Hagan <allan.hagan@bt.com> wrote:
> Is there any documentation or samples which describes how here docs work on
> Win32? Is there an equivalent for NT?
> 

Er, here documents work exactly the same on Win32 as any other platfrom
AFAIK - do you have a specific problem with getting them to work ?

/J\
-- 
"Conservatives have called on Sports Minister, Tony Banks, to resign
after calling William Hague a foetus" - BBC News Website


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

Date: Mon, 25 Oct 1999 15:12:07 -0700
From: "David Christensen" <dchristensen@california.com>
Subject: Win32-Tie-Ini - untie attempted while 2 inner references still exist
Message-Id: <7v2jq1$b6r$1@pollux.dnai.com>

comp.lang.perl.misc:

I am running ActivePerl build 519 with Ini_Build_AS_5005.zip on
Win98 and having problems with the following code:

      4 my $name = 'Motion.pm';

     32 my $inifile = 'c:\windows\abihost.ini';

     81 sub new

     93     my $self = {};

     98     $self->{INIPARMS}   = {
     99         XNeedleReaction => undef,
    100         XNeedleWash     => undef,
    101         XNeedleSample   => undef,

    157 sub read_ini_file

    169     my %ini;
    170     my $section = $name;
    171     $section =~ s|\.pm||;
    172
    173     tie (%ini, "Win32::Tie::Ini", $inifile);
    174
    175     foreach my $key (sort keys %{$self->{INIPARMS}})
    176     {
    177         my $value = $ini{$section}->{$key};
    178         $self->{INIFILE}->{$key} = $value;
    179     }
    180
    181     untie %ini;


Here is the ini file:

      1 [Motion]

     19 XNeedleReaction=-865
     20 XNeedleWash=30
     21 XNeedleSample=340


The code seems to load values into $self->{INIFILE} okay, but
produces the following warning (line wrapped for clarity):

    untie attempted while 2 inner references still exist \
        at Motion.pm line 181, <STDIN> chunk 4.


I don't know what "inner references" are and can't understand the
warning (or find the bug).  I've tried the docs and the camel book,
but still don't get it.  Any suggestions?


Thank you,

David Christensen
dchristensen@california.com





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

Date: Tue, 26 Oct 1999 05:34:11 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: Win32::AdminMisc
Message-Id: <38157593.F33079F@patriot.net>

Try going to Dave Roth's site at http://www.roth.net.

Have you thought about using Win32::Lanman?

Finally, if all you want to do is add the Domain Users group to the Local Admin
group, that's easy.  You can simply run the script as a Domain Admin, rather
than
have each user run it as a login script.

"Jørn Walle" wrote:

> Hello !
>
> I need some help with som routines in the module Win32::AdminMisc.
> I'm developing a script to put the group Domain Users in to the local group
> Administrators. The command that perform this task works fine, exept that it
> has to be run from an administrator account. To make the script work for
> "normal" users, I use the LogonAsUser routine from the AdminMisc module. My
> script looks like this :
>
> use Win32::NetAdmin qw(LocalGroupIsMember LocalGroupAddUsers);
> use Win32::AdminMisc;
>
> $LokalAdmGruppe = "Administrators";
> $GlobalAdmGruppe = "Domain Admins";
> $GlobalGruppe = "Domain users";
> $CommandString = 'LocalGroupAddUsers("", $LokalAdmGruppe, $GlobalGruppe)';
>
> $Domain = "VBS";
> $User = "xxx";
> $Password = "yyy";
>
> if (!LocalGroupIsMember("", $LokalAdmGruppe, $GlobalGruppe))
> {
>      Win32::AdminMisc::LogonAsUser($Domain, $User, $Password); # NOT WORKING
> !!
>      LocalGroupAddUsers("", $LokalAdmGruppe, $GlobalGruppe);
>     # Win32::AdminMisc::CreateProcessAsUser($CommandString);    DO I NEED TO
> DO THIS INSTEAD ?
>      Win32::AdminMisc::LogoffAsUser (0);
> }
>
> Hope someone can help me getting this script to work !
>
> Thanks in advance.
>
> Jørn Walle
> Gilde VBT, Norway
> jorn.walle@gilde.no



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

Date: Tue, 26 Oct 1999 21:03:07 -0500
From: "No One" <nothing@nowhere.com>
Subject: Win32::Internet
Message-Id: <s1cnb8m9r0880@corp.supernews.com>


Hash: SHA1

I'm trying to create a script to download logfiles and I keep getting
errors while using the Win32::Internet in ActiveState Perl build 521.
Here's the script:

- ----------snip----------
 $INET = new Win32::Internet();
 $INET->FTP($FTP, "ftp.mysite.com", $username, $password) || die
"Can't connect: $!";
 $INET->Cd("logfiles") || die "Can't change directories: $!";
 $INET->Get($remote_file, $local_file) || die "Can't get file: $!";
- ----------snip----------

The program "dies" at the "Cd" command every time with no other
message other than the one I have written in the "die" routine.  Does
anyone have any pointers?

Thanks,
Chris Muller


Version: PGPfreeware 6.0.2 for non-commercial use <http://www.pgp.com>

iQA/AwUBOBZdUCNkOAwUeW8yEQLifgCg334eya4gze/W1m3HQm4UBDq1U+8AoMQA
S4CBtXnG+iAvPmcRZCo0q1p8
=86SQ
-----END PGP SIGNATURE-----





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

Date: 27 Oct 1999 11:33:29 -0400
From: Lewis Perin <perin@panix.com>
Subject: Re: Win32::Internet
Message-Id: <pc7904ou8c6.fsf@panix6.panix.com>

"No One" <nothing@nowhere.com> writes:

> I'm trying to create a script to download logfiles and I keep getting
> errors while using the Win32::Internet in ActiveState Perl build 521.
> Here's the script:
> 
> - ----------snip----------
>  $INET = new Win32::Internet();
>  $INET->FTP($FTP, "ftp.mysite.com", $username, $password) || die
> "Can't connect: $!";
>  $INET->Cd("logfiles") || die "Can't change directories: $!";
>  $INET->Get($remote_file, $local_file) || die "Can't get file: $!";
> - ----------snip----------
> 
> The program "dies" at the "Cd" command every time with no other
> message other than the one I have written in the "die" routine.  Does
> anyone have any pointers?

First, are you sure there's a logfiles directory *immediately below*
the directory FTP puts you into at login?  You can probably figure out
the commands for diagnosing this.

Second, and I have to admit I've never used Win32::Internet, but is
there a reason you chose not to use the portable Net::FTP?  It works
just fine for me under Win32.

/Lew
-- 
Lew Perin / perin@mail.med.cornell.edu / perin@acm.org
www.panix.com/~perin/


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

Date: Wed, 27 Oct 1999 18:17:52 -0500
From: "No One" <nothing@nowhere.com>
Subject: Re: Win32::Internet
Message-Id: <s1f21hpjr0817@corp.supernews.com>


Hash: SHA1

>First, are you sure there's a logfiles directory *immediately below*
>the directory FTP puts you into at login?

Yes, that was the first thing I checked and it is directly below the
"root"

>Second, and I have to admit I've never used Win32::Internet, but is
>there a reason you chose not to use the portable Net::FTP?

How do I install Net::FTP for my Win 98 machine?  I was under the
impression that the only modules that work with ActiveState Perl are
those which can be accessed through the PPM.  I did some searching
using PPM and didn't find it.

Thanks,
Chris Muller



Version: PGPfreeware 6.0.2 for non-commercial use <http://www.pgp.com>

iQA/AwUBOBeIFiNkOAwUeW8yEQLMPgCg/sZGGnpCFuSKYhcBQrXf2tvPk8MAn1iS
xl8xQ9lsBcPa2DKBrwSHQ267
=t408
-----END PGP SIGNATURE-----





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

Date: Wed, 27 Oct 1999 13:37:04 GMT
From: pheon@hevanet.com (Andy Davidson)
Subject: Win32::Process and completing CGI script
Message-Id: <3816fe4d.2895791@news.hevanet.com>

I have a cgi-bin script that calls Win32::Process to launch a program.
I am using the detached process mode like this:
        Win32::Process::Create($proc,
           "C:\\bin\\Some_progam.exe",
           "Some_program.exe xxx.txt",
           0,
           DETACHED_PROCESS,
           ".")|| die ErrorReport();

My problem is that the cgi-bin script doesn't complete and send output
back to the browser until the called program exits.  Which is not what
I expected.  Anybody got a clue on what I can do to get the cgi script
to complete as soon as the program is launched?

Both the browser and the server are running on the same Win98 system.

thanks,
	andy


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

Date: Tue, 26 Oct 1999 20:17:43 GMT
From: jason@jamesjl.demon.co.uk (Jason James)
Subject: WINNT, Email, MS Outlook and MS Exchange
Message-Id: <38160a2a.431721853@news.demon.co.uk>

As you can guess from the title of this
posting I am developing in a Windows
environment.  I am using Perl 5.005_02
for WINNT from Active State.  I have
downloaded from CPAN.org Mail::Mailer,
Net::Smtp, and a few other modules to
try and sort out my situation.

I am trying to send email across an internal
network that uses MS Exchange to deal 
with all of our mails.  When the users sends
some information from a form to a Perl script
I need to be able to send some of that info
to specific users thru email.  I don't seem to 
be able to do that.  I have even tried to use
my ISP as an SMTP server but that is failing
also.  I have used the following code to send
emails, unsuccessfully :

use Mail::Mailer;     # Import the Mail::Mailer module

my $smtp_server  = "post.demon.co.uk";
my $from         = "jason\@jamesjl.demon.co.uk";
my $to           = ""jason\@jamesjl.demon.co.uk";
my $subject      = "Testing A Mail Program";
my $body         = "This is the body\n";

my $mailer = new Mail::Mailer ("smtp", $smtp_server);

$mailer->open({ From      => $from,
                To        => $to,
                Subject   => $subject,
        })
  or die "Can't open: $!\n";

print $mailer $body;
$mailer->close();

but I get an uninitialised value in net::config.pm.

Can anybody see where I am going wrong?  Can I
use MS Exchange as an SMTP mail server or do I
need to use Net::POP3 or a different mail server?

Any suggestions would be greatly received.

Regards

Jason James
jason@jamesjl.demon.co.uk
jasonj@rwdata.co.uk


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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


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