[19564] in Perl-Users-Digest
Perl-Users Digest, Issue: 1759 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 17 09:05:52 2001
Date: Mon, 17 Sep 2001 06:05:10 -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: <1000731910-v10-i1759@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 17 Sep 2001 Volume: 10 Number: 1759
Today's topics:
$r={1=>22,3=>44}; delete $r->{1,33}; print join "+",%$r (EED)
Re: $r={1=>22,3=>44}; delete $r->{1,33}; print join "+" <dtweed@acm.org>
Re: $r={1=>22,3=>44}; delete $r->{1,33}; print join "+" <Thomas@Baetzler.de>
__END__ problem <postatore@bigfoot.com>
Re: __END__ problem <em@online.no>
Re: ActivePerl in a Win32 environment; how do I launch <bart.lateur@skynet.be>
ANNOUNCE: Hook::LexWrap 0.01 (Damian Conway)
cd (NT command) on Perl <radiotito@yahoo.com>
Re: cd (NT command) on Perl <Thomas@Baetzler.de>
Re: cd (NT command) on Perl <simon.oliver@umist.ac.uk>
Re: Checking for errors from sendmail <Thomas@Baetzler.de>
Re: Checking for errors from sendmail <stumo@bigfoot.com>
Re: debug CGI script (Joe Chung)
Re: debug CGI script <bart.lateur@skynet.be>
Re: Discontinue the loop <Graham.T.Wood@oracle.com>
Re: Error in perlrun: "Bad option" <simon.andrews@bbsrc.ac.uk>
from html to xhtml - reg exp (Tobia)
Re: from html to xhtml - reg exp <Thomas@Baetzler.de>
Re: Good editor for perl Use Scite ! (Hanno Böhm)
Re: Good editor for perl Use Scite ! <fty@mediapulse.com>
Re: Hex registry key (Phil Hibbs)
Re: How can I find the PID's of my children? (Alan Barclay)
Re: How can I find the PID's of my children? (Martien Verbruggen)
Re: How can I find the PID's of my children? <bernie@fantasyfarm.com>
Re: Javadoc alike <bcaligari@fireforged.com>
Re: Lotus Notes <hg_zauner@gmx.de>
Re: parsing large DNA files into smaller files brianr@liffe.com
Peek and Poke on Perl? <gamtci1@mpinet.net>
Perl access to Inportb / Outportb (Nial Stewart)
Re: Perl access to Inportb / Outportb (EED)
perl signature... <wosko@lucent.com>
Re: perl signature... <Thomas@Baetzler.de>
Re: perl signature... <wosko@lucent.com>
Re: perl signature... <Thomas@Baetzler.de>
Re: Similar file finder <sun_tong@users.sourceforge.net>
Re: Similar file finder <bart.lateur@skynet.be>
Re: Similar file finder <stephen.baynes@soton.sc.philips.com>
TK::filevent, and Tk::update (Stan Brown)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 17 Sep 2001 14:05:34 +0200
From: "Alexander Farber (EED)" <eedalf@eed.ericsson.se>
Subject: $r={1=>22,3=>44}; delete $r->{1,33}; print join "+",%$r
Message-Id: <3BA5E70E.D1B5E56B@eed.ericsson.se>
Hi,
could someone help me with a syntax for deleting a hash slice
if I have a reference to it? The following doesn't seem to work:
maas34:eedalf {105} perl -e '$r={1=>22,3=>44}; delete $r->{1,33}; print join "+",%$r'
1+22+3+44
And the original code is:
while (my ($pac, $href) = each %$hohref) # ref to a hash of hashes
{
...
push @del, $pac if $href -> {'PAC DC Result'} eq 'Passed' and
$href -> {'PAC FT Result'} eq 'Passed';
}
...
delete $hohref -> {@del};
but it doesn't delete.
And if I change it to delete @{$hohref -> {@del}}; it doesn't compile.
Thank you!
Alex
------------------------------
Date: Mon, 17 Sep 2001 12:27:12 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: $r={1=>22,3=>44}; delete $r->{1,33}; print join "+",%$r
Message-Id: <3BA5EAE4.C1D4E834@acm.org>
"Alexander Farber (EED)" wrote:
> And if I change it to delete @{$hohref -> {@del}}; it doesn't compile.
perldoc -f delete:
Note that the EXPR can be arbitrarily complicated as long as the final
operation is a hash element lookup or hash slice:
delete $ref->[$x][$y]{$key};
delete @{$ref->[$x][$y]}{$key1, $key2, @morekeys};
I think the latter example is what you're looking for. Try:
delete @{$hohref}{@del};
-- Dave Tweed
------------------------------
Date: Mon, 17 Sep 2001 14:29:31 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: $r={1=>22,3=>44}; delete $r->{1,33}; print join "+",%$r
Message-Id: <m0rbqt0de9hie7vgvqpg095635flbqnaq1@4ax.com>
On Mon, 17 Sep 2001, "Alexander Farber (EED)" <eedalf@eed.ericsson.se>
wrote:
>Hi,
>
>could someone help me with a syntax for deleting a hash slice
>if I have a reference to it? The following doesn't seem to work:
>
> maas34:eedalf {105} perl -e '$r={1=>22,3=>44}; delete $r->{1,33}; print join "+",%$r'
> 1+22+3+44
There is no hash element 33 to be deleted :-)
Apart from that, the syntax for the deletion of a hash slice from a
reference would be
delete @$r{1,3};
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Mon, 17 Sep 2001 12:45:58 +0200
From: "dylan" <postatore@bigfoot.com>
Subject: __END__ problem
Message-Id: <9o4kbk$g5v$1@serv1.iunet.it>
I've got a problem with __END__ : if in a file of my website there is
''__END__'' it doesn't work: server error. Why?
What else can I use instead of end?
thanks
------------------------------
Date: 17 Sep 2001 14:21:09 +0200
From: Espen Myrland <em@online.no>
Subject: Re: __END__ problem
Message-Id: <87sndm2ekq.fsf@espenboks.ws.nextra.no>
"dylan" <postatore@bigfoot.com> writes:
> I've got a problem with __END__ : if in a file of my website there is
> ''__END__'' it doesn't work: server error. Why?
>
Are you runnig mod_perl? If so, you cannot use __END__ in your
scripts, because the scripts get wrapped up.
> What else can I use instead of end?
>
I dont know. =comment, =cut, maybe.
--
espen
------------------------------
Date: Mon, 17 Sep 2001 08:26:28 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: ActivePerl in a Win32 environment; how do I launch a web page in Microsoft Internet Explorer using a perl script?
Message-Id: <jscbqtkrsebbrh71rll8rmjm4k66hbicjh@4ax.com>
Bob Walton wrote:
>If you want to load a page from the web instead of from a file, use a
>file anyway, but insert a "Refresh" meta-tag which redirects the browser
>to the destination you want
"start" accepts URL's as a parameter as well.
--
Bart.
------------------------------
Date: 17 Sep 2001 11:24:49 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Hook::LexWrap 0.01
Message-Id: <9o4mi1$ums$1@towncrier.cc.monash.edu.au>
Keywords: perl, module, release
==============================================================================
Release of version 0.01 of Hook::LexWrap
==============================================================================
NAME
Hook::LexWrap - Lexically scoped subroutine wrappers
VERSION
This document describes version 0.01 of Hook::LexWrap, released
September 17, 2001.
DESCRIPTION
Hook::LexWrap allows you to install a pre- or post-wrapper (or both)
around an existing subroutine. Unlike other modules that provide this
capacity (e.g. Hook::PreAndPost and Hook::WrapSub), Hook::LexWrap
implements wrappers in such a way that the standard `caller' function
works correctly within the wrapped subroutine.
AUTHOR
Damian Conway (damian@conway.org)
COPYRIGHT
Copyright (c) 2001, Damian Conway. All Rights Reserved.
This module is free software. It may be used, redistributed
and/or modified under the same terms as Perl itself.
==============================================================================
CHANGES IN VERSION 0.01
(Initial release. No changes have been documented for this version)
==============================================================================
AVAILABILITY
Hook::LexWrap has been uploaded to the CPAN
and is also available from:
http://www.csse.monash.edu.au/~damian/CPAN/Hook-LexWrap.tar.gz
==============================================================================
------------------------------
Date: Mon, 17 Sep 2001 11:17:06 +0200
From: Valentin 30IR976 <radiotito@yahoo.com>
Subject: cd (NT command) on Perl
Message-Id: <3BA5BF92.BBAAA85D@yahoo.com>
Hello. I would like to make a cd to a particular directory on NT with my
perl program. I use ActiveState Perl.
I have tried to make:
`cd e:\\mydir`;
and also
$dir="e:\\mydir";
`chdir($dir`);
But if I only put these lines on a perl program, I execute it and the
directory is the same of the executable...
Whats wrong?
Thanks. Tito
------------------------------
Date: Mon, 17 Sep 2001 12:20:48 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: cd (NT command) on Perl
Message-Id: <hfjbqt82m2a56sejdlr8durepqe9s7i0ju@4ax.com>
On Mon, 17 Sep 2001, Valentin 30IR976 <radiotito@yahoo.com> wrote:
>Hello. I would like to make a cd to a particular directory on NT with my
>perl program. I use ActiveState Perl.
[...]
>But if I only put these lines on a perl program, I execute it and the
>directory is the same of the executable...
>
>Whats wrong?
Nothing. Your Perl program is executed in a subshell, so it only
affects the settings and evnvironment in that shell. Once it exits,
you're back to your old settings.
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Mon, 17 Sep 2001 11:33:37 +0100
From: "Simon Oliver" <simon.oliver@umist.ac.uk>
Subject: Re: cd (NT command) on Perl
Message-Id: <3ba5d5ab$1@news.umist.ac.uk>
The `cd` is only for that program's environment:
C:\>perl -e "use Cwd; chdir q{c:\perl}; print cwd;"
c:/perl
C:\>
--
Simon Oliver
----- Original Message -----
From: "Valentin 30IR976" <radiotito@yahoo.com>
Newsgroups: comp.lang.perl.misc
Sent: Monday, September 17, 2001 10:17 AM
Subject: cd (NT command) on Perl
> Hello. I would like to make a cd to a particular directory on NT with my
> perl program. I use ActiveState Perl.
>
> I have tried to make:
>
> `cd e:\\mydir`;
>
> and also
>
> $dir="e:\\mydir";
> `chdir($dir`);
>
> But if I only put these lines on a perl program, I execute it and the
> directory is the same of the executable...
>
> Whats wrong?
>
> Thanks. Tito
>
------------------------------
Date: Mon, 17 Sep 2001 08:40:19 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Checking for errors from sendmail
Message-Id: <1k6bqtshgoteh2sp0lj0m79g6p98rufk42@4ax.com>
On Mon, 17 Sep 2001, "Stuart Moore" <stumo@bigfoot.com> wrote:
[...]
>(Alternatively if anyone has a module that'll handle this for me I'd be very
>grateful - Mail::Mailer seems the closest I could find but doesn't say how error
>messages are handled)
I'd say MIME::Lite and/or Net::SMTP would fit the bill.
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Mon, 17 Sep 2001 12:23:19 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: Checking for errors from sendmail
Message-Id: <z2lp7.27145$Pm5.5957937@news2-win.server.ntlworld.com>
Clinton A. Pierce <clintp@geeksalad.org> wrote in message
news:3BA550AE.3050303@geeksalad.org...
>
> The exit status of sendmail will be returned by close(). (As part of
> reaping the now-dead child process.)
I am always getting a value of 1 from close, even when as far as I can see
sendmail should be returning another error code (either 0 or >64)
Cheers for the other tip.
Stuart
------------------------------
Date: Mon, 17 Sep 2001 04:23:47 GMT
From: m_010@yahoo.com (Joe Chung)
Subject: Re: debug CGI script
Message-Id: <3ba57a38.554657@enews.newsguy.com>
If I want to debug live from web server:
#!/usr/bin/perl -d:ptkdb
any way I can have the perl debugger GUI pop up when user request
comes in (on UNIX)? I can't think of a way do that.
In other word, any way I can debug CGI script POST from web client? I
am telnet/ssh to a unix terminal.
thanks again.
On Mon, 17 Sep 2001 01:13:10 GMT, Bob Walton
<bwalton@rochester.rr.com> wrote:
>Joe Chung wrote:
>>
>> I am using the GUI perl debugger to debug perl script:
>>
>> but if I invoke a CGI script using the debugger:
>> perl -d:ptkdb hello_world.pl
>>
>> the CGI script get invoked won't have access to server environment
>> variables, like:
>> $count_page = "$ENV{'DOCUMENT_URI'}";
>>
>> the CGI program will not run correctly if it needs to access server
>> environment variables and invoke by perl debugger. Any way I can
>> attach to a running CGI process when HTTP request comes in to invoke
>> CGI?
>...
>Well, you can easily add something like:
>
> %ENV{REQUEST_METHOD}='GET';
> %ENV{...
> ....
>
>to the start of your program to set up the exact environment you want
>for your debug run. If you want to check out POST requests, you can
>redirect a file to STDIN when you fire up Perl. Or, using the debugger,
>you can type in the environment variables you want. Or put those
>commands in another file and require or do it from the debugger's
>command prompt. Etc. Debugging a program "live" from the web server
>doesn't strike me as something you should be doing. Make sure your
>programs work first, then try running them as a CGI script.
------------------------------
Date: Mon, 17 Sep 2001 09:29:16 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: debug CGI script
Message-Id: <29gbqts39mfamlk09ua58v4n9qjfnihll3@4ax.com>
Joe Chung wrote:
>If I want to debug live from web server:
>
>#!/usr/bin/perl -d:ptkdb
>
>any way I can have the perl debugger GUI pop up when user request
>comes in (on UNIX)? I can't think of a way do that.
If this works at all, it would pop up a debugging window on your
*server*, not on your client.
>In other word, any way I can debug CGI script POST from web client? I
>am telnet/ssh to a unix terminal.
You could try installing a local web server on your own computer.
Perhaps then it would pop up on your own screen.
Maybe the remote debugging tools available from ActiveState could help.
Search their site for "Komodo". I've never actually even looked at it,
so I'm not sure it really does what I think it does.
I don't ever debug perl scripts that way, and most definitely not CGI
scripts.
--
Bart.
------------------------------
Date: Mon, 17 Sep 2001 13:50:16 +0100
From: Graham Wood <Graham.T.Wood@oracle.com>
Subject: Re: Discontinue the loop
Message-Id: <3BA5F187.5CE9CEF2@oracle.com>
This is a multi-part message in MIME format.
--------------14539060185A584D7E4B9A0B
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
What are you achieving here apart from setting $ig to 1? Maybe
next;
would be more useful than
last;
Is there any reason that you need to have the first element in there?
shift(@lines); # remove the first element
foreach $line (@lines){
# now you don't have the first element in there to worry about
}
Graham Wood
uma shanker wrote:
> hello,
> what are the possible ways to come out of this loop. I searched the
> docs, but found no special info.
>
> # I want to ignore the first element in @lines
>
> $ig = 0;
> foreach $line (@lines)
> {
> if( $ig == "0")
> {
> $ig = 1;
> last;
> }
> .....
> }
>
> /thanks
> /uma
> asdf834@yahoo.com
--------------14539060185A584D7E4B9A0B
Content-Type: text/x-vcard; charset=UTF-8;
name="Graham.T.Wood.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Graham Wood
Content-Disposition: attachment;
filename="Graham.T.Wood.vcf"
begin:vcard
n:;Graham
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Graham.T.Wood@oracle.com
fn:Graham Wood
end:vcard
--------------14539060185A584D7E4B9A0B--
------------------------------
Date: Mon, 17 Sep 2001 09:00:42 +0100
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: Error in perlrun: "Bad option"
Message-Id: <3BA5ADAA.3253A3B7@bbsrc.ac.uk>
Alicia wrote:
>
> In <7D5n7.4103$CY6.401323183@newssvr17.news.prodigy.com> "JASON HOFFOSS" <jason-hoffoss@prodigy.net> writes:
>
> >Ok, /bin/sh is not bash. That is sh. You should use /bin/bash instead if
> >you really want bash.
>
> In RH6.2:
>
> $ ls -l /bin/sh
> lrwxrwxrwx 1 root root 4 Dec 23 2000 /bin/sh -> bash
..but in man bash;
"If bash is invoked with the name sh, it tries to mimic the startup
behavior
of historical versions of sh as closely as possible, while conforming
to
the POSIX standard as well."
If you want bash then ask for it.
Simon.
------------------------------
Date: 17 Sep 2001 03:10:42 -0700
From: magoga@inwind.it (Tobia)
Subject: from html to xhtml - reg exp
Message-Id: <bb09b3a2.0109170210.2fa3252@posting.google.com>
Hi all,
my script convert html to xhtml so valign=top is converted to valign="top", etc.
I have a problem with a regular expression, es:
<img src="image.gif"> is converted in <img src="image.gif" />
I use:
$line="<img src=\"image.gif\">";
$line =~ s#<img(.*)">#<img$1"/>#gi;
that not work in this case:
$line="<td><img src=\"image.gif\"></td><td width=\"200\"></td>";
it insert "/" first of td and not of img
I obtain:
<td><img src="image.gif"></td><td width="200"/></td>
but i need:
<td><img src="image.gif"/></td><td width="200"></td>
How can i my reg exp change?
Thank you very much.
------------------------------
Date: Mon, 17 Sep 2001 12:50:53 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: from html to xhtml - reg exp
Message-Id: <g1lbqt0ef3vcfcm81bpnlrlambtg7umi0b@4ax.com>
On 17 Sep 2001 03:10:42 -0700, magoga@inwind.it (Tobia) wrote:
>I have a problem with a regular expression, es:
><img src="image.gif"> is converted in <img src="image.gif" />
>I use:
>
>$line="<img src=\"image.gif\">";
>$line =~ s#<img(.*)">#<img$1"/>#gi;
>
>that not work in this case:
>$line="<td><img src=\"image.gif\"></td><td width=\"200\"></td>";
".*" is "greedy" - i.e. it will make the longest possible match - and
that means that it will match " src=\"image.gif\"></td><td
width=\"200\" in your example.
Try replacing ".*" with ".*?" to get the minimal match instead - that
will fix this particular problem.
This might however bring about other problems later. Your best bet is
certainly to use one of the HTML Parser modules available from CPAN to
transform your HTML to a parsed tree representation that you can then
transform to XHTML.
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Mon, 17 Sep 2001 09:10:05 GMT
From: hanno_b@web.de (Hanno Böhm)
Subject: Re: Good editor for perl Use Scite !
Message-Id: <3ba5bd56.4467235@News.CIS.DFN.DE>
On Wed, 09 May 2001 21:32:12 GMT, "smilepak" <smilepak@hotmail.com>
wrote:
>Use CuteHTML!
>
>
>"Prévost Christophe" <hayden@club-internet.fr> wrote in message
>news:9d7kup$41s$1@front1m.grolier.fr...
>> "Super-Simon"
>>
>> > I'm searching for a good, fast editor with syntax highlighting for perl
>> > (CGI) for use under Windows 2000 / Windows 98 (I use windowz only for
>> > editing scripts, scripts runs on Linux-server). It has to be free (I'm a
>> > poor student ;-)
>>
>> I'm quite surprise that scite isn't better known...
>>
>> Scite use Scintilla control like komodo but scite it reallly small. Komodo
>> use a lot of memory. Scite is cross platform (Linux / Win32) and really
>> customisable. In fact to be really easy to use you may have to customize
>it
>> (for example to change the position of the output bar, to enable line
>> numbers on gutter, enable multiple buffers, customise syntax highligthing
>> etc...)
>>
>> Scite is updated oftently, free... opensource... marvellous... paramount
>>
>> I use it for php, python and perl...
>>
>> URL: http://www.scintilla.org
>>
>>
>>
>
>
My suggestion: MicroEmacs from www.jasspa.com, free, extremly
versatile,syntax highlighting and lots a stuff more!
------------------------------
Date: Mon, 17 Sep 2001 09:04:52 -0400
From: "Jay Flaherty" <fty@mediapulse.com>
Subject: Re: Good editor for perl Use Scite !
Message-Id: <lxmp7.14562$NL.855867@news6.giganews.com>
"Hanno Böhm" <hanno_b@web.de> wrote in message
news:3ba5bd56.4467235@News.CIS.DFN.DE...
> >> I'm quite surprise that scite isn't better known...
> >>
> >> Scite use Scintilla control like komodo but scite it reallly small.
Komodo
> >> use a lot of memory. Scite is cross platform (Linux / Win32) and really
> >> customisable. In fact to be really easy to use you may have to
customize
> >it
> >> (for example to change the position of the output bar, to enable line
> >> numbers on gutter, enable multiple buffers, customise syntax
highligthing
> >> etc...)
> >>
> >> Scite is updated oftently, free... opensource... marvellous...
paramount
> >>
> >> I use it for php, python and perl...
> >>
> >> URL: http://www.scintilla.org
The big thing about Scite that is missing (last I looked) was no ftp
support. Most of my apps are on linux boxes but I have a windows box on my
desktop. That is why I use UltraEdit32 :-)
Jay
------------------------------
Date: 17 Sep 2001 02:54:43 -0700
From: phil@snark.freeserve.co.uk (Phil Hibbs)
Subject: Re: Hex registry key
Message-Id: <979ae699.0109170154.7d502111@posting.google.com>
> > print " Foo/Bar flag is set\n" if $FooBar == "\x01\x00\x00\x00";
Thomas Bätzler <Thomas@Baetzler.de> wrote in message news:<2dj3qt0u4pr2gqmo991sk3phpbloldc0oh@4ax.com>...
> Either use "eq" to compare the strings,
D'oh, that's the bug!
The actual Reg_Get function isn't mine, I'm trying to re-use existing
code as much as possible both to reduce questions to be asked at code
review, and to reduce the chance of version problems.
Thanks for the help.
Phil Hibbs.
------------------------------
Date: 17 Sep 2001 05:10:47 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: How can I find the PID's of my children?
Message-Id: <1000703447.343647@elaine.furryape.com>
In article <a2lmptoicjmkoqe5h77drasgsfsbslavlu@news.supernews.net>,
Bernie Cosell <bernie@fantasyfarm.com> wrote:
>Well, ignoring matters of whether this is the right way to have organized
>the program, when I needed to do this I used /proc. /proc isn't portable
>to all OSs, but if your OS _has_ /proc, then *this* part of it should be
>pretty standard:
> open (S, "/proc/$pid/stat") or return undef ;
No, it isn't. Solaris (at least 2.6, which happens to be what I have
handy) has /proc, but no /proc/[pid]/stat
------------------------------
Date: Mon, 17 Sep 2001 19:21:14 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: How can I find the PID's of my children?
Message-Id: <slrn9qbg4a.jr6.mgjv@martien.heliotrope.home>
On Sun, 09 Sep 2001 07:44:28 -0400,
Bernie Cosell <bernie@fantasyfarm.com> wrote:
> stanb@panix.com (Stan Brown) wrote:
>
> } However, I'm going to leave the user the option of canceling from an "exit"
> } button on the main window. So I need to be able to send a kill() signal to
> } my children.
> }
> } Short of making these PID's global variables, when they are spwned, how can
> } I detrmine what children, my runing perl process is the parent of?
>
> Well, ignoring matters of whether this is the right way to have organized
> the program, when I needed to do this I used /proc. /proc isn't portable
> to all OSs, but if your OS _has_ /proc, then *this* part of it should be
> pretty standard:
\begin{offtopic}
I think you're being a bit too optimistic about the portability of proc,
the contents of that directory, and the contents of the files in that
directory. They're pretty much very system dependent, and not always
readable as text either. if you use /proc, you should be prepared to
change the code dealing with it for each OS on which it is available.
\end{offtopic}
Martien
--
Martien Verbruggen | Since light travels faster than
Interactive Media Division | sound, isn't that why some people
Commercial Dynamics Pty. Ltd. | appear bright until you hear them
NSW, Australia | speak?
------------------------------
Date: Mon, 17 Sep 2001 08:30:47 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: How can I find the PID's of my children?
Message-Id: <7tqbqt4cdlrgbtbfr7vo2l6tv7dt29msjm@news.supernews.net>
mgjv@tradingpost.com.au (Martien Verbruggen) wrote:
} On Sun, 09 Sep 2001 07:44:28 -0400,
} Bernie Cosell <bernie@fantasyfarm.com> wrote:
} > stanb@panix.com (Stan Brown) wrote:
} >
} > } However, I'm going to leave the user the option of canceling from an "exit"
} > } button on the main window. So I need to be able to send a kill() signal to
} > } my children.
} > }
} > } Short of making these PID's global variables, when they are spwned, how can
} > } I detrmine what children, my runing perl process is the parent of?
} >
} > Well, ignoring matters of whether this is the right way to have organized
} > the program, when I needed to do this I used /proc. /proc isn't portable
} > to all OSs, but if your OS _has_ /proc, then *this* part of it should be
} > pretty standard:
}
} \begin{offtopic}
}
} I think you're being a bit too optimistic about the portability of proc,
} the contents of that directory, and the contents of the files in that
} directory.
Guilty as charged, sigh. I had thought that much as with many of the other
Unix modules that this was pretty standard across 'flavors'.. obviously
not... BUT: if your particular flavor of Unix *does* have
/proc/<pid>/stat, then that code will probably work fine.
> ..if you use /proc, you should be prepared to
} change the code dealing with it for each OS on which it is available.
Yup. I would hazard that probably any flavor of Unix that provides /proc
will have the parent pid *someplace* in the proc info for each process.
You'd have to dig through the docs, figure it out, and then tweak that part
of the little loop...
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Mon, 17 Sep 2001 06:49:44 -0000
From: "B. Caligari" <bcaligari@fireforged.com>
Subject: Re: Javadoc alike
Message-Id: <9o460o01md7@enews3.newsguy.com>
"* Tong *" <sun_tong@users.sourceforge.net> wrote in message
news:sa8u1y27at0.fsf@suntong.personal.users.sourceforge.net...
> Hi,
>
> Is there any well-known tool for Perl as Javadoc to Java?
> How popular they are? (I assume there are more than one)
Check out the "perlpod" documentation.
http://www.perldoc.com/perl5.6/pod/perlpod.html
B.
------------------------------
Date: Mon, 17 Sep 2001 14:22:38 +0200
From: "Hansgeorg Zauner" <hg_zauner@gmx.de>
Subject: Re: Lotus Notes
Message-Id: <9o4pr1$ajmmi$1@ID-45951.news.dfncis.de>
Dale, Steve, thank you for your suggestions!
All I want to do is to sequentially read a complete table into one or more
hash variables. I will ask my Notes Admin for supported interfaces.
btw: I think the performance of Notes is always disappointing =:- }
Hansgeorg
------------------------------
Date: 17 Sep 2001 12:57:11 +0100
From: brianr@liffe.com
Subject: Re: parsing large DNA files into smaller files
Message-Id: <vt8zfe1148.fsf@liffe.com>
Have you checked CPAN for modules that may help you with DNA sequences?
Try something like http://search.cpan.org/search?mode=module&query=DNA
HTH
--
Brian Raven
There ain't nothin' in this world that's worth being a snot over.
-- Larry Wall in <1992Aug19.041614.6963@netlabs.com>
------------------------------
Date: Mon, 17 Sep 2001 12:16:50 GMT
From: Gary <gamtci1@mpinet.net>
Subject: Peek and Poke on Perl?
Message-Id: <3BA5E973.1005@mpinet.net>
I have built some circuit boards which reside at one of the classic
PC locations of a000, b000, c000, d000 or e000. I have been using
(as was the intention) DOS to operate the board and have written
a driver for it. During the time I was designing and building these
boards I was introduced to Perl. I decided to use Perl and Tk to
create an "applications generator" for the boards. That is, a user
may select from various options, etc. The application runs fine.
In fact, Perl has impressed me so much that I have been thinking to
give it a try running the boards also. What I need in order to do
that are two functions identical to "peek" and "poke". I know Windows
is running protected mode, so one can't simply peek and poke. Is
there a module available for Perl which provides such functionality?
I have searched CPAN and a general web search, but either must be
entering the wrong search criteria or perhaps, it doesn't exist.
Any help on locating such a module would be greatly appreciated.
Thanks in advance.
remove the number 1 in reply address to email
------------------------------
Date: 17 Sep 2001 02:25:25 -0700
From: nial@nial.org (Nial Stewart)
Subject: Perl access to Inportb / Outportb
Message-Id: <2fa6fff6.0109170125.65ed0d4e@posting.google.com>
I'm a hardware engineer who's recently discovered Perl.
It's really useful to be able to knock up quick test scripts to allow
fast debugging before I've any software support. I recently sussed
out how to drive the serial port, but I needed a method of driving
an Inportb / Outportb type direct hardware access.
I'd read about XS, but as a hardware engineer that seemed to involve a
lot of messing about with compilers/make files that I didn't have
access to or experience of.
While reading through perldocs I read that you can capture whatever
a programme sends to STDOUT by invoking it with backticks.
I wrote and compiled the following TurboC programme
/* Inportb.c */
#include <bios.h>
#include <stdio.h>
#include <dos.h>
main(int argc, char *argv[])
{
unsigned int input;
char *termn;
unsigned char result;
input = strtol(argv[1],&termn,0); /* converts the input string to an int */
result = inportb(input);
printf("%d",result);
return;
}/* End of main Inportb.c */
This creates a minimal inportb.exe which inputs a byte from the address
specified and prints it.
In a Perl script ...
$result = `inportb $address`;
print "Address $address contains value $result";
... works brilliantly.
The same method can be used for driving an outportb.
If anyone wants inportb.exe/outportb.exe send me an email, although
for your own peace of mind it's probably better to build them
yourself.
Nial Stewart.
------------------------------
Date: Mon, 17 Sep 2001 14:09:20 +0200
From: "Alexander Farber (EED)" <eedalf@eed.ericsson.se>
Subject: Re: Perl access to Inportb / Outportb
Message-Id: <3BA5E7F0.3735F515@eed.ericsson.se>
Nial Stewart wrote:
> I wrote and compiled the following TurboC programme
>
> /* Inportb.c */
> #include <bios.h>
> #include <stdio.h>
> #include <dos.h>
> main(int argc, char *argv[])
> {
> unsigned int input;
> char *termn;
> unsigned char result;
> input = strtol(argv[1],&termn,0); /* converts the input string to an int */
> result = inportb(input);
> printf("%d",result);
> return;
> }/* End of main Inportb.c */
Ahh, TurboC... These were the days :-)
------------------------------
Date: Mon, 17 Sep 2001 09:20:26 +0200
From: Jakub Wosko <wosko@lucent.com>
Subject: perl signature...
Message-Id: <3BA5A43A.20398EBD@lucent.com>
Hallo,
this is perl signature of R. van Zuijlen,
can anyone "translate" it?
----------------
#!/usr/bin/perl
++$_;
$_+=$_+++$_;
$!=$_+$_;
($:,$,,$/)=$!=~/.(.).(.)(.)/;
$_+=$_+++$_+$_;
($^,$\,$~)=($!=$_)=~/(.) (.).*(.)$/; $_-=$_;
$|=++$_;$_++;
`$^$,$/$: $\$~ $|>&$_`
----------------
- kuba -
------------------------------
Date: Mon, 17 Sep 2001 10:28:12 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: perl signature...
Message-Id: <1vcbqtcengpd8uhtju8tsu4bbockja339v@4ax.com>
On Mon, 17 Sep 2001, Jakub Wosko <wosko@lucent.com> wrote:
>this is perl signature of R. van Zuijlen,
>can anyone "translate" it?
#!/usr/bin/perl
# $_ is undef
++$_;
# evaluates to 1
$_+=$_+++$_;
# $_++ + $_ => 1 (and $_ becomes 2) + 2 => 3
# $_ += 3 => $_ = 2 + 3 = 5
$!=$_+$_;
# $! = 10
($:,$,,$/)=$!=~/.(.).(.)(.)/;
# $! is used in a non-numerical context, so it evaluates
# to the descriptive message associated with an errno of 10.
# On Linux/Win32 it's "No child processes"
# This sets $: => o
# $, => c
# $/ => h
$_+=$_+++$_+$_;
# 5 ($_ becomes 6) + 6 + 6
# $_ = 6 + 5 + 6 + 6 = 23
($^,$\,$~)=($!=$_)=~/(.) (.).*(.)$/;
# Sets $! to 23, "Too many open files in system"
# This string is matched against the pattern giving
# $^ => o (since next char must be a blank)
# $\ => m (since it's the first char after the blank)
# $~ => m (since that's the last char in the string)
$_-=$_;
# clears $_ to 0
$|=++$_;$_++;
# $| = 1; $_ = 2
`$^$,$/$: $\$~ $|>&$_`
#`ocho mm 1>2`
This doesn't do anything meaningful on my system.
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Mon, 17 Sep 2001 11:21:35 +0200
From: Jakub Wosko <wosko@lucent.com>
Subject: Re: perl signature...
Message-Id: <3BA5C09F.3B44E3F2@lucent.com>
> This doesn't do anything meaningful on my system.
In my system it produce two letters: "tw".
I have solaris.
THX:
- kuba -
Thomas B=E4tzler wrote:
> =
> On Mon, 17 Sep 2001, Jakub Wosko <wosko@lucent.com> wrote:
> >this is perl signature of R. van Zuijlen,
> >can anyone "translate" it?
> =
(...)
> =
> This doesn't do anything meaningful on my system.
------------------------------
Date: Mon, 17 Sep 2001 12:17:57 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: perl signature...
Message-Id: <pqibqtc8r43b8sm2nnkftl1b0bgp5jvr5t@4ax.com>
On Mon, 17 Sep 2001, Jakub Wosko <wosko@lucent.com> wrote:
>> This doesn't do anything meaningful on my system.
>In my system it produce two letters: "tw".
>I have solaris.
Ah!
Considering this code sample that'll print the errors associated with
errnos 10 and 23:
#!/usr/bin/perl -w
use strict;
foreach ( 10, 23 ){
$! = $_;
print "$_: $!\n";
}
Perl 5.6 on SunOS 5.7 and Perl 5 (5.005_03) on HP/UX 10.20
10: No child processes
23: File table overflow
Perl 5.6.1 on Win32 and Perl 5 (5.005_03) on Debian GNU/Linux 2.2R3
10: No child processes
23: Too many open files in system
My reading was based on the latter.
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: 17 Sep 2001 01:03:24 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: Re: Similar file finder
Message-Id: <sa8pu8q79bn.fsf@suntong.personal.users.sourceforge.net>
Thank you Ilmari and Bart for your feedback.
Bart Lateur <bart.lateur@skynet.be> writes:
> * Tong * wrote:
>
> >What's in my mind is much more powerful than it. It can not only
>
> It sounds like you're trying to reinvent what Napster calls the
> "fingerprinting technology". And it seems to me that that isn't exactly
> simple. No, I'm not an insider.
>
> So let's say you want to recognize files of the same audio track, or
> image files at a different resolution. So what can you do? First,
No I'm not planing to be that fancy. I'm going to make the guess
only based on the file name and file size.
I'd be happy enough if my program can pick out the following (among
thousands of files) as similar file candidates:
andie macdowell.jpg 8k
Andy macddowel.gif 12k
As to the algorithm, I'm going to map each individual word in file
name into soundex, and use term vector (I borrow this term and
thought from the famous TF/IDF information retrieval algorithm for
similarity calculation) to determine the similarity between
files. Generally it means that if there are n files, each having
approximately m words, the degree of calculation is
O(n^2 * m)
File size is also taken into consideration.
How is that?
--
Tong (remove underscore(s) to reply)
*niX Power Tools Project: http://xpt.sourceforge.net/
- All free contribution & collection
------------------------------
Date: Mon, 17 Sep 2001 09:14:14 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Similar file finder
Message-Id: <mhfbqtsvcl9fq1vk84vn0hu0mb99q4mrvj@4ax.com>
* Tong * wrote:
>I'd be happy enough if my program can pick out the following (among
>thousands of files) as similar file candidates:
>
>andie macdowell.jpg 8k
>Andy macddowel.gif 12k
But there isn't a clearcut connection between the file sizes of .jpg and
.gif.
You'd better check out Image::Size, which allows you to look up the
dimensions of the pictures, and compare those. Taking resizing into
account, I'd think that the ratio of height over width is even more
important than the exact values themselves.
--
Bart.
------------------------------
Date: Mon, 17 Sep 2001 13:13:34 +0100
From: Stephen Baynes <stephen.baynes@soton.sc.philips.com>
Subject: Re: Similar file finder
Message-Id: <3BA5E8EE.CAE434D6@soton.sc.philips.com>
* Tong * wrote:
> I'd be happy enough if my program can pick out the following (among
> thousands of files) as similar file candidates:
>
> andie macdowell.jpg 8k
> Andy macddowel.gif 12k
>
> As to the algorithm, I'm going to map each individual word in file
You may want to give more weight to the first word in the name
as fred.c and fred.o are more likely to be connected than sue.jpg and joe.jpg.
--
Stephen Baynes CEng MBCS Stephen.Baynes@soton.sc.philips.com
Philips Semiconductors Ltd
Southampton SO15 0DJ +44 (0)23 80316431
United Kingdom My views are my own.
------------------------------
Date: 17 Sep 2001 07:56:57 -0400
From: stanb@panix.com (Stan Brown)
Subject: TK::filevent, and Tk::update
Message-Id: <9o4oe9$63f$1@panix3.panix.com>
I'm still fighting with keeping Tk::fileevent from completly absorbing all
my cpu cycles. I posted here a few days back, and recieved a nice reply
sugesting several things to do a google search for.
I would have sworn I kept that message, but now I can't find it. Could
someone point me in a direction of how to address this issue?
Also can anyone point me to some docs on Tk::update? it seems to be
changing the program's flow contr of control when called from a callback
(fileveevent), and I can't seem to find the magic phase to get perdoc to
divulge any info on this call. Also the cross rferences in the O'Reilly
book to this function seem to point to the wrong places :-)
Thanks for any help on this.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1759
***************************************