[28205] in Perl-Users-Digest
Perl-Users Digest, Issue: 9569 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 7 03:05:51 2006
Date: Mon, 7 Aug 2006 00:05:07 -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, 7 Aug 2006 Volume: 10 Number: 9569
Today's topics:
Re: A possable bug in the "warnings" pragma. <1usa@llenroc.ude.invalid>
Re: A possable bug in the "warnings" pragma. axel@white-eagle.invalid.uk
Re: A possable bug in the "warnings" pragma. <rvtol+news@isolution.nl>
Re: A possable bug in the "warnings" pragma. axel@white-eagle.invalid.uk
Re: How to "convert" a string into a variable name? <betterdie@gmail.com>
Re: How to "convert" a string into a variable name? <1usa@llenroc.ude.invalid>
how to automate a forced device uninstall <ToddMargoChester@invalid.com>
Re: how to automate a forced device uninstall <ccalvert@Zanguru.com>
Re: install new package <a@mail.com>
Re: install new package <1usa@llenroc.ude.invalid>
Re: install new package <bik.mido@tiscalinet.it>
new CPAN modules on Mon Aug 7 2006 (Randal Schwartz)
perl regular expression help uttamhoode@gmail.com
Re: PERL Script to Load data into an oracle database <ramcgowan@comcast.net>
Re: Proc::Daemon and Sockets <shrike@cyberspace.org>
Re: Read buffer size for XML::Twig <xmltwig@gmail.com>
Simple file list in directory to array <nospam@nospam.net>
Zero'ing out an array <nospam@nospam.net>
Re: Zero'ing out an array <DJStunks@gmail.com>
Re: Zero'ing out an array <mumia.w.18.spam+nospam.usenet@earthlink.net>
Re: Zero'ing out an array <rvtol+news@isolution.nl>
Re: Zero'ing out an array <someone@example.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 06 Aug 2006 16:54:00 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: A possable bug in the "warnings" pragma.
Message-Id: <Xns98178351C2C2asu1cornelledu@127.0.0.1>
Ben Morrow <benmorrow@tiscali.co.uk> wrote in
news:rbbhq3-kc7.ln1@osiris.mauzo.dyndns.org:
>
> Quoth "A. Sinan Unur" <1usa@llenroc.ude.invalid>:
>> Dale Wiles <WilesIgnoreMe@IgnoreMeModArnis.Com> wrote in
>> news:36kf5ovh19w.vyr@IgnoreMeModArnis.Com:
...
>> > This program, posted below, should die at "Killed me.". If I run
>> > it I get:
>> >
>> > Saw me. at perl_warnings_fails line 36
>> > Killed me. at perl_warnings_fails line 40
>> > Revenge from beyond the grave! at perl_warnings_fails line 43
>> > Out of the function. at perl_warnings_fails line 48
>> >
>> > If I uncomment "my $y = \@_;"
>> >
>> > Saw me. at perl_warnings_fails line 36
>> > Killed me. at perl_warnings_fails line 40
>> >
>> > which is what's expected.
>> >
>> > There's nothing special about "my $y = \@_;". Pretty much
>> > anything
>> > that touches "@_" masks the bug. "@_ = ();" works as does "print
>> > \@;" That's why I think it's a bug in the Perl interpreter.
>>
>> ...
>>
>> > ---- perl_warnings ----
>> >
>> > #!/usr/bin/perl
>> >
>> > package Foo;
>> > use strict;
>> > use warnings::register;
>> >
>> > sub new($)
>>
>> Why are you using prototypes with methods?
>>
>> > {
>> > my ($self) = @_;
>> >
>> > my $class = { };
>> > bless $class, $self;
>> >
>> > return $class;
>> > }
>>
>> You have the concepts mixed up here: New is passed the name of the
>> package as its first argument. Then, you bless an instance into that
>> package, returned the blessed reference which is the instance of the
>> class. Hence, your new method, in this case, should be:
>>
>> sub new {
>> my $class = shift;
>> bless { }, $class;
>> }
>
> This is functionally equivalent to what the OP had. The only
> difference is he had then names $self and $class the wrong way round.
Of course. And that was my point. Using the wrong words for things was a
read flag to me.
>> > warnings::warnif($self, $text);
>>
>> Now, your confusion with classes and instances carries over here. The
>> category you have created is called 'Foo'. Do you think $self eq
>> 'Foo'?
>>
>> Replace this with:
>>
>> warnings::warnif(Foo => $text);
>
> warnings::warnif (claims to) accept an object and use that object's
> class as the category.
That it does (which I had missed).
> In any case explicitly specifying te category is not a good idea. In a
> method you should probably use ref $self; in a function just use
> 1-param warnif that uses the current package.
I have confirmed that both:
warnings::warnif(ref $self, $text);
and
warnings::warnif($text);
result in the expected behavior.
However,
warnings::warnif($self, $text);
results in FATAL not being obeyed.
I did some single stepping, inspecting bitmasks etc, but I haven't been
able to come up with a satisfactory explanation for this.
Just for the record, here is the shortened version of the original script
which I have been playing around with:
#!/usr/bin/perl
package Foo;
use strict;
use warnings::register;
sub new { bless { } => $_[0] }
# FATAL is not obeyed
sub warnme { warnings::warnif(shift, shift) }
# FATAL is obeyed
# sub warnme { shift; warnings::warnif(shift) }
# FATAL is obeyed
# sub warnme { warnings::warnif(ref shift, shift) }
package main;
use strict;
use warnings;
sub wtest {
my $f = shift;
$f->warnme('Saw me.');
{
use warnings FATAL => 'Foo';
$f->warnme('Killed me.');
}
$f->warnme('Revenge from beyond the grave!');
}
my $g = Foo->new;
wtest($g);
$g->warnme('Out of the function.');
__END__
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Mon, 07 Aug 2006 00:23:14 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: A possable bug in the "warnings" pragma.
Message-Id: <SJvBg.13085$lv.7233@fed1read12>
A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
> "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net> wrote in news:GdcBg.70$Sn3.8@newsread3.news.pas.earthlink.net:
>>> Dale Wiles <WilesIgnoreMe@IgnoreMeModArnis.Com> wrote in
>>> news:36kf5ovh19w.vyr@IgnoreMeModArnis.Com:
>>> Well, I have to tell you, there seems to be a problem with your posting
>>> software. XNews thinks this post was made on 30 Dec 1899.
>> Nope, Seamonkey says it was posted today, and the date header
>> says "Date: Sat Aug 5 22:57:29 2006 +0000"
> Well, I see that information in the message headers too. However,
> in the message listing window, I see the 1899 date.
>
> By the way, Google Groups has not heard of this message yet:
> http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/01d1fa7f1c131045/45ce76dfdaff24dc#45ce76dfdaff24dc
> http://groups.google.com/groups?selm=36kf5ovh19w.vyr%40IgnoreMeModArnis.Com
> There is something odd going on.
My newsreader (tin) shows the date as being 'Wed, 31 Dec 1969
15:59:59' for the OP's article in its summary information at the
top of the message. I don't see where it can be getting that
information... unless perhaps the OP's use of an obsolete/invalid
format for the 'Date:' header field is causing the screw-up.
Axel
------------------------------
Date: Mon, 7 Aug 2006 02:52:34 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: A possable bug in the "warnings" pragma.
Message-Id: <eb6a5p.14s.1@news.isolution.nl>
axel schreef:
> My newsreader (tin) shows the date as being 'Wed, 31 Dec 1969
> 15:59:59' for the OP's article in its summary information at the
> top of the message. I don't see where it can be getting that
> information... unless perhaps the OP's use of an obsolete/invalid
> format for the 'Date:' header field is causing the screw-up.
That is epoch -8 hours. Your EDT is GMT-4, so maybe your tin subtracted
twice...
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Mon, 07 Aug 2006 01:19:44 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: A possable bug in the "warnings" pragma.
Message-Id: <QywBg.13087$lv.8721@fed1read12>
Dr.Ruud <rvtol+news@isolution.nl> wrote:
> axel schreef:
>> My newsreader (tin) shows the date as being 'Wed, 31 Dec 1969
>> 15:59:59' for the OP's article in its summary information at the
>> top of the message. I don't see where it can be getting that
>> information... unless perhaps the OP's use of an obsolete/invalid
>> format for the 'Date:' header field is causing the screw-up.
> That is epoch -8 hours. Your EDT is GMT-4, so maybe your tin subtracted
> twice...
Ah... I'ma actually in PDT although it seems that my news server is
using EDT. It makes sense... tin cannot cope with the invalid Date: and
so its date routine returns one second less than the epoch, i.e. -1.
Axel
------------------------------
Date: 6 Aug 2006 21:19:14 -0700
From: "perlistpaul" <betterdie@gmail.com>
Subject: Re: How to "convert" a string into a variable name?
Message-Id: <1154924354.246182.90550@n13g2000cwa.googlegroups.com>
I give suggestion, but not mean I adhesive with it.
Symbolic reference is considered dangerous
Alternative is soft reference
A. Sinan Unur wrote:
> "Anonymous" <nospam@somewhere.com> wrote in
> news:NcidnWamg7Y4jEnZnZ2dnUVZ_sydnZ2d@comcast.com:
>
> [ Please do not top-post. Please do not quote signatures. ]
>
> > "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> > news:Xns9814D1682D4D4asu1cornelledu@127.0.0.1...
> >> "thrill5" <nospam@comcast.net> wrote in
> >> news:Naydnds0WNMhDk_ZnZ2dnUVZ_umdnZ2d@comcast.com:
> >>
> >> First, do not top-post.
> >>
> >>> I think this is what you had in mind:
> >>>
> >>> $TempOut = 25;
> >>> $name = "TempOut";
> >>> print $$name;
> >>
> >> Second, it has already been explained that this is not a good idea.
> >>
> >> Please do read the FAQ:
> >>
> >> perldoc -q "How can I use a variable as a variable name"
> >
> > This message group is NOT a programming class, it is a forum where
> > people can ask questions about Perl and others can HELP them. Just
> > because YOU don't think it is good programming practice is no reason
> > not to answer the OP's question.
>
> The OP's question has been answered. The OP is a rational person who saw
> the value of using a hash in this case, and the potential problems with
> using a symref
>
> > Your idea of help is to berate and bully posters,
>
> There is no bullying above. Just a reminder that using symrefs is not a
> good idea most of the time, and a pointer to the FAQ where the reasons for
> the caution are well explained
>
> > lecture on what you think is good practice, what you
> > think is not good practice, how to post, read the FAQ, read the docs,
> > etc., etc. This is the most arrogant newsgroup on the 'net, and your
> > presence here is the number one contributor to that attitude.
>
> Thank you for holding me in such high esteem.
>
> > Quite frankly this newsgroup would be a much better and NICER place
> > without you.
> >
> > Scott
>
> I post what I feel is the right response to each post. Thoughtful
> questions posted by rational people get thoughtful responses. Sometimes I
> can provide a solution, sometimes I make mistakes, and I learn from
> corrections. That is the benefit of this group to me: Learning by trying
> to answer questions, and by reading others' corrections of my posts.
>
> Posts made without any effort, without even checking the FAQ list, or the
> documentation for functions used etc subtract from that value, and
> therefore I try to discourage them.
>
> Feel free to ignore me. However, let me at least point out that I do not
> hide behind anonymous handles when I post. Come back when you actually
> develop the courage back up your posts.
>
> Sinan
> --
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Mon, 07 Aug 2006 04:50:35 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to "convert" a string into a variable name?
Message-Id: <Xns98188ABF47E6asu1cornelledu@127.0.0.1>
"perlistpaul" <betterdie@gmail.com> wrote in
news:1154924354.246182.90550@n13g2000cwa.googlegroups.com:
> I give suggestion, but not mean I adhesive with it.
Whatever that means.
> A. Sinan Unur wrote:
>> "Anonymous" <nospam@somewhere.com> wrote in
>> news:NcidnWamg7Y4jEnZnZ2dnUVZ_sydnZ2d@comcast.com:
>>
>> [ Please do not top-post. Please do not quote signatures. ]
>>
>> > "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
>> > news:Xns9814D1682D4D4asu1cornelledu@127.0.0.1...
>> >> "thrill5" <nospam@comcast.net> wrote in
>> >> news:Naydnds0WNMhDk_ZnZ2dnUVZ_umdnZ2d@comcast.com:
>> >>
>> >> First, do not top-post.
I guess you can't read. Good night and *PLONK*
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Sun, 06 Aug 2006 19:40:50 -0700
From: Todd and Margo Chester <ToddMargoChester@invalid.com>
Subject: how to automate a forced device uninstall
Message-Id: <eb694m$5qu$1@emma.aioe.org>
Hi All,
I have a XP Pro computer with an external SATA (E-SATA)
drive attached. Occasionally, the E-SATA drive has to be
swapped out with a second drive. The method of doing this is
to go into the device manager, select the external hard
drive, clink on "uninstall", flip the power off to the
drive, swap the new drive in, turn the power back on.
The device manager automatically loads the new drive
up. Works fine.
Question: it there a way to automate this with a
batch file, Perl script, etc, such that the user only
has to click on a desktop icon to uninstall the drive?
(I am afraid the user will accidentally uninstall her
C: drive.)
Many thanks,
-T
------------------------------
Date: Sun, 06 Aug 2006 22:53:27 -0400
From: Clay Calvert <ccalvert@Zanguru.com>
Subject: Re: how to automate a forced device uninstall
Message-Id: <nmadd2p63s28mihgm9tvtvdmj4s2gdac8v@4ax.com>
On Sun, 06 Aug 2006 19:40:50 -0700, Todd and Margo Chester
<ToddMargoChester@invalid.com> wrote:
> Question: it there a way to automate this with a
>batch file, Perl script, etc, such that the user only
>has to click on a desktop icon to uninstall the drive?
>(I am afraid the user will accidentally uninstall her
>C: drive.)
Devcon.exe, a free tool at Microsoft's site, can do this. It is their
command line Device Manager.
Clay Calvert
CCalvert@Zanguru.com
Replace "Z" with "L"
------------------------------
Date: Sun, 06 Aug 2006 18:02:25 GMT
From: "a" <a@mail.com>
Subject: Re: install new package
Message-Id: <R8qBg.325786$Mn5.69625@pd7tw3no>
Hi
What is AS? How to tell my Perl version is AS Perl?
What is ppm? I run perl on cygwin platform.
Thanks
"Michele Dondi" <bik.mido@tiscalinet.it>
???????:mcdbd297ikpvmu6nseov1s4d2tr6dnftg9@4ax.com...
> On Sun, 06 Aug 2006 08:43:19 GMT, "a" <a@mail.com> wrote:
>
> >Is there any installation package able to download all the required
> >components?
>
> Seeing your headers, chances are you are using AS Perl anyway. So just
> fire up ppm, which should be easily available in the appropriate
> folder under the start menu.
>
>
> 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: Sun, 06 Aug 2006 18:41:48 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: install new package
Message-Id: <Xns98179598F4A05asu1cornelledu@127.0.0.1>
"a" <a@mail.com> wrote in news:R8qBg.325786$Mn5.69625@pd7tw3no:
[ Please do not top-post. Please do not quote signatures. Please do read
the posting guidelines and provide enough information when you post. ]
> "Michele Dondi" <bik.mido@tiscalinet.it>
> ???????:mcdbd297ikpvmu6nseov1s4d2tr6dnftg9@4ax.com...
>> On Sun, 06 Aug 2006 08:43:19 GMT, "a" <a@mail.com> wrote:
>>
>> >Is there any installation package able to download all the required
>> >components?
>>
>> Seeing your headers, chances are you are using AS Perl anyway. So
just
>> fire up ppm, which should be easily available in the appropriate
>> folder under the start menu.
...
> What is AS?
ActiveState. They distribute a native Perl for Windows.
> How to tell my Perl version is AS Perl?
perl -v
> What is ppm?
ppm is Perl Package Manager. Comes with ActiveState's Perl distribution.
> I run perl on cygwin platform.
You should be able to use CPAN, then.
perldoc CPAN
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: 6 Aug 2006 23:19:46 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: install new package
Message-Id: <t5ncd212l1sgso67stl3j8l392c203dcl5@4ax.com>
On Sun, 06 Aug 2006 18:02:25 GMT, "a" <a@mail.com> wrote:
>What is AS? How to tell my Perl version is AS Perl?
>What is ppm? I run perl on cygwin platform.
Oops my guess was wrong. Just use CPAN.pm then!
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: Mon, 7 Aug 2006 04:42:08 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Aug 7 2006
Message-Id: <J3M2E8.5vn@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.
Acme-MetaSyntactic-0.86
http://search.cpan.org/~book/Acme-MetaSyntactic-0.86/
Themed metasyntactic variables names
----
Apache-Peek-1.06
http://search.cpan.org/~pgollucci/Apache-Peek-1.06/
A data debugging tool for the XS programmer (under mod_perl)
----
Authen-Passphrase-0.001
http://search.cpan.org/~zefram/Authen-Passphrase-0.001/
hashed passwords/passphrases as objects
----
Blog-BlogML-Reader-1.0
http://search.cpan.org/~mmathews/Blog-BlogML-Reader-1.0/
Read data from a BlogML formatted XML document.
----
Blog-BlogML-Reader-1.01
http://search.cpan.org/~mmathews/Blog-BlogML-Reader-1.01/
Read data from a BlogML formatted XML document.
----
Blog-BlogML-Reader-1.02
http://search.cpan.org/~mmathews/Blog-BlogML-Reader-1.02/
Read data from a BlogML formatted XML document.
----
CGI-Application-Plugin-PageBuilder-0.91
http://search.cpan.org/~cmoore/CGI-Application-Plugin-PageBuilder-0.91/
Simplifies building pages with multiple templates.
----
Crypt-Eksblowfish-0.000
http://search.cpan.org/~zefram/Crypt-Eksblowfish-0.000/
the Eksblowfish block cipher
----
DBIx-VersionedSubs-0.04
http://search.cpan.org/~corion/DBIx-VersionedSubs-0.04/
all your code are belong into the DB
----
Devel-Cover-0.58
http://search.cpan.org/~pjcj/Devel-Cover-0.58/
Code coverage metrics for Perl
----
Etk-Perl-0.03
http://search.cpan.org/~leviathan/Etk-Perl-0.03/
----
Graph-0.79
http://search.cpan.org/~jhi/Graph-0.79/
graph data structures and algorithms
----
HTML-Tree-3.21
http://search.cpan.org/~petek/HTML-Tree-3.21/
overview of HTML::TreeBuilder et al
----
MDV-Repsys-0.06
http://search.cpan.org/~nanardon/MDV-Repsys-0.06/
----
POE-Filter-JSON-0.01
http://search.cpan.org/~xantus/POE-Filter-JSON-0.01/
A POE filter using JSON
----
Parse-Win32Registry-0.22
http://search.cpan.org/~jmacfarla/Parse-Win32Registry-0.22/
Parse Windows Registry Files
----
Perl-Critic-0.18_01
http://search.cpan.org/~thaljef/Perl-Critic-0.18_01/
Critique Perl source code for best-practices
----
Search-Estraier-0.07
http://search.cpan.org/~dpavlin/Search-Estraier-0.07/
pure perl module to use Hyper Estraier search engine
----
Util-Properties-0.05
http://search.cpan.org/~alexmass/Util-Properties-0.05/
Java.util.properties like class
----
Video-DVDRip-0.97.13
http://search.cpan.org/~jred/Video-DVDRip-0.97.13/
GUI for copying DVDs, based on an open Low Level API
----
Win32-API-Interface-0.02
http://search.cpan.org/~esskar/Win32-API-Interface-0.02/
Object oriented interface generation
----
Win32-Security-EFS-0.11
http://search.cpan.org/~esskar/Win32-Security-EFS-0.11/
Perl interface to functions that assist in working with EFS (Encrypted File System) under Windows plattforms.
----
Wx-0.55
http://search.cpan.org/~mbarbon/Wx-0.55/
interface to the wxWidgets cross-platform GUI toolkit
----
forks-BerkeleyDB-0.02
http://search.cpan.org/~rybskej/forks-BerkeleyDB-0.02/
high-performance drop-in replacement for threads
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: 6 Aug 2006 23:47:17 -0700
From: uttamhoode@gmail.com
Subject: perl regular expression help
Message-Id: <1154933237.688757.34880@h48g2000cwc.googlegroups.com>
hi all,
i have around 100 perl CGI scripts in which i want to delete some
string.
String is $abc::message{M001} i want to remove $abc::message{ } so
that the string becomes M001.
if i get regular expression for the above i will change the files using
PERL command line
Regards,
uttam hoode
------------------------------
Date: 6 Aug 2006 19:41:00 -0700
From: "freeholder" <ramcgowan@comcast.net>
Subject: Re: PERL Script to Load data into an oracle database
Message-Id: <1154918460.048024.324600@m79g2000cwm.googlegroups.com>
> xhoster@gmail.com wrote:
> > bony_dev@yahoo.com wrote:
> > > Hello,
> > >
> > > i am trying to write a perl script to load data in oracle from windows.
> > > has anybody doe this before..please guide me on how to do this..what
> > > modules to use etc..thanks
> >
> > DBI, DBD::Oracle. The very newest DBD::Oracle has a "real" execute_array,
> > which is very much faster than the older emulations.
> >
> > Xho
> >
> > --
> > -------------------- http://NewsReader.Com/ --------------------
> > Usenet Newsgroup Service $9.95/Month 30GB
bony_dev@yahoo.com wrote:
> I have been getting this oracle error and not even successfull trying
> to connect to the oracle database---i have tried several combinations
> to connect but no luck..
>
> Unable to connect : ORA-12705: Cannot access NLS data files or invalid
> environment specified (DBD ERROR: OCISessionBegin)
>
> my code to conect is -
>
> use DBI;
>
> my $dbh = DBI->connect('dbi:Oracle:', q{scott/tiger@(DESCRIPTION =
> (ADDRESS = (PROTOCOL = TCP)(HOST = host.com)(PORT = 1521))
> (CONNECT_DATA =
> (SERVER = DEDICATED)
> (SID=SIDNAME)
> (SERVICE_NAME = bony)
> )
> )},"" )|| die "Unable to connect : $DBI::errstr\n";
> print "connection established\n";
>
> Please help..
>
> Thanks..Bony
>
I'm not familiar with the notation you're using, above. I've set up
the connection using one of the following two ways:
1. Using ORACLE_HOME and the tnsnames.ora file (see your Oracle
manuals and tutorials for how to set up your environment), and assuming
the SID is 'bony', your connect string would look like:
my $dbh = DBI->connect('dbi:Oracle:bony', $user, $passwd) or die ...
2. But I prefer, at least for an application that is designed to work
with a specific schema, to use this format (which allows you to
dispense with the environment and having to use the tnsnames.ora file):
my $dbh = DBI->connect('dbi:Oracle:host=host.com;port=1521;sid=bony',
$user, $passwd)
or die ...
The DBI connect function allows you to add additional information, such
as attributes that control some of how the connection works, but you
should get this working before trying to add functionality.
Hope this helps.
Bob
------------------------------
Date: 6 Aug 2006 17:47:08 -0700
From: "shrike@cyberspace.org" <shrike@cyberspace.org>
Subject: Re: Proc::Daemon and Sockets
Message-Id: <1154911628.443030.162550@h48g2000cwc.googlegroups.com>
A. Sinan Unur wrote:
> "shrike@cyberspace.org" <shrike@cyberspace.org> wrote in
> news:1154806948.895445.23940@b28g2000cwb.googlegroups.com:
>
> > my $foo = IO::Socket::INET->new(Listen => 1,
> > LocalPort => $self->{'l'},
> > Reuse => 1,
> > Blocking => 0,
> > Proto => 'tcp')
> > || die "The socket will not listen." ;
>
> I don't have time to look into this now, but, how about checking why
> listen failed?
>
> die "Listen failed:\n\$! = $!\n\$@ = $@";
>
> Sinan
> --
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
Thanks for the help!
This is my error:
Listen failed: $! = Address already in use $@ = IO::Socket::INET:
Address already in use.
At first I thought it was a userid problem so I did this:
warn $> ; #
warn $< ; #
my $foo = IO::Socket::INET->new(Listen => 1,
LocalPort => $self->{'l'},
Reuse => 1,
Blocking => 0,
Proto => 'tcp')
|| die "The socket will not listen." ;
And it seems to clear the failure. Why I have no clue. I'd rather not
depend on that fix. Is there a way to more explicity clear the "Address
already in use" problem ? I'm using the latest libs for everything
except the core libraries with perl 5.8.7.
-Thanks in advance!
-Matt
------------------------------
Date: 6 Aug 2006 14:20:52 -0700
From: "mirod" <xmltwig@gmail.com>
Subject: Re: Read buffer size for XML::Twig
Message-Id: <1154899252.695183.63630@b28g2000cwb.googlegroups.com>
Jase Wells wrote:
> I'm using XML::Twig to process a large XML file, and it's working fine.
> That is, except for a particular node whose text is quite long -- the
> data between the start/end tags is around 50 MB or so.
>
> It seems to take a looong time to read, so I added a char_handler to
> see what was happening. My char_handler subroutine tells me it's
> receiving at most 1024 bytes at a time. Is there some option to change
> the buffer size XML::Twig (or XML::Parser) uses to read the source
> file? I've looked around, but no luck yet.
The size of the buffer is indeed not set by XML::Twig. It could be in
XML::Parser or
directly in expat.
I would be very interested if you find this information.
Thank you.
--
mirod
------------------------------
Date: Mon, 07 Aug 2006 16:01:10 +1000
From: darkmoo <nospam@nospam.net>
Subject: Simple file list in directory to array
Message-Id: <pan.2006.08.07.06.01.09.594000@nospam.net>
Thanks to all that have helped with my previous question.
Now one more question. I've completely forgetten how to grab a list of all
files in a directory and load it up into an array.
Im not a full time perl programmer so always returning back to te learning
curve on the same topics :(
Any help would be greatly appreciated.
------------------------------
Date: Mon, 07 Aug 2006 13:04:35 +1000
From: darkmoo <nospam@nospam.net>
Subject: Zero'ing out an array
Message-Id: <pan.2006.08.07.03.04.35.157000@nospam.net>
How does one do so?
------------------------------
Date: 6 Aug 2006 20:03:36 -0700
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: Zero'ing out an array
Message-Id: <1154919816.342920.211280@h48g2000cwc.googlegroups.com>
darkmoo wrote:
> How does one do so?
assign an empty list to the array.
@array = ();
-jp
------------------------------
Date: Mon, 07 Aug 2006 03:58:53 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: Zero'ing out an array
Message-Id: <1UyBg.5496$0e5.1009@newsread4.news.pas.earthlink.net>
On 08/06/2006 10:04 PM, darkmoo wrote:
> How does one do so?
Unlike arrays in the C programming language, Perl arrays do
not need to be zero-ed out to clear them; just undefine the array:
undef @myarray;
------------------------------
Date: Mon, 7 Aug 2006 05:52:18 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Zero'ing out an array
Message-Id: <eb6kq3.200.1@news.isolution.nl>
darkmoo schreef:
> Subject: Zero'ing out an array
> How does one do so?
Do you want the existing members to each become zero, or do you want to
delete them all?
See also `perldoc -q array`.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Mon, 07 Aug 2006 05:42:05 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Zero'ing out an array
Message-Id: <NoABg.192059$S61.144285@edtnps90>
darkmoo wrote:
> How does one do so?
$_ = 0 for @array;
John
--
use Perl;
program
fulfillment
------------------------------
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 V10 Issue 9569
***************************************