[30271] in Perl-Users-Digest
Perl-Users Digest, Issue: 1514 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 7 06:10:11 2008
Date: Wed, 7 May 2008 03:09:06 -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 Wed, 7 May 2008 Volume: 11 Number: 1514
Today's topics:
Re: Error in Handling Unicode(UTF16-LE) File & String (Ben Bullock)
Re: IPC::Open3 : Why can't I catch program output here? (Darren Dunham)
Re: IPC::Open3 : Why can't I catch program output here? <ben@morrow.me.uk>
Re: IPC::Open3 : Why can't I catch program output here? <nospam-abuse@ilyaz.org>
new CPAN modules on Wed May 7 2008 (Randal Schwartz)
Re: perl PNG image searching (Ben Bullock)
Trying to catch invalid emails <samik@frKKshKll.org>
Re: Trying to catch invalid emails <rkb@i.frys.com>
Re: Trying to catch invalid emails <ben@morrow.me.uk>
Re: Trying to catch invalid emails (Ben Bullock)
Re: Trying to catch invalid emails <abigail@abigail.be>
Re: Trying to catch invalid emails <devnull4711@web.de>
Re: Trying to catch invalid emails <abigail@abigail.be>
Re: Why doesn't Perl complain about this bareword? (Ben Bullock)
Re: WriteExcel->sheets() fails to get the worksheets <anand.acharya@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 7 May 2008 05:46:46 +0000 (UTC)
From: benkasminbullock@gmail.com (Ben Bullock)
Subject: Re: Error in Handling Unicode(UTF16-LE) File & String
Message-Id: <fvrfo6$hj6$1@ml.accsnet.ne.jp>
iaminsik <iaminsik@gmail.com> wrote:
> The first source generates 'wide character warnings',
> and saves outfile in utf8 format, weirdly.
It's not weird; you have "use utf8;" there, so it reads in using the
encoding you specified, then the binmode switches off the output
formatting, then it prints it out in the default format, which
generates wide character warnings because you haven't explicitly set
the mode of the output to anything. Use
binmode $outfile,"utf8";
to switch those wide character warnings off.
> I made 'binmode $outfile;' as a comment line,
> and it saves outfile in UTF-16LE format I wanted.
Good news.
> 3. Several Questions
> I, a newbie in Perl programming language, couldn't understand two
> parts in your codes.
> ========================================================================
> for (qw/file1 file2/) { <===== what it means? it's a short expression
> for loop?
This sets $_ to "file1" then "file2". qw/a b/ equals ('a', 'b').
> binmode $outfile if /1/; <===== what /l/ means?
It's not an l it's a 1. "if /1/" has the effect of saying 'if $_ is
"file1"'. The /1/ detects the character '1' in the name. Try
experimenting with the code to understand what it does.
------------------------------
Date: Tue, 06 May 2008 21:37:56 GMT
From: ddunham@taos.com (Darren Dunham)
Subject: Re: IPC::Open3 : Why can't I catch program output here?
Message-Id: <Uc4Uj.382$8i5.336@flpi144.ffdc.sbc.com>
xhoster@gmail.com wrote:
> ddunham@taos.com (Darren Dunham) wrote:
>> Ben Morrow <ben@morrow.me.uk> wrote:
>> > I would normally say 'Use lexical filehandles!' at this point;
>> > unfortunately, IPC::Open3 was written before they existed and the
>> > obvious way
>> >
>> > my $pid = open3(my $CMD_IN, my $CMD_OUT, my $CMD_ERR, @cmd)...
>> >
>> > doesn't work (and can't be made to since undef is already meaningful).
>>
>> What's wrong with the above?
>
> It causes cmd's stderr to go to $CMD_OUT rather than the obviously
> intended $CMD_ERR.
I don't know that it's obviously intended. It took me quite a while to
realize that I even had an option to return output and error on a single
filehandle. I mention that explicitly because the OP might have been
having issues with selecting between the two, when reading them combined
may have been preferable.
However, if you do want them separated, then the other choices offered
seem quite verbose. Instead of them, I would pass in a (defined)
filehandle. That takes one more line of code (two if you count bringing
in the FileHandle module.
my $CMD_ERR = FileHandle->new();
my $pid = open3(my $CMD_IN, my $CMD_OUT, $CMD_ERR, @cmd)...
--
Darren Dunham ddunham@taos.com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
------------------------------
Date: Tue, 6 May 2008 23:59:27 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: IPC::Open3 : Why can't I catch program output here?
Message-Id: <ff47f5-2th.ln1@osiris.mauzo.dyndns.org>
Quoth ddunham@taos.com (Darren Dunham):
> xhoster@gmail.com wrote:
> > ddunham@taos.com (Darren Dunham) wrote:
> >> Ben Morrow <ben@morrow.me.uk> wrote:
> >> > I would normally say 'Use lexical filehandles!' at this point;
> >> > unfortunately, IPC::Open3 was written before they existed and the
> >> > obvious way
> >> >
> >> > my $pid = open3(my $CMD_IN, my $CMD_OUT, my $CMD_ERR, @cmd)...
> >> >
> >> > doesn't work (and can't be made to since undef is already meaningful).
> >>
> >> What's wrong with the above?
> >
> > It causes cmd's stderr to go to $CMD_OUT rather than the obviously
> > intended $CMD_ERR.
>
> I don't know that it's obviously intended. It took me quite a while to
> realize that I even had an option to return output and error on a single
> filehandle. I mention that explicitly because the OP might have been
> having issues with selecting between the two, when reading them combined
> may have been preferable.
>
> However, if you do want them separated, then the other choices offered
> seem quite verbose. Instead of them, I would pass in a (defined)
> filehandle. That takes one more line of code (two if you count bringing
> in the FileHandle module.
>
> my $CMD_ERR = FileHandle->new();
> my $pid = open3(my $CMD_IN, my $CMD_OUT, $CMD_ERR, @cmd)...
...which is essentially the same as what I proposed, except that I
prefer to avoid FileHandle (and IO::Handle) and use Symbol::gensym
directly. That's just a matter of taste, of course.
Ben
------------------------------
Date: Wed, 7 May 2008 00:04:49 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: IPC::Open3 : Why can't I catch program output here?
Message-Id: <fvqrn1$r2j$1@agate.berkeley.edu>
[A complimentary Cc of this posting was NOT [per weedlist] sent to
Ben Morrow
<ben@morrow.me.uk>], who wrote in article <jtb6f5-qg1.ln1@osiris.mauzo.dyndns.org>:
> > sub open3 ($$$$@) {
> > $_[0] = IO::Handle->new unless defined $_[0]; # Or whatever is THE
> > initializer
> > ...
> > }
> Yeah, in general you can do that; however, for the specific case of
> open3, the docs say
>
> If CHLD_ERR is false, or the same file descriptor as CHLD_OUT, then
> STDOUT and STDERR of the child are on the same filehandle.
Thanks, I forgot about this semantic. Which does not mean that one
could not write ALSO open3_autovivify... ;-)
Yours,
Ilya
------------------------------
Date: Wed, 7 May 2008 04:42:20 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed May 7 2008
Message-Id: <K0HEEK.1zqw@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.
ARSperl-1.91
http://search.cpan.org/~jmurphy/ARSperl-1.91/
----
Abstract-Meta-Class-0.03
http://search.cpan.org/~adrianwit/Abstract-Meta-Class-0.03/
Simple meta object protocol implementation.
----
Acme-POE-Acronym-Generator-1.14
http://search.cpan.org/~bingos/Acme-POE-Acronym-Generator-1.14/
Generate random POE acronyms.
----
App-Nopaste-0.03
http://search.cpan.org/~sartak/App-Nopaste-0.03/
easy access to any pastebin
----
Astro-QDP-Parse-0.12
http://search.cpan.org/~djerius/Astro-QDP-Parse-0.12/
extract Data from a QDP input file
----
Astro-QDP-Parse-0.13
http://search.cpan.org/~djerius/Astro-QDP-Parse-0.13/
extract Data from a QDP input file
----
BGS-0.01
http://search.cpan.org/~kni/BGS-0.01/
Background execution of subroutines in child processes.
----
CSS-Minifier-XS-0.02
http://search.cpan.org/~gtermars/CSS-Minifier-XS-0.02/
XS based CSS minifier
----
Catalyst-Controller-DBIC-Transaction-0.1
http://search.cpan.org/~druoso/Catalyst-Controller-DBIC-Transaction-0.1/
Encloses actions into transactions
----
Catalyst-Controller-DBIC-Transaction-0.2
http://search.cpan.org/~druoso/Catalyst-Controller-DBIC-Transaction-0.2/
Encloses actions into transactions
----
Catalyst-Controller-DBIC-Transaction-0.3
http://search.cpan.org/~druoso/Catalyst-Controller-DBIC-Transaction-0.3/
Encloses actions into transactions
----
CatalystX-CRUD-0.26
http://search.cpan.org/~karman/CatalystX-CRUD-0.26/
CRUD framework for Catalyst applications
----
CatalystX-CRUD-Controller-RHTMLO-0.11
http://search.cpan.org/~karman/CatalystX-CRUD-Controller-RHTMLO-0.11/
Rose::HTML::Objects CRUD controller
----
CatalystX-CRUD-View-Excel-0.04
http://search.cpan.org/~karman/CatalystX-CRUD-View-Excel-0.04/
view CRUD search/list results in Excel format
----
DataExtract-FixedWidth-0.03
http://search.cpan.org/~ecarroll/DataExtract-FixedWidth-0.03/
The one stop shop for parsing static column width text tables!
----
Devel-CoverX-Covered-0.007
http://search.cpan.org/~johanl/Devel-CoverX-Covered-0.007/
Collect and report caller (test file) and covered (source file) statistics from the cover_db
----
Exception-Class-DBI-0.98
http://search.cpan.org/~dwheeler/Exception-Class-DBI-0.98/
DBI Exception objects
----
Expect-Simple-0.04
http://search.cpan.org/~djerius/Expect-Simple-0.04/
wrapper around the Expect module
----
FreeBSD-Src-1.0.0
http://search.cpan.org/~vvelox/FreeBSD-Src-1.0.0/
A object oriented interface to building FreeBSD from source.
----
HTML-Tested-0.34
http://search.cpan.org/~bosu/HTML-Tested-0.34/
Provides HTML widgets with the built-in means of testing.
----
HTML-Widget-Factory-0.067
http://search.cpan.org/~rjbs/HTML-Widget-Factory-0.067/
churn out HTML widgets
----
Ham-Callsign-0.31
http://search.cpan.org/~hardaker/Ham-Callsign-0.31/
----
IO-Lambda-0.11
http://search.cpan.org/~karasik/IO-Lambda-0.11/
non-blocking I/O in lambda style
----
JavaScript-1.07
http://search.cpan.org/~claesjac/JavaScript-1.07/
Perl extension for executing embedded JavaScript
----
JavaScript-Minifier-XS-0.02
http://search.cpan.org/~gtermars/JavaScript-Minifier-XS-0.02/
XS based JavaScript minifier
----
Mail-Builder-1.09
http://search.cpan.org/~maros/Mail-Builder-1.09/
Easily create plaintext/html e-mail messages with attachments, inline images
----
Net-IMAP-Server-0.6
http://search.cpan.org/~alexmv/Net-IMAP-Server-0.6/
A single-threaded multiplexing IMAP server implementation, using Net::Server::Coro.
----
Net-LDAP-Makepath-1.0.0
http://search.cpan.org/~vvelox/Net-LDAP-Makepath-1.0.0/
Provides a methode for creating paths in LDAP simply.
----
Net-Sieve-0.05
http://search.cpan.org/~yvesago/Net-Sieve-0.05/
Implementation of managesieve protocol to manage sieve scripts
----
Net-Sieve-Script-0.06
http://search.cpan.org/~yvesago/Net-Sieve-Script-0.06/
Parse and write sieve scripts
----
ONTO-PERL-1.12
http://search.cpan.org/~easr/ONTO-PERL-1.12/
----
POE-Component-CPAN-YACSmoke-1.26
http://search.cpan.org/~bingos/POE-Component-CPAN-YACSmoke-1.26/
Bringing the power of POE to CPAN smoke testing.
----
POE-Component-Pluggable-1.04
http://search.cpan.org/~bingos/POE-Component-Pluggable-1.04/
A base class for creating plugin enabled POE Components.
----
POE-Component-Server-DNS-0.16
http://search.cpan.org/~bingos/POE-Component-Server-DNS-0.16/
A non-blocking, concurrent DNS server POE component
----
POE-Component-Server-Inet-0.04
http://search.cpan.org/~bingos/POE-Component-Server-Inet-0.04/
a super-server daemon implementation in POE
----
Pg-Pcurse-0.08
http://search.cpan.org/~ioannis/Pg-Pcurse-0.08/
Monitors a Postgres cluster
----
Pod-Html-1.09_02
http://search.cpan.org/~dland/Pod-Html-1.09_02/
Convert POD files to HTML
----
Rose-DBx-Object-Renderer-0.06
http://search.cpan.org/~danny/Rose-DBx-Object-Renderer-0.06/
Web UI Rendering for Rose::DB::Object
----
Runops-Hook-0.01
http://search.cpan.org/~nuffin/Runops-Hook-0.01/
C level hooking of the runloop
----
Simple-SAX-Serializer-0.02
http://search.cpan.org/~adrianwit/Simple-SAX-Serializer-0.02/
Simple XML serializer
----
TemplateM-2.20
http://search.cpan.org/~abalama/TemplateM-2.20/
*ML templates processing module
----
Test-CheckChanges-0.06
http://search.cpan.org/~gam/Test-CheckChanges-0.06/
Check that the Changes file matches the distribution.
----
Test-DBUnit-0.02
http://search.cpan.org/~adrianwit/Test-DBUnit-0.02/
Database test framework.
----
Test-HTTP-Server-Simple-0.07
http://search.cpan.org/~alexmv/Test-HTTP-Server-Simple-0.07/
Test::More functions for HTTP::Server::Simple
----
Test-HTTP-Server-Simple-0.08
http://search.cpan.org/~jesse/Test-HTTP-Server-Simple-0.08/
Test::More functions for HTTP::Server::Simple
----
Test-HTTP-Server-Simple-0.09
http://search.cpan.org/~jesse/Test-HTTP-Server-Simple-0.09/
Test::More functions for HTTP::Server::Simple
----
Test-Resub-1.03
http://search.cpan.org/~airwave/Test-Resub-1.03/
Lexically scoped subroutine replacement for testing
----
Text-Match-FastAlternatives-1.00
http://search.cpan.org/~arc/Text-Match-FastAlternatives-1.00/
efficient search for many strings
----
Text-WordDiff-0.04
http://search.cpan.org/~dwheeler/Text-WordDiff-0.04/
Track changes between documents
----
esjis-0.15
http://search.cpan.org/~ina/esjis-0.15/
----
kurila-1.11_0
http://search.cpan.org/~tty/kurila-1.11_0/
Perl Kurila
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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Wed, 7 May 2008 04:28:25 +0000 (UTC)
From: benkasminbullock@gmail.com (Ben Bullock)
Subject: Re: perl PNG image searching
Message-Id: <fvrb59$ghv$1@ml.accsnet.ne.jp>
elie <mazzawi@gmail.com> wrote:
> so I have some images (all PNG)
>
> I have a small image, ( a checkered box) and other larger images that
> may or may not contain the checkered box small image.
> I want to somehow find out if the small image (the checkered box)
> apprears anywhere in the larger PNG's or not.
I don't have any idea how to do this, but whatever solution you arrive
upon it will depend upon some kind of graphics library, which you can
access by Perl, rather than being something you can do with pure Perl
commands. There are a lot of graphics libraries, such as ImageMagick,
which have interfaces to Perl.
You might also want to try asking your question on a graphics
newsgroup or web forum.
------------------------------
Date: Tue, 06 May 2008 20:58:25 -0600
From: "Samik R." <samik@frKKshKll.org>
Subject: Trying to catch invalid emails
Message-Id: <fvr60f$pqd$1@aioe.org>
Hello,
I use the following regular expression to catch typical invalid email
addresses:
------------
my @Email=("sam._\@abc.org", "sam_.\@abc.org", "sam_.\@abc.org");
foreach (@Email)
{
if(/^[A-z0-9]+([_\.][A-z0-9\-]+)*[@][A-z0-9_\-]+([.][A-z0-9_\-]+)?\.[A-z]{2,3}$/)
{ print "$_ is a valid email id\n"; }
else
{ print "$_ is an invalid email id\n"; }
}
-------------
This expression does not catch the above 3 emails in the array (the
program says that they are valid emails).
Can someone help me to discard these three?
Thanks.
------------------------------
Date: Tue, 6 May 2008 20:13:48 -0700 (PDT)
From: Ron Bergin <rkb@i.frys.com>
Subject: Re: Trying to catch invalid emails
Message-Id: <185f2e18-26df-4804-95c8-7384206753db@u6g2000prc.googlegroups.com>
On May 6, 7:58 pm, "Samik R." <sa...@frKKshKll.org> wrote:
> Hello,
> I use the following regular expression to catch typical invalid email
> addresses:
> ------------
> my @Email=("sam._\@abc.org", "sam_.\@abc.org", "sam_.\@abc.org");
> foreach (@Email)
> {
>
> if(/^[A-z0-9]+([_\.][A-z0-9\-]+)*[@][A-z0-9_\-]+([.][A-z0-9_\-]+)?\.[A-z]{2,3}$/)
> { print "$_ is a valid email id\n"; }
> else
> { print "$_ is an invalid email id\n"; }}
>
> -------------
>
> This expression does not catch the above 3 emails in the array (the
> program says that they are valid emails).
>
> Can someone help me to discard these three?
> Thanks.
Try using the Email::Valid module.
use strict;
use warnings;
use Email::Valid;
my @Email=("sam._\@abc.org", "sam_.\@abc.org", "sam_.\@abc.org");
foreach my $address (@Email)
{
print Email::Valid->address($address) ? "$address valid\n" :
"$address not valid\n";
}
------------------------------
Date: Wed, 7 May 2008 04:41:38 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Trying to catch invalid emails
Message-Id: <i0l7f5-rqq.ln1@osiris.mauzo.dyndns.org>
Quoth "Samik R." <samik@frKKshKll.org>:
> Hello,
> I use the following regular expression to catch typical invalid email
> addresses:
Don't do that. Use a module, such as Email::Valid, that actually gets it
right.
Ben
------------------------------
Date: Wed, 7 May 2008 03:56:52 +0000 (UTC)
From: benkasminbullock@gmail.com (Ben Bullock)
Subject: Re: Trying to catch invalid emails
Message-Id: <fvr9a4$g5a$1@ml.accsnet.ne.jp>
Samik R. <samik@frkkshkll.org> wrote:
> if(/^[A-z0-9]+([_\.][A-z0-9\-]+)* ...
The problem is A-z here, A-z contains all of
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz
so it matches the underscore in the email address.
To match only letters, you should use [A-Za-z0-9] instead.
------------------------------
Date: 07 May 2008 08:11:00 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Trying to catch invalid emails
Message-Id: <slrng22p0k.p4r.abigail@alexandra.abigail.be>
_
Samik R. (samik@frKKshKll.org) wrote on VCCCLXIII September MCMXCIII in
<URL:news:fvr60f$pqd$1@aioe.org>:
:) Hello,
:) I use the following regular expression to catch typical invalid email
:) addresses:
:) ------------
:) my @Email=("sam._\@abc.org", "sam_.\@abc.org", "sam_.\@abc.org");
:) foreach (@Email)
:) {
:)
:) if(/^[A-z0-9]+([_\.][A-z0-9\-]+)*[@][A-z0-9_\-]+([.][A-z0-9_\-]+)?\.[A-z]{2,3}$/)
:) { print "$_ is a valid email id\n"; }
:) else
:) { print "$_ is an invalid email id\n"; }
:) }
:) -------------
:)
:) This expression does not catch the above 3 emails in the array (the
:) program says that they are valid emails).
:)
:) Can someone help me to discard these three?
Sure.
if (/_/) {
print "$_ is invalid";
}
else {
print "$_ is valid";
}
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
------------------------------
Date: Wed, 07 May 2008 11:09:24 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: Trying to catch invalid emails
Message-Id: <68d9vaF2slnr9U1@mid.individual.net>
Abigail wrote:
> _
> Samik R. (samik@frKKshKll.org) wrote on VCCCLXIII September MCMXCIII in
> <URL:news:fvr60f$pqd$1@aioe.org>:
> :) Hello,
> :) I use the following regular expression to catch typical invalid email
> :) addresses:
> :) ------------
> :) my @Email=("sam._\@abc.org", "sam_.\@abc.org", "sam_.\@abc.org");
> :) foreach (@Email)
> :) {
> :)
> :) if(/^[A-z0-9]+([_\.][A-z0-9\-]+)*[@][A-z0-9_\-]+([.][A-z0-9_\-]+)?\.[A-z]{2,3}$/)
> :) { print "$_ is a valid email id\n"; }
> :) else
> :) { print "$_ is an invalid email id\n"; }
> :) }
> :) -------------
> :)
> :) This expression does not catch the above 3 emails in the array (the
> :) program says that they are valid emails).
> :)
> :) Can someone help me to discard these three?
>
> Sure.
>
> if (/_/) {
> print "$_ is invalid";
> }
> else {
> print "$_ is valid";
> }
An e-mail address with _ (or ._ or _.) isn't invalid, AFAIK.
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: 07 May 2008 10:00:49 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Trying to catch invalid emails
Message-Id: <slrng22veh.p4r.abigail@alexandra.abigail.be>
_
Frank Seitz (devnull4711@web.de) wrote on VCCCLXIII September MCMXCIII in
<URL:news:68d9vaF2slnr9U1@mid.individual.net>:
;; Abigail wrote:
;; > _
;; > Samik R. (samik@frKKshKll.org) wrote on VCCCLXIII September MCMXCIII in
;; > <URL:news:fvr60f$pqd$1@aioe.org>:
;; > :) Hello,
;; > :) I use the following regular expression to catch typical invalid email
;; > :) addresses:
;; > :) ------------
;; > :) my @Email=("sam._\@abc.org", "sam_.\@abc.org", "sam_.\@abc.org");
;; > :) foreach (@Email)
;; > :) {
;; > :)
;; > :) if(/^[A-z0-9]+([_\.][A-z0-9\-]+)*[@][A-z0-9_\-]+([.][A-z0-9_\-]+)?\.[A-z]{2,3}$/)
;; > :) { print "$_ is a valid email id\n"; }
;; > :) else
;; > :) { print "$_ is an invalid email id\n"; }
;; > :) }
;; > :) -------------
;; > :)
;; > :) This expression does not catch the above 3 emails in the array (the
;; > :) program says that they are valid emails).
;; > :)
;; > :) Can someone help me to discard these three?
;; >
;; > Sure.
;; >
;; > if (/_/) {
;; > print "$_ is invalid";
;; > }
;; > else {
;; > print "$_ is valid";
;; > }
;;
;; An e-mail address with _ (or ._ or _.) isn't invalid, AFAIK.
But that wasn't what he asked.
He wanted to filter out three particular email addresses.
Abigail
--
my $qr = qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
$qr =~ s/$qr//g;
print $qr, "\n";
------------------------------
Date: Wed, 7 May 2008 04:31:28 +0000 (UTC)
From: benkasminbullock@gmail.com (Ben Bullock)
Subject: Re: Why doesn't Perl complain about this bareword?
Message-Id: <fvrbb0$ghv$2@ml.accsnet.ne.jp>
Ronny <ro.naldfi.scher@gmail.com> wrote:
> By chance I found out that no error is issued on the following
> program:
>
> perl -w -e 'use strict; print(Does::Not::Exist,"\n")'
>
> Instead, "Does::Not::Exist" is printed. Shouldn't there be a warning
> about
> the improper use of a bareword?
It seems to be a bug in Perl.
------------------------------
Date: Tue, 6 May 2008 14:04:49 -0700 (PDT)
From: Anand <anand.acharya@gmail.com>
Subject: Re: WriteExcel->sheets() fails to get the worksheets
Message-Id: <aad391bb-2049-4fee-980d-c58273db03c4@b5g2000pri.googlegroups.com>
On May 5, 4:58 pm, Jim Gibson <jimsgib...@gmail.com> wrote:
> In article
> <fea47429-8010-4353-bbd2-dc4c825bf...@p39g2000prm.googlegroups.com>,
>
> Anand <anand.acha...@gmail.com> wrote:
> > I am trying to read an excel file usign the writeexcel. Following is
> > the code-snippet:
> > my $workbook = Spreadsheet::WriteExcel->new('Temp.xls');
>
> > print "Cannot create Temp.xls: $!\n" if (not defined $workbook);
>
> > foreach $worksheet ($workbook->sheets()) {
> > print "Worksheet Name is: ".$worksheet->get_name()."\n";
> > }
>
> > The file Temp.xls is already existing in the directory. I want to
> > further modify the worksheets. However, the sheets() method itself is
> > not working.
> > What might be the reason? I'm using perl 5.8
>
> Have you read the documentation for Spreadsheet::WriteExcel?
>
> From 'perldoc Spreadsheet::WriteExcel':
>
> "This module cannot be used to write to an existing Excel file."
>
> To modify an existing spreadsheet file, your choice is to create a new,
> empty spreadsheet with Spreadsheet::WriteExcel, read the existing
> spreadsheet with Spreadsheet::ParseExcel, and copy the information in
> the existing spreadsheet to the new one, or search CPAN for a module
> that can update an existing spreadsheet. I believe there used to be
> one, but I have never used it and cannot find it.
>
> --
> Jim Gibson
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> http://www.usenet.com
Thanks Jim.
I could successfully use WriteExcel to create a workbook. I created
three worksheets. However, I'm having issues when I switch between
sheets.
If I switch between the sheets, the output file vanishes and gets
replaced by an empty file.
$oSheet1 = $oWorkbook->sheets(0);
.... Write some data on Sheet(0).....
$oSheet2 = $oWorkbook->sheets(1);
.... Write some data on sheet(1);
After theses statements, my output file is of zero size with no data
in it.
If I use only one sheet of the two, it works fine but updates only one
sheet.
thanks,
Anand.
------------------------------
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 1514
***************************************