[29021] in Perl-Users-Digest
Perl-Users Digest, Issue: 265 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 26 06:09:58 2007
Date: Mon, 26 Mar 2007 03:09:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 26 Mar 2007 Volume: 11 Number: 265
Today's topics:
Re: FAQ 8.43 How do I open a file without blocking? xhoster@gmail.com
Re: FAQ 8.43 How do I open a file without blocking? <bik.mido@tiscalinet.it>
Re: FAQ 8.43 How do I open a file without blocking? <abigail@abigail.be>
Re: FAQ 8.43 How do I open a file without blocking? <hjp-usenet2@hjp.at>
How to parse the log file to get useful information usi <robertchen117@gmail.com>
Re: HTML::Mason and User site folders <wahab-mail@gmx.de>
Re: HTML::Mason and User site folders <macshaggy@carolina.rr.com>
Re: HTML::Mason and User site folders <wahab-mail@gmx.de>
new CPAN modules on Mon Mar 26 2007 (Randal Schwartz)
Re: parsing a tab delimited or CSV, but keep the delimi <check.sig@for.email.invalid>
Re: Perl Regexp that deals with variable parameter-stri <attn.steven.kuo@gmail.com>
Re: Replacing characters in file <anony-mouse@hole.in.the.wall.com>
Re: Replacing characters in file <rvtol+news@isolution.nl>
Re: Truncating text from a string with beginning text f <wahab-mail@gmx.de>
Win32::OLE error in thread (ActiveSatate 5.8) on XP <lev.weissman@kodak.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Mar 2007 22:15:11 GMT
From: xhoster@gmail.com
Subject: Re: FAQ 8.43 How do I open a file without blocking?
Message-Id: <20070325181514.042$pC@newsreader.com>
PerlFAQ Server <brian@stonehenge.com> wrote:
> This is an excerpt from the latest version perlfaq8.pod, which
> comes with the standard Perl distribution. These postings aim to
> reduce the number of repeated questions as well as allow the community
> to review and update the answers. The latest version of the complete
> perlfaq is at http://faq.perl.org .
>
> --------------------------------------------------------------------
>
> 8.43: How do I open a file without blocking?
>
> If you're lucky enough to be using a system that supports
> non-blocking reads (most Unixish systems do), you need only to use
> the O_NDELAY or O_NONBLOCK flag from the Fcntl module in conjunction
> with sysopen():
>
> use Fcntl;
> sysopen(FH, "/foo/somefile", O_WRONLY|O_NDELAY|O_CREAT, 0644)
> or die "can't open /foo/somefile: $!":
>
> --------------------------------------------------------------------
I think that this FAQ should be removed or altered. It doesn't seem to be
frequently asked. It is also kind of misleading, as it is not opening a
file without the open blocking--it is opening a file so that the subsequent
reads from it do not block (or at least that is the behavior I observe for
it). Finally, it only seems to work on special files, not on regular files.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Mon, 26 Mar 2007 01:03:01 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 8.43 How do I open a file without blocking?
Message-Id: <bnvd03ltrlc5bs332k9knotublcmi1o5qc@4ax.com>
On 25 Mar 2007 22:15:11 GMT, xhoster@gmail.com wrote:
>I think that this FAQ should be removed or altered. It doesn't seem to be
>frequently asked. It is also kind of misleading, as it is not opening a
There are a lot of FAQ entries which are not actually FA, and they are
discussed quite often. The general outcome being that they should not
be removed anyway. As far as the content goes, that's a whole another
story, of course...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 26 Mar 2007 00:28:08 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: FAQ 8.43 How do I open a file without blocking?
Message-Id: <slrnf0e4so.k6j.abigail@alexandra.abigail.be>
xhoster@gmail.com (xhoster@gmail.com) wrote on MMMMCMLIV September
MCMXCIII in <URL:news:20070325181514.042$pC@newsreader.com>:
{} PerlFAQ Server <brian@stonehenge.com> wrote:
{} > This is an excerpt from the latest version perlfaq8.pod, which
{} > comes with the standard Perl distribution. These postings aim to
{} > reduce the number of repeated questions as well as allow the community
{} > to review and update the answers. The latest version of the complete
{} > perlfaq is at http://faq.perl.org .
{} >
{} > --------------------------------------------------------------------
{} >
{} > 8.43: How do I open a file without blocking?
{} >
{} > If you're lucky enough to be using a system that supports
{} > non-blocking reads (most Unixish systems do), you need only to use
{} > the O_NDELAY or O_NONBLOCK flag from the Fcntl module in conjunction
{} > with sysopen():
{} >
{} > use Fcntl;
{} > sysopen(FH, "/foo/somefile", O_WRONLY|O_NDELAY|O_CREAT, 0644)
{} > or die "can't open /foo/somefile: $!":
{} >
{} > --------------------------------------------------------------------
{}
{}
{} I think that this FAQ should be removed or altered. It doesn't seem to be
{} frequently asked. It is also kind of misleading, as it is not opening a
{} file without the open blocking--it is opening a file so that the subsequent
{} reads from it do not block (or at least that is the behavior I observe for
{} it). Finally, it only seems to work on special files, not on regular files.
What makes you say all those things? O_NDELAY causes both the open() and
the subsequent reads to be non-blocking, and there's nothing special about
"/foo/somefile".
Abigail
--
BEGIN {$^H {q} = sub {pop and pop and print pop}; $^H = 2**4.2**12}
"Just "; "another "; "Perl "; "Hacker\n";
------------------------------
Date: Mon, 26 Mar 2007 10:06:15 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 8.43 How do I open a file without blocking?
Message-Id: <slrnf0evnn.q6.hjp-usenet2@yoyo.hjp.at>
On 2007-03-26 00:28, Abigail <abigail@abigail.be> wrote:
> xhoster@gmail.com (xhoster@gmail.com) wrote on MMMMCMLIV September
> MCMXCIII in <URL:news:20070325181514.042$pC@newsreader.com>:
> {} > 8.43: How do I open a file without blocking?
...
> {} > sysopen(FH, "/foo/somefile", O_WRONLY|O_NDELAY|O_CREAT, 0644)
> {} > or die "can't open /foo/somefile: $!":
> {} >
> {}
> {} I think that this FAQ should be removed or altered. It doesn't seem to be
> {} frequently asked. It is also kind of misleading, as it is not opening a
> {} file without the open blocking--it is opening a file so that the subsequent
> {} reads from it do not block (or at least that is the behavior I observe for
> {} it). Finally, it only seems to work on special files, not on regular files.
>
>
> What makes you say all those things? O_NDELAY causes both the open() and
> the subsequent reads to be non-blocking,
Yes.
> and there's nothing special about "/foo/somefile".
If "/foo/somefile" is a regular file, O_NDELAY will be just ignored on
many (probably most, maybe all) Unixes. Non-blocking read is generelly
only supported on special files (like device files, pipes, sockets).
hp
--
_ | Peter J. Holzer | Blaming Perl for the inability of programmers
|_|_) | Sysadmin WSR | to write clearly is like blaming English for
| | | hjp@hjp.at | the circumlocutions of bureaucrats.
__/ | http://www.hjp.at/ | -- Charlton Wilbur in clpm
------------------------------
Date: 25 Mar 2007 22:43:28 -0700
From: "robertchen117@gmail.com" <robertchen117@gmail.com>
Subject: How to parse the log file to get useful information using perl or shell?
Message-Id: <1174887808.619458.64350@y80g2000hsf.googlegroups.com>
hi all,
I have a very long log file like the below, how could I useful info I
need like this:
sr-204 Tec cache size:
"ls -l C:\Tivoli\lcf\dat\1\LCFNEW\Tmw2k\Tec\cache"
total 1
-rw-rw-rw- 1 0 0 54 Nov 01 23:53
EventServer#opp1_0.dat
Also is get every 3 lines just after every "Tec cache size" including
the "Tec cache size" line.
Or even could I get just include the host name and file size? Like
this:
sr-204 54
sr-207 54
...
The log file like this:
....
=================
sr-204.domain1.com:
DISSE0155I Distribution ID: `1278500431.264831'
------------------------------
STANDARD OUTPUT/ERROR BEGIN
------------------------------
STANDARD OUTPUT (program: c:\temp\check_itm_cache\check_itm_cache.bat
- exit code = 0)
sr-204 Tec cache size:
"ls -l C:\Tivoli\lcf\dat\1\LCFNEW\Tmw2k\Tec\cache"
total 1
-rw-rw-rw- 1 0 0 54 Nov 01 23:53
EventServer#opp1_0.dat
""
------------------------------
STANDARD OUTPUT/ERROR END
------------------------------
=================
Software Package: "itm_cache^1.0"
Operation: install
Mode: not-transactional,not-undoable | force
Time: 2007-03-25 22:02:58
=================
sr-207.domain1.com:
DISSE0155I Distribution ID: `1278500431.264831'
------------------------------
STANDARD OUTPUT/ERROR BEGIN
------------------------------
STANDARD OUTPUT (program: c:\temp\check_itm_cache\check_itm_cache.bat
- exit code = 0)
sr-207 Tec cache size:
"ls -l C:\Tivoli\lcf\dat\1\LCFNEW\Tmw2k\Tec\cache"
total 1
-rw-rw-rw- 1 0 0 54 Nov 01 23:58
EventServer#opp1_0.dat
""
....
------------------------------
Date: Sun, 25 Mar 2007 23:59:18 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: HTML::Mason and User site folders
Message-Id: <eu6rm5$oi9$1@mlucom4.urz.uni-halle.de>
macshaggy wrote:
> On Mar 23, 8:45 pm, Mirco Wahab <wahab-m...@gmx.de> wrote:
>> ...
>> PerlSetVar MasonCompRoot /Users/jbellew/Sites
>> PerlSetVar MasonDataDir /var/cache/mason
>> ...
>
> Thanks that makes sense. Next question, since when I read your answer
> and saw the above example I had to hit myself upside the hed, I need
> my Component Root Directory to be set to /usr/local/apache2/htdocs but
> still have Mason process files from /Users/jbellew/Sites as well. Can
> I have multiple Root directorys?
Yes, you can (according to the docs), but
then Mason has to search the target
*on each request* through the different
component roots, because you have address
any Mason component /relative to its
component root.
What exactly do you try to do?
See: http://search.cpan.org/~jswartz/HTML-Mason-1.05/lib/HTML/Mason/Admin.pod#Multiple_component_roots
Regards
M.
------------------------------
Date: 25 Mar 2007 16:27:22 -0700
From: "macshaggy" <macshaggy@carolina.rr.com>
Subject: Re: HTML::Mason and User site folders
Message-Id: <1174865242.206065.215120@p15g2000hsd.googlegroups.com>
On Mar 25, 5:59 pm, Mirco Wahab <wahab-m...@gmx.de> wrote:
> macshaggy wrote:
> > On Mar 23, 8:45 pm, Mirco Wahab <wahab-m...@gmx.de> wrote:
> >> ...
> >> PerlSetVar MasonCompRoot /Users/jbellew/Sites
> >> PerlSetVar MasonDataDir /var/cache/mason
> >> ...
>
> > Thanks that makes sense. Next question, since when I read your answer
> > and saw the above example I had to hit myself upside the hed, I need
> > my Component Root Directory to be set to /usr/local/apache2/htdocs but
> > still have Mason process files from /Users/jbellew/Sites as well. Can
> > I have multiple Root directorys?
>
> Yes, you can (according to the docs), but
> then Mason has to search the target
> *on each request* through the different
> component roots, because you have address
> any Mason component /relative to its
> component root.
>
> What exactly do you try to do?
> See:http://search.cpan.org/~jswartz/HTML-Mason-1.05/lib/HTML/Mason/Admin....
>
> Regards
>
> M.
Thanks once again and I'll leave this alone when it's working.
Basically I'm trying to setup my system that anytime a person
specifies ~User then Mason will go ahead a serve up that Users html
doc. Otherwise, Mason will continue to serve via the document root. I
don't want it to be specifc to just 1 user but to all that are on the
system.
I'll try this a see if it works otherwise I'm thinking of having a
handler that intercepts the request and expands it for Mason
automatically.
But again thanks for all the help!!
J
------------------------------
Date: Mon, 26 Mar 2007 10:12:14 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: HTML::Mason and User site folders
Message-Id: <eu7vjc$5lq$1@mlucom4.urz.uni-halle.de>
macshaggy wrote:
> Basically I'm trying to setup my system that anytime a person
> specifies ~User then Mason will go ahead a serve up that Users html
> doc. Otherwise, Mason will continue to serve via the document root. I
> don't want it to be specifc to just 1 user but to all that are on the
> system.
>
This scenario is given *exactly* as you described it
in the "Mason Book":
http://www.masonbook.com/book/chapter-11.mhtml#TOC-ANCHOR-15
There is a handler provided, which calls
the Mason handler and sets the proper
component root.
Depending on your naming convention (eg.: ^/~someuser/... ),
you have to modify the example. Then, put this handler
somewhere (where mod_perl can find it) or put it
between <perl> ... </perl> tags in a mod_perl related
Apache config file.
Regards
Mirco
------------------------------
Date: Mon, 26 Mar 2007 04:42:11 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Mar 26 2007
Message-Id: <JFHuEB.1JAv@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Alzabo-0.91
http://search.cpan.org/~drolsky/Alzabo-0.91/
A data modelling tool and RDBMS-OO mapper
----
CPAN-Reporter-0.41
http://search.cpan.org/~dagolden/CPAN-Reporter-0.41/
Provides Test::Reporter support for CPAN.pm
----
Catalyst-Model-TextLinkAds-0.01
http://search.cpan.org/~dcardwell/Catalyst-Model-TextLinkAds-0.01/
Catalyst model for Text Link Ads
----
Catalyst-Plugin-I18N-DBIC-0.04
http://search.cpan.org/~icydee/Catalyst-Plugin-I18N-DBIC-0.04/
Internationalization for Catalyst, data loaded from database
----
Data-RuledValidator-0.08
http://search.cpan.org/~ktat/Data-RuledValidator-0.08/
data validator with rule
----
Data-RuledValidator-0.09
http://search.cpan.org/~ktat/Data-RuledValidator-0.09/
data validator with rule
----
Data-RuledValidator-Plugin-Japanese-0.01
http://search.cpan.org/~ktat/Data-RuledValidator-Plugin-Japanese-0.01/
Data::RuledValidator plugin for Japanese
----
Data-RuledValidator-Plugin-Japanese-0.02
http://search.cpan.org/~ktat/Data-RuledValidator-Plugin-Japanese-0.02/
Data::RuledValidator plugin for Japanese
----
Devel-ebug-Wx-0.06
http://search.cpan.org/~mbarbon/Devel-ebug-Wx-0.06/
GUI interface for your (d)ebugging needs
----
Egg-Model-DBIC-0.06
http://search.cpan.org/~lushe/Egg-Model-DBIC-0.06/
DBIx::Class for Egg.
----
Egg-Plugin-Cache-0.03
http://search.cpan.org/~lushe/Egg-Plugin-Cache-0.03/
Cache for Egg.
----
Egg-Plugin-Crypt-CBC-0.04
http://search.cpan.org/~lushe/Egg-Plugin-Crypt-CBC-0.04/
The encryption is supported.
----
Egg-Plugin-LWP-0.03
http://search.cpan.org/~lushe/Egg-Plugin-LWP-0.03/
LWP for Egg.
----
Egg-Plugin-SessionKit-0.08
http://search.cpan.org/~lushe/Egg-Plugin-SessionKit-0.08/
Session plugin for Egg.
----
Egg-Plugin-SessionKit-Auth-0.07
http://search.cpan.org/~lushe/Egg-Plugin-SessionKit-Auth-0.07/
The authentication function is offered by using the session.
----
Egg-View-TT-0.06
http://search.cpan.org/~lushe/Egg-View-TT-0.06/
Template ToolKit is used for View of Egg.
----
Genezzo-0.70
http://search.cpan.org/~jcohen/Genezzo-0.70/
an extensible database with SQL and DBI
----
Google-Adwords-v1.2.0
http://search.cpan.org/~rohan/Google-Adwords-v1.2.0/
an interface which abstracts the Google Adwords SOAP API
----
HTML-Template-Associate-FormField-0.11
http://search.cpan.org/~lushe/HTML-Template-Associate-FormField-0.11/
----
HTML-Template-Ex-0.07
http://search.cpan.org/~lushe/HTML-Template-Ex-0.07/
The Perl code is operated in the template for HTML::Template.
----
Hook-Output-File-0.03
http://search.cpan.org/~schubiger/Hook-Output-File-0.03/
Redirect STDOUT/STDERR to a file
----
Image-Pngslimmer-0.21
http://search.cpan.org/~acmcmen/Image-Pngslimmer-0.21/
slims (dynamically created) PNGs
----
JSON-XS-0.8
http://search.cpan.org/~mlehmann/JSON-XS-0.8/
JSON serialising/deserialising, done correctly and fast
----
Lingua-EN-Conjugate-0.294
http://search.cpan.org/~rwg/Lingua-EN-Conjugate-0.294/
Conjugation of English verbs
----
MIME-Types-1.19
http://search.cpan.org/~markov/MIME-Types-1.19/
Definition of MIME types
----
Mail-Box-2.070
http://search.cpan.org/~markov/Mail-Box-2.070/
manage a mailbox, a folder with messages
----
Module-Build-0.2807
http://search.cpan.org/~kwilliams/Module-Build-0.2807/
Build and install Perl modules
----
Module-ScanDeps-0.73
http://search.cpan.org/~smueller/Module-ScanDeps-0.73/
Recursively scan Perl code for dependencies
----
Net-Delicious-1.11
http://search.cpan.org/~ascope/Net-Delicious-1.11/
OOP for the del.icio.us API
----
OODoc-0.99
http://search.cpan.org/~markov/OODoc-0.99/
object oriented production of code related documentation
----
Object-Realize-Later-0.16
http://search.cpan.org/~markov/Object-Realize-Later-0.16/
Delayed creation of objects
----
OpenGuides-0.59
http://search.cpan.org/~dom/OpenGuides-0.59/
A complete web application for managing a collaboratively-written guide to a city or town.
----
POE-Component-Server-SimpleSMTP-0.99
http://search.cpan.org/~bingos/POE-Component-Server-SimpleSMTP-0.99/
A simple to use POE SMTP Server.
----
PostScript-Calendar-0.01
http://search.cpan.org/~cjm/PostScript-Calendar-0.01/
Generate a monthly calendar in PostScript
----
Pushmi-v0.992.0
http://search.cpan.org/~clkao/Pushmi-v0.992.0/
Subversion repository replication tool
----
Set-IntSpan-1.11
http://search.cpan.org/~swmcd/Set-IntSpan-1.11/
Manages sets of integers
----
Statistics-RankCorrelation-0.11_1
http://search.cpan.org/~gene/Statistics-RankCorrelation-0.11_1/
Compute the rank correlation between two vectors
----
Test-MonitorSites-0.10
http://search.cpan.org/~hesco/Test-MonitorSites-0.10/
Monitor availability and function of a list of websites
----
Test-MonitorSites-0.11
http://search.cpan.org/~hesco/Test-MonitorSites-0.11/
Monitor availability and function of a list of websites
----
Text-Trac-0.07
http://search.cpan.org/~mizzy/Text-Trac-0.07/
Perl extension for formatting text with Trac Wiki Style.
----
TextLinkAds-0.01
http://search.cpan.org/~dcardwell/TextLinkAds-0.01/
Retrieve Text Link Ads advertiser data
----
Thread-Barrier-0.300
http://search.cpan.org/~mrogaski/Thread-Barrier-0.300/
thread execution barrier
----
Unicode-Unihan-0.03
http://search.cpan.org/~dankogai/Unicode-Unihan-0.03/
The Unihan Data Base 5.0.0
----
WWW-Google-API-0.001
http://search.cpan.org/~jcap/WWW-Google-API-0.001/
Perl client to the Google API <http://code.google.com/apis/>
----
WWW-Search-Search-1.004
http://search.cpan.org/~mthurn/WWW-Search-Search-1.004/
class for searching www.search.com
----
XML-RSS-FromHTML-Simple-0.04
http://search.cpan.org/~mschilli/XML-RSS-FromHTML-Simple-0.04/
Create RSS feeds for sites that don't offer them
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Mon, 26 Mar 2007 10:29:14 +0300
From: Alex <check.sig@for.email.invalid>
Subject: Re: parsing a tab delimited or CSV, but keep the delimiter
Message-Id: <oDKNh.24643$LH4.4259@reader1.news.saunalahti.fi>
> There were so many that came up when I googled that I just picked one at
> random, on the basis that it was eight out of the first ten sites that popped
> up in my search.
>> Of course I am referring to the module Text::CSV (or one of its cousins):
>> http://search.cpan.org/search?query=text%3A%3Acsv&mode=all
> Of course! I should have /known/ that it was one of the other 68790 hits,
> instead of the one that was eight out of the first ten.
If you search for "Text::CSV" on Google, the very first hit you get is a
link to the CPAN-module. The hxtt.com-link you send doesn't even contain
the search string and does not appear in the first hundred hits. So yes,
you should have /known/ that you should at least check your spelling.
--
Alex
e-mail: Domain is iki dot fi. Local-part is alext.
local-part at domain
------------------------------
Date: 25 Mar 2007 14:29:20 -0700
From: "attn.steven.kuo@gmail.com" <attn.steven.kuo@gmail.com>
Subject: Re: Perl Regexp that deals with variable parameter-string length.
Message-Id: <1174858160.008506.127500@y80g2000hsf.googlegroups.com>
On Mar 25, 11:58 am, "Brian McCauley" <nobul...@gmail.com> wrote:
> On 25 Mar, 18:41, "attn.steven....@gmail.com"
>
> > Does that mean you want the sum of differences
> > between overlapping, adjacent "locations"?
>
> Er, the sum of differences between overlapping adjacent pairs of
> elements in a list is just the difference between the first and last
> elements in the list.
>
> This, of course, has nothing to do with Perl.
Er, true. But probably I had misinterpreted the O.P.'s
intent; (sum of) *distance* between locations should be, then,
$total += abs($2 - $1) while /\G(\d{3})-(?=(\d{3}))/gc;
(added 'abs'). If applied to '111-333-222', it would yield
a result of 333.
--
Cheers,
Steven
<OT> I'm enjoying slides of your talks posted to birmingham.pm </OT>
------------------------------
Date: Mon, 26 Mar 2007 08:52:03 +1200
From: Anony-mouse <anony-mouse@hole.in.the.wall.com>
Subject: Re: Replacing characters in file
Message-Id: <260320070852034878%anony-mouse@hole.in.the.wall.com>
In article <eu5m75.r0.1@news.isolution.nl>, "Dr.Ruud"
<rvtol+news@isolution.nl> wrote:
> Anony-mouse schreef:
>
> > I'm trying to find a way to replace [..] characters 015F (in hex) with 015C.
>
> Is this about double-byte characters?
Two characters one after the other in the file. I can't simply replace
5F by 5C since there are other 5F characters that must remain
unchanged. It's only those preceeded by a 01 that need to be changed.
The original answer posted doesn't work with my version of Perl. I'm
attempting to download the Active version, but it will take me a while
via dial-up. With an installer size of 15MB I'm not sure it's going to
be the right solution for me since I need it to be small to run from a
keyring Flash drive on any computer it gets plugged into. :o(
_
_/ \___
Anony-mouse says o_/O _/ \
"Eek-eek-eek!" \__/_|_/_|\____/
------------------------------
Date: Mon, 26 Mar 2007 10:06:46 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Replacing characters in file
Message-Id: <eu864k.17g.1@news.isolution.nl>
Anony-mouse schreef:
> Dr.Ruud:
>> Anony-mouse:
>>> I'm trying to find a way to replace [..] characters 015F (in hex)
>>> with 015C.
>>
>> Is this about double-byte characters?
>
> Two characters one after the other in the file.
Please say "bytes" (or "octets") if you mean those. A single character
can occupy many bytes in a file, think UTF-8.
> I can't simply replace
> 5F by 5C since there are other 5F characters that must remain
> unchanged. It's only those preceeded by a 01 that need to be changed.
That answer was already given by Klaus. See also sed or awk.
> The original answer posted doesn't work with my version of Perl
It was a generic answer. What error messages did you get?
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Mon, 26 Mar 2007 00:03:12 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: Truncating text from a string with beginning text from another string
Message-Id: <eu6rte$oib$1@mlucom4.urz.uni-halle.de>
Michele Dondi wrote:
> On Fri, 23 Mar 2007 20:23:44 +0100, Mirco Wahab <wahab-mail@gmx.de>
> wrote:
>
>> my @end = split //, 'Reference #000000';
>> my $key = '('.(join '|', map join('',,@$_), map[@end[0..$_]], 0..$#end).')';
>
> Isn't that an awkward way to reimplement substr()?
First this - and the whole approach shown above also
will not work (to solve to said problem). I tried to
cancel the message (and post a working solution) after
thinking again - but your news server didn't honor my
cancel attempts. This way, all came to the light ...
Regards
Mirco
------------------------------
Date: 26 Mar 2007 00:57:45 -0700
From: "MoshiachNow" <lev.weissman@kodak.com>
Subject: Win32::OLE error in thread (ActiveSatate 5.8) on XP
Message-Id: <1174895865.418125.100480@y66g2000hsf.googlegroups.com>
HI,
Get error in the following scripts that gets a list of all installed
SW:
use Win32::OLE('in');
use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root
\\CIMV2") or die "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM
Win32_ProductSoftwareFeatures", "WQL",
wbemFlagReturnImmediately | wbemFlagForwardOnly);
foreach my $objItem (in $colItems) {
print STDOUT "objitem=$objItem=\n";
my $product1=$objItem->{Product};
$product1 =~ s/.*Name=\"(.*)\"/$1/;
$product1 =~ s/\"//g;
$products->{$product1}="YES";
}
The error is on one of the items in hash:
Win32::OLE(0.1707): GetOleEnumObject() Not a Win32::OLE::Enum object
at D:/Perl/lib/Win32/OLE/L
ite.pm line 167.
I guess that something is wrong with one of the returned hashes.
How do I skip the bad entry and get only valid entries?
Thanks
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V11 Issue 265
**************************************