[17937] in Perl-Users-Digest
Perl-Users Digest, Issue: 97 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 19 09:05:40 2001
Date: Fri, 19 Jan 2001 06:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979913110-v10-i97@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 19 Jan 2001 Volume: 10 Number: 97
Today's topics:
$ problem <marekpow@yahoo.com>
Re: $ problem (Bernard El-Hagin)
Re: $ problem (Damian James)
Re: $ problem (Abigail)
Re: $ problem <ans@_nospam_x64.net>
ANNOUNCE: Inline 0.31 <BrianI@ActiveState.com>
ANNOUNCE: Spreadsheet::WriteExcel 0.25 (John McNamara)
ANNOUNCE: Tie::RangeHash v0.42 released <wlkngowl@unix.asb.com>
Re: FAQ 9.15: How do I decode a CGI form? <nospam@nospam.com>
Re: FAQ 9.15: How do I decode a CGI form? (Damian James)
Re: flock (Anno Siegel)
hash key order <berndt.zeitler@tu-berlin.de>
Re: hash key order (Bernard El-Hagin)
Re: Hello. I'm back. <bart.lateur@skynet.be>
Re: Hello. I'm back. jdf@pobox.com
Re: Hello. I'm back. jdf@pobox.com
help with 4-arg select <rlogsdon@eris.io.com>
Re: help with 4-arg select <rlogsdon@eris.io.com>
Re: How can I send my file to the printer in win98 by a <gracenews@optusnet.com.au>
Re: List Current Processes in Win32 <davesisk@ipass.net>
Re: Mailing attachments? (Rand Simberg)
Re: More questions about pattern matching (Peter J. Acklam)
Multiple interpreters in different threads sunvenu@my-deja.com
Multiprocess or multithreaded??? <davesisk@ipass.net>
Re: Perl script problem nobull@mail.com
Re: Perl script problem (Bernard El-Hagin)
Re: Writing Unix-format files on NT <matt@sergeant.org>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 19 Jan 2001 12:08:03 +0000 (UTC)
From: "MaxyM" <marekpow@yahoo.com>
Subject: $ problem
Message-Id: <01c08210$5866e5c0$0100007f@default>
Hi
For example:
my $na="name: 12345";
How to print only numbers (and ignore letters), so when I print:
print "$na";
I'd like to get something like:
12345
and not
name: 12345
Please help!
------------------------------
Date: Fri, 19 Jan 2001 12:18:19 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: $ problem
Message-Id: <slrn96gc4a.2q0.bernard.el-hagin@gdndev25.lido-tech>
On Fri, 19 Jan 2001 12:08:03 +0000 (UTC), MaxyM <marekpow@yahoo.com>
wrote:
>Hi
>
>For example:
>
>my $na="name: 12345";
>
>How to print only numbers (and ignore letters), so when I print:
>print "$na";
>
>I'd like to get something like:
>12345
>
>and not
>name: 12345
my $na = "name: 12345";
$na =~ tr/[0-9]//cd;
print $na;
Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'
------------------------------
Date: 19 Jan 2001 12:33:12 GMT
From: damian@puma.qimr.edu.au (Damian James)
Subject: Re: $ problem
Message-Id: <slrn96gd1k.kmn.damian@puma.qimr.edu.au>
Thus spake MaxyM on Fri, 19 Jan 2001 12:08:03 +0000 (UTC):
>For example:
>my $na="name: 12345";
>
...[snip] op says 'print $na;'
>I'd like to get something like:
>12345
>
>and not
>name: 12345
>
Well, you could either use a hash instead:
my %na = ();
%na{name} = "12345";
in which case to get the same string you specified above you'd say:
print $_, ": $_{name}" for keys %na;
or if you must store a scalar, try a regex:
my $na = "name: 12345";
print $na, "\n";
$na =~ s/name: (.*)/$1/;
print $na;
or to be more generic:
my $na = "name: 12345";
my %na = split /: /, $na;
print $na{name};
HTH
Cheers,
Damian
------------------------------
Date: 19 Jan 2001 12:43:28 GMT
From: abigail@foad.org (Abigail)
Subject: Re: $ problem
Message-Id: <slrn96gdjg.inj.abigail@tsathoggua.rlyeh.net>
MaxyM (marekpow@yahoo.com) wrote on MMDCXCVIII September MCMXCIII in
<URL:news:01c08210$5866e5c0$0100007f@default>:
-: Hi
-:
-: For example:
-:
-: my $na="name: 12345";
-:
-: How to print only numbers (and ignore letters), so when I print:
-: print "$na";
-:
-: I'd like to get something like:
-: 12345
print $na =~ /(\d+)/;
Abigail
--
perl -wle'print"Κυστ αξοτθες Πεςμ Θαγλες"^"\x80"x24'
------------------------------
Date: Fri, 19 Jan 2001 13:47:04 GMT
From: "Anson Parker" <ans@_nospam_x64.net>
Subject: Re: $ problem
Message-Id: <szX96.71029$xW4.550431@news-server.bigpond.net.au>
MaxyM <marekpow@yahoo.com> wrote in message
news:01c08210$5866e5c0$0100007f@default...
> Hi
>
> For example:
>
> my $na="name: 12345";
>
> How to print only numbers (and ignore letters), so when I print:
> print "$na";
>
> I'd like to get something like:
> 12345
To keep the match relatively flexible i'd use something like the following (one
you've assigned $na):
$na =~ s/name:\s*(.+)/$1/i;
This ignores the case of "name" so would match "Name: 12345" or "nAmE: 12345"
and allows for any number of whitespace between "name:" and "12345" which I
presume would probably not be a number. It's always helpful with regex if you
provide information on what the text you want to match will consist of in the
real
world.
cheers,
Anson.
--
foreach (unpack 'C*','aonjixfghklceyrqtuwxvdbpz') {
print substr 'Jerk not the surreal chap!',$_-97,1;}
------------------------------
Date: Fri, 19 Jan 2001 10:49:22 GMT
From: Brian Ingerson <BrianI@ActiveState.com>
Subject: ANNOUNCE: Inline 0.31
Message-Id: <t6ghl6c7l24720@corp.supernews.com>
Inline.pm version 0.31 has been uploaded to CPAN.
So has Inline::CPR version 0.11.
New versions of Inline::Python and Inline:CPP will follow in the next
couple of days.
From the README:
INTRODUCTION:
Inline.pm - Write Perl subroutines in other programming languages.
Inline lets you write Perl subroutines in other programming languages
like C. You don't need to compile anything. All the details are
handled transparently so you can just run your Perl script like normal.
Example:
use Inline C => <<'END';
SV* JAxH(char* x) {
return newSVpvf ("Just Another %s Hacker",x);
}
END
print JAxH('Inline'), "\n";
When run, this complete program prints:
Just Another Inline Hacker
The one line version is:
perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf("Just
Another %s H
acker",x);}};print JAxH+Inline'
-------------------------------------------------------------------------------
FEATURES:
Inline version 0.31 is a minor upgrade with the following changes:
+ "use Inline C;" is now a synonym for "use Inline C => DATA;"
+ Default build/install directory changed from "blib_I/" to ".Inline/"
+ Build/Install directory structure simplified.
+ Short install paths.
+ Build areas in ".Inline/build/" subdirectory.
+ Added 'CC', 'CCFLAGS', 'LD', and 'LDFLAGS' config options to C.
+ More recipes in Cookbook.
Inline version 0.30 is a major upgrade from previous verions. It includes:
+ Integrated support for typemap files in C.
+ All the recognized types now come *only* from typemaps.
+ The default types come from the default typemap installed with
core Perl.
+ Typemaps are used to modify the Parse::RecDescent grammar for
parsing C.
+ This means you can easily use your existing typemaps.
+ Language support completely separated from base Inline code.
+ Beta supoort for C (Inline::C, included)
+ Alpha support for C++ (Inline::CPP, available separately)
+ Alpha support for Python (Inline::Python, available separately)
+ Support for 'embedding' Perl in C with my new programming
language, CPR.
(Inline::CPR, available separately) This one may warp your mind :^)
+ Simple API for adding your own language support.
+ Write your own Inline::Foo
+ Write your own implementation of Inline::C, or just modify
Inline::C::grammar.
+ Support for interpreted languages in addition to compiled ones.
+ Autodetection of new Inline language modules.
+ Much easier and more powerful configuration syntax.
+ More XS and MakeMaker features exposed for configuration (for C
and C++).
+ Flexible new syntax for specifying source code.
+ Use DATA section for AutoLoader, Inline, and POD simultaneously.
+ Support for using Inline 'with' other modules.
+ "use Inline with 'Event';" lets Event.pm pass config info to Inline.pm.
+ Event.pm 0.80 has built in support for Inline.pm 0.30 and higher.
+ Write Event callbacks in C with extreme ease.
+ More documentation
+ perldoc Inline
+ perldoc Inline-FAQ
+ perldoc Inline-API
+ perldoc Inline::C
+ perldoc Inline::C-Cookbook
+ Better error messages and easier debugging.
+ Mailing list: inline@perl.org
Other features of Inline.pm include:
= Automatically compiles your source code and caches the shared object.
= Automatically DynaLoads the shared object and binds it to Perl.
= Recompiles only when the C code changes.
= Changing the Perl code will not cause a recompile of the C code.
= Support for writing extension modules, suitable for distributing to
the CPAN.
= Support for generating and binding Inline subs at run time. <bind()>
= Works on all Unix and MS Windows configurations.
-------------------------------------------------------------------------------
INSTALLATION:
This module requires the Digest::MD5 and Parse::RecDescent modules. It
also requires the appropriate C compiler. (Where appropriate means the
one referred to in your Config.pm)
To install Inline do this:
perl Makefile.PL
make
make test
make install
On ActivePerl for MSWin32, use nmake instead of make. Or just use:
ppm install Inline
For convenience, Inline::C is packaged with Inline, and will be
automatically installed as well.
-------------------------------------------------------------------------------
INFORMATION:
= For more information on Inline, see 'perldoc Inline' and 'perldoc
Inline-FAQ'
= For information about Inline::, see 'perldoc Inline::C' and
'perldoc Inline::C-Cookbook'
= For information on writing your own Inline extension see 'perldoc
Inline-API'
= For information about the Perl5 internal C API, see 'perldoc perlapi' or
try http://www.perldoc.com/perl5.6/pod/perlapi.html
= The Fall 2000 edition of The Perl Journal has an article about Inline
The Inline.pm mailing list is inline@perl.org. Send email to
inline-subscribe@perl.org to subscribe.
Please send questions and comments to "Brian Ingerson" <INGY@cpan.org>
Copyright (c) 2001, Brian Ingerson. All Rights Reserved.
------------------------------
Date: Fri, 19 Jan 2001 00:50:35 GMT
From: jmcnamara@cpan.org (John McNamara)
Subject: ANNOUNCE: Spreadsheet::WriteExcel 0.25
Message-Id: <t6ghlilt58hp25@corp.supernews.com>
ANNOUNCE
Spreadsheet::WriteExcel version 0.25 has been uploaded to CPAN.
NAME
Spreadsheet::WriteExcel - Write formatted text and numbers to a
cross-platform Excel binary file.
CHANGES
Minor 0.25 Jan 19 2001
Changed distro file format back to Unix line endings. The
accidental DOS format was causing install problems.
Minor 0.24 Jan 14 2001
Added write_url method.
Added set_merge() alias for set_align('merge') method.
Added warnings about deprecated code when running under -w flag.
Documentation changes.
DESCRIPTION
This module can be used to write numbers and text in the native
Excel binary file format. Multiple worksheets can be added to a
workbook. Formatting can be applied to cells.
The Excel file produced by this module is compatible with Excel 5,
95, 97 and 2000.
The module will work on the majority of Windows, UNIX and
Macintosh platforms. Generated files are also compatible with the
Linux/UNIX spreadsheet applications Star Office, Gnumeric and
XESS. The generated files are not compatible with MS Access.
This module cannot be used to read an Excel file. See
Spreadsheet::ParseExcel or look at the main documentation for some
suggestions.
INSTALLATION
Download the zipped tar file from:
http://search.cpan.org/search?dist=Spreadsheet-WriteExcel
Unzip the module as follows or use winzip:
tar -zxvf Spreadsheet-WriteExcel-0.25.tar.gz
The module can be installed using the standard Perl procedure:
perl Makefile.PL
make
make test
make install # You may need to be root
make clean # or make realclean
Windows users without a working "make" can get nmake from:
ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe
ActivePerl users can use PPM as follows:
C:\> ppm
PPM> set repository tmp http://homepage.eircom.net/~jmcnamara/perl
PPM> install Spreadsheet-WriteExcel
PPM> quit
C:\>
NOTE: Version 0.23 changed the WriteExcel namespace. To tidy up
stray files it would be best to uninstall any older versions older
than this prior to installation.
VERSION
This document refers to version 0.25 of Spreadsheet::WriteExcel,
released Jan 19, 2001.
AUTHOR
John McNamara (jmcnamara@cpan.org)
--
"The Mosaic code has replaced the law of the jungle."
James Joyce - Ulysses
------------------------------
Date: Wed, 17 Jan 2001 23:07:53 -0500
From: Robert Rothenburg <wlkngowl@unix.asb.com>
Subject: ANNOUNCE: Tie::RangeHash v0.42 released
Message-Id: <t6ghlta41h3c29@corp.supernews.com>
NAME
Tie::RangeHash - Implements "range hashes" in Perl
REQUIREMENTS
`Tie::RangeHash' is written for and tested on Perl 5.6.0.
It uses only standard modules.
The test suite will use `Time::HiRes' if it is available.
Installation
Installation is pretty standard:
perl Makefile.PL
make
make test
make install
HISTORY
Changes since Tie::RangeHash v0.41
0.42 17 Jan 2001
- modified test suite to compare adding sequential nodes with
randomly shuffled nodes in timings
- changed 'die' to 'croak' in TIEHASH method
- changed internal object from hash to array
- other optimizations
- fixed typos in comments and POD
- renamed some fields/variables for clarity
- added TYPE_USER comparison type for consistency
SYNOPSIS
use Tie::RangeHash;
tie %hash, 'Tie::RangeHash';
$hash{'A,C'} = 1;
$hash{'D,F'} = 2;
$hash{'G,K'} = 3;
$hash{'E'}; # returns '2'
$hash{'BB'}; # returns '1'
$hash{'KL'}; # returns nothing ('undef')
DESCRIPTION
This module allows hashes to associate a value with a *range* of
keys
rather than a single key.
More detailed descriptions are available in the documentation and
README.
AVAILABILITY
It should show up soon at a CPAN mirror near you in as:
$CPAN/authors/id/R/RR/RRWO/Tie-RangeHash-0.42.tar.gz
------------------------------
Date: 19 Jan 2001 11:18:22 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: FAQ 9.15: How do I decode a CGI form?
Message-Id: <9497pu$5mq$0@216.155.33.20>
In article <3A67E7F8.C751D825@la.znet.com>, Kira <callgirl@la.znet.com>
wrote:
| Chris Fedde drooled:
|
| > Kira, in her usual unique style, quipped:
| > > PerlFAQ Server blathered:
|
| > >> How do I decode a CGI form?
|
| > >> You use a standard module, probably CGI.pm. Under no
| > >> circumstances
| > >> should you attempt to do so by hand!
|
| > >(snipped)
|
| > >Total pile of Mule Manure. Posting this type of garbage
| > >is an affront to all decent programmers.
|
| > >Godzilla!
|
| > greetings oh great salimander.
|
| I am not a salamander. I am a variant on a spit fire lizard.
| ^
|
| > It's good to see you back.
|
| This is doubtful.
|
|
| > Please make yourself at home.
|
| Do you mind? My personal life is private.
|
|
| > BTW feel free to post repairs to the FAQ....
|
| I already have.
|
|
| > This space intentionally left blank
|
| I doubt this space between your ears is intentional.
| You still need to improve on your faking it. This
| is too obvious, Sybil.
You know, I used to be entertained by this... alas, no more.
I used to hold to some (now forlorn) hope that this person would
eventually gain some real working knowledge, and social skills
commensurate with same... alas, no more.
I had hoped that the long absence (which perhaps only I percieved, as I
am an infrequent reader here due to real life considerations) was
serving to temper and refine said personality... no can do, kimo sabe.
"Be that word our sign of parting, bird or fiend!" I shrieked,
upstarting -
"Get three back into the tempest and the Night's Plutonian shore!
Leave no black post as a token of that lie thy soul hath spoken!
Leave my USENET group unbroken! - quit the bust above my door!
Take thy beak from out my heart, and take thy form from off my door!"
Quoth Godzila "Nevermore."
And Godzilla, never flitting, still is sitting, still is sitting
On the pallid bust of Larry just above my monitor;
And its eyes have all the seeming of a demon's that is dreaming,
The monitor's light o'er it streaming throws its shadow on the floor;
And my soul from out that shadow that lies floating on the floor
Shall be lifted .... with a heartfelt PLONK[1]! :D
you have my permission to drown yourself in your own vitriolic vehement
apoplexic bile, at your leisure, of course. I'll light a candle for you
in the church of aggressive beattitude and mutter a prayer to St.
Reptillicus next time I pass by..
--
"Some nights you can't get a drink on the cuff anyplace" - St. Reptillicus' 27th Epistle to the Greengrocer
[1] Apologies to the POE-tic master. It simply could not be resisted. Sorry for the visual inconsistencies. :)
------------------------------
Date: 19 Jan 2001 12:58:21 GMT
From: damian@puma.qimr.edu.au (Damian James)
Subject: Re: FAQ 9.15: How do I decode a CGI form?
Message-Id: <slrn96gego.kmn.damian@puma.qimr.edu.au>
Thus spake Kira on Thu, 18 Jan 2001 20:47:15 -0800:
>Damian James wrote:
>(my comments have been snipped and not noted by Mr. James)
>
Zounds! I am clearly outclassed. I may as well go home. Damn, I already
did (oh well). I can only apologise for not following the correct citation
style. I always thought ellipses were good enough.
>(snipped)
>
>Your comments are both single incident specific
>and contexually unrelated to my previous comments
>thus irrelevant.
>
Interestingly enough, what Kira chose to snip was my Messy Analogy for this
week (and I have resolved to post at least one Messy Analogy to clpm a
week this year):
DJ>You are suggesting that if somebody asks "How do I make my car go forward?",
DJ>the correct answer is not "Push the gas pedal", but "Open the hood, attach a
DJ>piece of string to the lever on the fuel valve (ignore or detach the cable
DJ>that's already attached to it), run the string inside through the firewall
DJ>to the driver's seat. Close the hood, start the engine, put the car in
DJ>Drive. Now pull on the string. Note that this might not work as expected
DJ>if you have a fuel-injected engine."
DJ>
DJ>This should foreground what the real problem is: a complete beginner
DJ>might not be able to tell which is better advice.
I admit it's not a very good analogy, which is why I call it messy.
However, analogies, like computing languages, are what you make of them.
>Godzilla!
Cheers!
Damian
------------------------------
Date: 19 Jan 2001 11:24:34 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: flock
Message-Id: <94985i$nak$3@mamenchi.zrz.TU-Berlin.DE>
Brian Pontz <pontz@NO_SPAM.channel1.com> wrote in comp.lang.perl.misc:
>I came across the below code on the web. My question is
>why do you need the seek(MBOX, 0, 2) ? It's my understanding that (on
>unix ) when you open a file for appending, you always write to the end
>of the file. It wouldnt matter if another program wrote to the end
>while you where waiting for the lock. Am I correct on this?
[code snipped]
True for Unix (any Unix?). I guess, seek() is a defensive measure
so make it more portable.
Anno
------------------------------
Date: Fri, 19 Jan 2001 12:10:14 +0100
From: "berndt zeitler" <berndt.zeitler@tu-berlin.de>
Subject: hash key order
Message-Id: <94977m$qpn$1@mamenchi.zrz.TU-Berlin.DE>
hi,
i want to get the keys off a hash, but in the order they where defined.
my code looks like this:
%group_titles =(profs,"Professor",assistants,"Wissenschaftlicher
Mitarbeiter",phdstudents,"Doktorand",guests,"Gast",scholarships,"Stipendiand
");
@group_title_keys = keys(%group_titles);
an @group_title_keys gives me:
profs scholarships guests assistants phdstudents
i need:
profs assistants phdstudents guests scholarships
the order in the hash def isn't the only thing the key order depends on.
i also get the same order using
while (($group_title_keys, group_title_value ) = each(%group_title)){}
ciao for now,
berndt
------------------------------
Date: Fri, 19 Jan 2001 11:15:21 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: hash key order
Message-Id: <slrn96g8e7.2q0.bernard.el-hagin@gdndev25.lido-tech>
On Fri, 19 Jan 2001 12:10:14 +0100, berndt zeitler
<berndt.zeitler@tu-berlin.de> wrote:
>hi,
>
>i want to get the keys off a hash, but in the order they where defined.
perldoc -q "How can I make my hash remember the order"
Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'
------------------------------
Date: Fri, 19 Jan 2001 11:19:28 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Hello. I'm back.
Message-Id: <uc8g6t0b50j9u1db48jiq34kjt6ius66ku@4ax.com>
jdf@pobox.com wrote:
> hello Larry Rosler
You hardly will find Larry Rosler here, any more. It has nothing to do
with burn-out or whatever: it's just that his current job specification
barely involves Perl, any more. See some of his last messages at Deja,
of at least several months ago. Yes, things like that happen too.
--
Bart.
------------------------------
Date: 19 Jan 2001 09:04:18 -0500
From: jdf@pobox.com
Subject: Re: Hello. I'm back.
Message-Id: <d7djeizh.fsf@pobox.com>
Bart Lateur <bart.lateur@skynet.be> writes:
> You hardly will find Larry Rosler here, any more. It has nothing to do
> with burn-out or whatever: it's just that his current job specification
> barely involves Perl, any more.
Hello, Bart! Yeah, that was actually part of my jumping ship; I became
JAJH, and am also teaching Java at the same place I'm teaching Perl.
I couldn't get Deja to cough up the answer to the mystery of Larry's
disappearance, though. Any clues?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 19 Jan 2001 09:06:53 -0500
From: jdf@pobox.com
Subject: Re: Hello. I'm back.
Message-Id: <ae8neiv6.fsf@pobox.com>
dha@panix6.panix.com (David H. Adler) writes:
> Welcome back Jonathan. Good to see you.
David, hello.
> You coming back to irc too, or is that even more exhausting? :-)
You could always
purl, be jdf
To tell you the truth, David, the time I used to spend on #perl is now
spent playing Team Fortress Classic. I know this makes me morally
vacant, but I can't help it.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 19 Jan 2001 11:46:07 GMT
From: Reuben Logsdon <rlogsdon@eris.io.com>
Subject: help with 4-arg select
Message-Id: <Pine.LNX.4.21.0101190541470.27821-100000@eris.io.com>
hi,
I need to request web pages from a remote site, and the remote site isn't
always there, but i can't let my perl script hang forever. so i want some
kind of way to test whether things'll work out before i commit myself to a
synchronous call like read(). in theory those things should time out but
in practice they don't - i've seen a perl script waiting patiently for
hours to complete a network activity.
the socket/bind/connect sequence is okay, i'm worried about read and
write. perl has the 4-part select for that, but the docs aren't really
clear at all. has anyone got a 4-part select to work? are there code
samples anywhere, docs, etc? or other approaches for safe network
communications?
--
Regards,
Reuben Logsdon
http://www.io.com/~rlogsdon/
------------------------------
Date: Fri, 19 Jan 2001 12:04:17 GMT
From: Reuben Logsdon <rlogsdon@eris.io.com>
Subject: Re: help with 4-arg select
Message-Id: <Pine.LNX.4.21.0101190603190.28396-100000@eris.io.com>
please disregard i figured it out; using IO::Select w/ sample code from
LWP
On Fri, 19 Jan 2001, Reuben Logsdon wrote:
> hi,
>
> I need to request web pages from a remote site, and the remote site isn't
> always there, but i can't let my perl script hang forever. so i want some
> kind of way to test whether things'll work out before i commit myself to a
> synchronous call like read(). in theory those things should time out but
> in practice they don't - i've seen a perl script waiting patiently for
> hours to complete a network activity.
>
> the socket/bind/connect sequence is okay, i'm worried about read and
> write. perl has the 4-part select for that, but the docs aren't really
> clear at all. has anyone got a 4-part select to work? are there code
> samples anywhere, docs, etc? or other approaches for safe network
> communications?
>
>
--
Regards,
Reuben Logsdon
http://www.io.com/~rlogsdon/
------------------------------
Date: Fri, 19 Jan 2001 23:05:53 +1000
From: "Jeffrey Grace" <gracenews@optusnet.com.au>
Subject: Re: How can I send my file to the printer in win98 by activeperl
Message-Id: <3a683bc0$0$15472$7f31c96c@news01.syd.optusnet.com.au>
"Jeffrey Grace" <gracenews@optusnet.com.au> wrote in message
news:3a66e236$0$15464$7f31c96c@news01.syd.optusnet.com.au...
>
> On a related note, if I use the -T option on the shebang line (eg: #!
> /perl/bin/perl -Tw) I get the following error: Too late for "-T" option at
> test.pl line 1.
>
Ignore this, I was using perl test.pl to run the file, so of course the
option in test.pl would be too late. Need more sleep.
--
Jeffrey Grace
~~~~~~~~~~~~~~~~~~~~
Queensland, Australia
------------------------------
Date: Fri, 19 Jan 2001 12:27:47 GMT
From: "David Sisk" <davesisk@ipass.net>
Subject: Re: List Current Processes in Win32
Message-Id: <7pW96.6185$Kl5.784157@typhoon.southeast.rr.com>
If you have the NT Reskit installed, you can use PULIST.EXE or TLIST.EXE to
get a list of O/S processes.
Regards,
Dave
jg <Jerry_Geist@infinium.com> wrote in message
news:9477qg$71l$1@whqnews01.infinium.com...
> Can someone point me in the direction of how to get the entire list of
> processes which are showing in the Windows NT Task Manager into a list.
> After I close a program, it sometimes leaves child tasks running and I
need
> to check and see whether it exists or not.
>
> Thanks .
>
>
------------------------------
Date: Fri, 19 Jan 2001 12:51:49 GMT
From: simberg.interglobal@trash.org (Rand Simberg)
Subject: Re: Mailing attachments?
Message-Id: <3a683850.43760038@nntp.ix.netcom.com>
On Fri, 19 Jan 2001 21:15:42 +1100, in a place far, far away, "Ron
Savage" <ron@savage.net.au> made the phosphor on my monitor glow in
such a way as to indicate that:
>And if all else fails, see: http://savage.net.au/Perl-tutorials.html#tut-2
OK, I'll check that out, too. Thanks to everyone for the suggestions.
************************************************************************
simberg.interglobal.org * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)
interglobal space lines * 307 733-1715 (Fax) http://www.interglobal.org
"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ and throw out the "@trash." to email me.
Here's my email address for autospammers: postmaster@fbi.gov
------------------------------
Date: 18 Jan 2001 19:48:39 +0100
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: More questions about pattern matching
Message-Id: <wkofx466ig.fsf@math.uio.no>
Chris Stith <mischief@velma.motion.net> writes:
> #####################################################
> #!/usr/bin/perl -w
> use strict;
> my $good_ip = 0;
> [...]
> ###############################################
Creating a regex that matches the integers from 0 to 255 is easy:
[0-1]?[0-9]?[0-9] # 0 .. 199
| 2[0-4][0-9] # 200 .. 249
| 25[0-5] # 250 .. 255
So a regex that matches an IP address would be
\A
(?: [0-1]?[0-9]?[0-9] | 2[0-4][0-9] | 25[0-5] )
( \. (?: [0-1]?[0-9]?[0-9] | 2[0-4][0-9] | 25[0-5] ) ) {3}
\z
Peter
--
$\="\n";$_='The quick brown fox jumps over the lazy dog';print +(split
//)[20,5,24,31,3,36,14,12,31,1,2,11,9,23,33,29,35,15,32,36,7,8,28,29];
------------------------------
Date: Fri, 19 Jan 2001 13:43:02 GMT
From: sunvenu@my-deja.com
Subject: Multiple interpreters in different threads
Message-Id: <949g94$bdl$1@nnrp1.deja.com>
Hi,
I am using Perl5.6 with MULTIPLICITY option. I am trying to create an
interpreter per thread.
Sample code looks like this :
perl_construct, perl_alloc, etc;
perl_parse();
dTHX;
dSP; // Initialize Stack Pointer
ENTER; // Arguments pushed after this
SAVETMPS; // ... is a temporary variable
PUSHMARK(SP); // remember the stack pointer
SV* pSV;
pSV = sv_newmortal();
char *ptrName = "SomePtr";
sv_setref_pv(pSV, ptrName, inCDWrapper);
XPUSHs(pSV);
PUTBACK;
status = perl_call_pv("compose", G_EVAL|G_SCALAR);
if (status != 1) {
perl_destruct(perlInterp);
perl_free(perlInterp);
return;
}
if (SvTRUE(GvSV(PL_errgv)))
{
.....
First problem I have is, it dumps core at the statement SvTRUE(GvSV
(PL_errgv). When I look at PL_errgv through dbx, it is (nil). Without
MULTIPLICITY option, this used to work fine.
Second problem I have is, when I am running multiple threads, and
having the same perl file to be parsed through different interpreters.
Only first interpreter is going through the perl_call successfully.
Other threads are failing at the perl_parse saying that "can't locate
var...."
I would appreciate any kind of help with the MULTIPLICITY option.
Thanks
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Fri, 19 Jan 2001 12:21:43 GMT
From: "David Sisk" <davesisk@ipass.net>
Subject: Multiprocess or multithreaded???
Message-Id: <rjW96.6183$Kl5.781522@typhoon.southeast.rr.com>
I have a batch job that will start as a serial job, then parallelize itself
(using fork), then re-synchronize and finish as a serial job. I can do this
one of two ways:
1) Create the part that will be parallelized as a subroutine that will only
be run by the forked children.
2) Create the part that will be parallelized as a seperate Perl script,
which will be forked, then exec'd.
As best I can understand from the perlfork and perlipc docs on
www.perldoc.com, approach 1 will (from the O/S perspective) run the forked
children as threads in a single Perl process, while approach 2 will run the
forked/exec'd children as seperate Perl processes (again from the O/S
perspective). [Note: I'm not using Perl threads. According to the docs,
forking with no exec runs the children as threads, even though they appear
as pseudo-processes to the Perl script.] I will probably have about 50-100
children, and each child will be pulling data via HTTP using the LWP module,
then parsing and storing the data using DBI. I'm developing this on NT, I
may initially run it on NT (merely because it's convenient), but will
probably eventually run it on Linux (because I like it better, it should be
easier to manage, and should perform a little better.).
Question:
Which approach (1 or 2) is likely to work best? I'd imagine that creating
it as multi-process (#2) will probably be more stable on both platforms,
while creating it as multi-threaded (#1) will use less resources and
possibly run quicker, but be less stable, on both platforms. Does anyone
have any experience or educated opinions that would help me make this
decision?
Best regards,
Dave
------------------------------
Date: 18 Jan 2001 08:46:23 +0000
From: nobull@mail.com
Subject: Re: Perl script problem
Message-Id: <u9itnberhg.fsf@wcl-l.bham.ac.uk>
"Ian Waters" <ian@ianwaters.com> writes:
> Subject: Perl script problem
Please write out 1000 times: "I must not post to Usenet with
content-free subject lines".
> I am writting a script for an online quiz. I was told that the best way to
> test the answers was using the following method
[ Snip simple code ]
> However, I do not have the CGI.pm module installed on my server and I cant
> install it as I do not have telnet access.
GCI.pm is pure Perl - no need to compile you can simply copy the
files to your private module directory (see FAQ for how to have a
private module directory).
However since CGI.pm has been a standard part of Perl distribution for
some time now I suggest finding a slightly more state-of-the-art
hosting company.
> Is there another way of testing the answers in my web page by using
> the standard form parsing routine.
CGI.pm _is_ the standard form parsing routine and has been for some
time. If you want a solution using one of the less standard
approaches then you'll have to say which one.
> there is only one question in the form but as soon as I add more I
> get an internal server error.
This probably means you have a problem in your understanding of Perl
or you have made a careless mistake. (Without seeing your code and
the error that's all anyone can say). If your hosting company won't
let you see the error log then, once again, I suggest you need to find
a better hosting company. If you seriously expect us to debug your
code without seeing it I think you need therapy.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 19 Jan 2001 11:30:32 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Perl script problem
Message-Id: <slrn96g9an.2q0.bernard.el-hagin@gdndev25.lido-tech>
On 18 Jan 2001 08:46:23 +0000, nobull@mail.com <nobull@mail.com> wrote:
>"Ian Waters" <ian@ianwaters.com> writes:
>
>> Subject: Perl script problem
>
>Please write out 1000 times: "I must not post to Usenet with
>content-free subject lines".
Change that to "Please write out 1000 times ON PAPER".
It's too easy to do it electronically. :)
Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'
------------------------------
Date: Fri, 19 Jan 2001 12:31:24 +0000
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: Writing Unix-format files on NT
Message-Id: <3A68339C.40606@sergeant.org>
Iain Hosking wrote:
> I'm trying to write a text file which must be used on a Silicon Graphics
> machine. If I set
>
> $\ = "\n";
>
> then the newline character is CR+LF, and the file can't be used. But the
> strange thing is that if I set
>
> $\ = "\012";
>
> or
>
> $\ = "\x0A";
>
> then the newline is still CR+LF. How can I create a file with a line
> delimiter of LF only?
perldoc -f binmode
Matt.
------------------------------
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 V10 Issue 97
*************************************