[32100] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3364 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 24 18:09:26 2011

Date: Sun, 24 Apr 2011 15:09:08 -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           Sun, 24 Apr 2011     Volume: 11 Number: 3364

Today's topics:
    Re: A regex to search for numeric ranges... <nospam-abuse@ilyaz.org>
    Re: DBD DB2 <c.joydeep@gmail.com>
    Re: DBD DB2 <c.joydeep@gmail.com>
    Re: DBD DB2 <c.joydeep@gmail.com>
    Re: DBD DB2 <john@castleamber.com>
    Re: for @{ my $x } on Perl 5.10 (bug?) <derykus@gmail.com>
    Re: for @{ my $x } on Perl 5.10 (bug?) <hjp-usenet2@hjp.at>
    Re: for @{ my $x } on Perl 5.10 (bug?) <john@castleamber.com>
    Re: grabbing a facebook group <Uno@example.invalid>
    Re: I can't understand a sentence "Look out for implici <gypark@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 24 Apr 2011 07:11:00 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: A regex to search for numeric ranges...
Message-Id: <slrnir7j84.s7s.nospam-abuse@chorin.math.berkeley.edu>

On 2011-04-21, Eli the Bearded <*@eli.users.panix.com> wrote:
> I'm sure. The second one, mapping integer sequences to characters to 
> then use a Unicode character class has all the workings of a brilliant
> bit of obfuscation. I suspect it doesn't scale well, say 2^16 or
> 2^32, but I don't really know how Perl handles Unicode internally.

When I worked on this (long time ago), there were no compilers with
128-bit IV sitting around (are there now?).  Hence the support I
implemented was intended to work "up to maximal number
representantable by UV", but it is actually coded with limitation "not
higher than 64 bits".  I doubt anybody expanded to further than
this (the "hooks" for expansion are there, just probably not implemented)...

Hope this helps,
Ilya


------------------------------

Date: Sun, 24 Apr 2011 10:23:20 +0530
From: Joydeep Chakrabarty <c.joydeep@gmail.com>
Subject: Re: DBD DB2
Message-Id: <4db3acc7$0$316$14726298@news.sunsite.dk>

John Bokma laid this down on his screen :
> Joydeep Chakrabarty <c.joydeep@gmail.com> writes:
>
>> John Bokma wrote on 4/23/2011 :
>>> Joydeep Chakrabarty <c.joydeep@gmail.com> writes:
>>> 
>>>> Hello all,
>>>> 
>>>> I am trying to install DBD for DB2. I have downloaded both
>>>> DBD-DB2-1.74.tar.gz and DBD-DB2-1.80a.tar.gz as well as DBD-DB2.ppd. I
>>>> am using Windows 7 64-bit with Active Perl 5.12.3.
>>>> When I try to do nmake on DBD-DB2 it gives me error
>>>> "c:\perl64\lib\core\win32.h(61) : fatal error C1083: Cannot open
>>>> include file: 'windows.h': No such file or directory
>>>> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
>>>> Studio 9.0\VC\bin\cl.EXE"' : return code '0x2'
>>>> Stop.
>>>> NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\bin\nmake.exe' :
>>>> return code '0x2'
>>>> Stop."
>>>> 
>>>> When I try to ppm install DBD-DB2.ppd, it gives me error "ppm install
>>>> failed: The PPD does not provide code to install for this platform".
>>>> What am I doing wrong here? Please help.
>>> 
>>> It looks like you need a C compiler + header files to make this
>>> module.
>>> 
>>> Have you added the alternative repositories to ppm? The ones at
>>> ActiveState have a limited set of modules.
>> 
>> I am using Visual C++ 2008 Express edition. What are the other
>> repositories?
>
> I would first check if DBD::DB2 is in one of the other repositories you
> can enable in ppm. See the documentation of ppm. Or if you use the GUI
> version: Click on the gray cog icon (right most icon) and the PPM Preferences
> window is opened.
>
> See also the ppm documentation, which in a default install can be
> reached via the documentation installed at:
>
> file:///C:/Perl/html/index.html 

While trying to install it through CPAN, I got this error

cpan> install DBD::DB2
Running install for module 'DBD::DB2'
Running make for I/IB/IBMTORDB2/DBD-DB2-1.80a.tar.gz
Fetching with LWP:
http://ppm.activestate.com/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.80a.tar.gz
Error reading 'C:\Perl64\cpan\FTPstats.yml': Alert: While trying to 
'parse' YAML file
 'C:\Perl64\cpan\FTPstats.yml'
with 'YAML::XS' the following error was encountered:
  Usage: YAML::XS::LibYAML::Load(yaml_sv) at C:\Perl64\lib/YAML/XS.pm 
line 48.


Stashing away as 'C:\Perl64\cpan\FTPstats.yml.1303620067' to prevent 
further interruptions. You may want to remove that file later.
Could not rename: Permission denied

-- 
Thanks and regards,
Joydeep




------------------------------

Date: Sun, 24 Apr 2011 13:24:00 +0530
From: Joydeep Chakrabarty <c.joydeep@gmail.com>
Subject: Re: DBD DB2
Message-Id: <4db3d723$0$303$14726298@news.sunsite.dk>

on 4/24/2011, Joydeep Chakrabarty supposed :
> John Bokma laid this down on his screen :
>> Joydeep Chakrabarty <c.joydeep@gmail.com> writes:
>>
>>> John Bokma wrote on 4/23/2011 :
>>>> Joydeep Chakrabarty <c.joydeep@gmail.com> writes:
>>>> 
>>>>> Hello all,
>>>>> 
>>>>> I am trying to install DBD for DB2. I have downloaded both
>>>>> DBD-DB2-1.74.tar.gz and DBD-DB2-1.80a.tar.gz as well as DBD-DB2.ppd. I
>>>>> am using Windows 7 64-bit with Active Perl 5.12.3.
>>>>> When I try to do nmake on DBD-DB2 it gives me error
>>>>> "c:\perl64\lib\core\win32.h(61) : fatal error C1083: Cannot open
>>>>> include file: 'windows.h': No such file or directory
>>>>> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
>>>>> Studio 9.0\VC\bin\cl.EXE"' : return code '0x2'
>>>>> Stop.
>>>>> NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\bin\nmake.exe' :
>>>>> return code '0x2'
>>>>> Stop."
>>>>> 
>>>>> When I try to ppm install DBD-DB2.ppd, it gives me error "ppm install
>>>>> failed: The PPD does not provide code to install for this platform".
>>>>> What am I doing wrong here? Please help.
>>>> 
>>>> It looks like you need a C compiler + header files to make this
>>>> module.
>>>> 
>>>> Have you added the alternative repositories to ppm? The ones at
>>>> ActiveState have a limited set of modules.
>>> 
>>> I am using Visual C++ 2008 Express edition. What are the other
>>> repositories?
>>
>> I would first check if DBD::DB2 is in one of the other repositories you
>> can enable in ppm. See the documentation of ppm. Or if you use the GUI
>> version: Click on the gray cog icon (right most icon) and the PPM 
>> Preferences
>> window is opened.
>>
>> See also the ppm documentation, which in a default install can be
>> reached via the documentation installed at:
>>
>> file:///C:/Perl/html/index.html
>
> While trying to install it through CPAN, I got this error
>
> cpan> install DBD::DB2
> Running install for module 'DBD::DB2'
> Running make for I/IB/IBMTORDB2/DBD-DB2-1.80a.tar.gz
> Fetching with LWP:
> http://ppm.activestate.com/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.80a.tar.gz
> Error reading 'C:\Perl64\cpan\FTPstats.yml': Alert: While trying to 'parse' 
> YAML file
>  'C:\Perl64\cpan\FTPstats.yml'
> with 'YAML::XS' the following error was encountered:
>   Usage: YAML::XS::LibYAML::Load(yaml_sv) at C:\Perl64\lib/YAML/XS.pm line 
> 48.
>
>
> Stashing away as 'C:\Perl64\cpan\FTPstats.yml.1303620067' to prevent further 
> interruptions. You may want to remove that file later.
> Could not rename: Permission denied

Well, that problem was solved. I changed the Readonly permission on 
Perl64 folder. Then I ran "C:\Program Files (x86)\Microsoft Visual 
Studio 9.0\Common7\Tools\vsvars32.bat". But Now I am getting Linker 
error.

Constants.obj : fatal error LNK1112: module machine type 'X86' 
conflicts with target machine type 'x64'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
Studio 9.0\VC\BIN\link.EXE"' : return code '0x458'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\BIN\nmake.exe' : 
return code '0x2'
Stop.

I am using Windows 7 64-bit. I guess I am using 32-bit DBD-DB2. Where 
can I get 64-bit perl modules?

-- 
Thanks and regards,
Joydeep




------------------------------

Date: Sun, 24 Apr 2011 15:20:29 +0530
From: Joydeep Chakrabarty <c.joydeep@gmail.com>
Subject: Re: DBD DB2
Message-Id: <4db3f268$0$314$14726298@news.sunsite.dk>

Joydeep Chakrabarty has brought this to us :
> on 4/24/2011, Joydeep Chakrabarty supposed :
>> John Bokma laid this down on his screen :
>>> Joydeep Chakrabarty <c.joydeep@gmail.com> writes:
>>>
>>>> John Bokma wrote on 4/23/2011 :
>>>>> Joydeep Chakrabarty <c.joydeep@gmail.com> writes:
>>>>> 
>>>>>> Hello all,
>>>>>> 
>>>>>> I am trying to install DBD for DB2. I have downloaded both
>>>>>> DBD-DB2-1.74.tar.gz and DBD-DB2-1.80a.tar.gz as well as DBD-DB2.ppd. I
>>>>>> am using Windows 7 64-bit with Active Perl 5.12.3.
>>>>>> When I try to do nmake on DBD-DB2 it gives me error
>>>>>> "c:\perl64\lib\core\win32.h(61) : fatal error C1083: Cannot open
>>>>>> include file: 'windows.h': No such file or directory
>>>>>> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
>>>>>> Studio 9.0\VC\bin\cl.EXE"' : return code '0x2'
>>>>>> Stop.
>>>>>> NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\bin\nmake.exe' :
>>>>>> return code '0x2'
>>>>>> Stop."
>>>>>> 
>>>>>> When I try to ppm install DBD-DB2.ppd, it gives me error "ppm install
>>>>>> failed: The PPD does not provide code to install for this platform".
>>>>>> What am I doing wrong here? Please help.
>>>>> 
>>>>> It looks like you need a C compiler + header files to make this
>>>>> module.
>>>>> 
>>>>> Have you added the alternative repositories to ppm? The ones at
>>>>> ActiveState have a limited set of modules.
>>>> 
>>>> I am using Visual C++ 2008 Express edition. What are the other
>>>> repositories?
>>>
>>> I would first check if DBD::DB2 is in one of the other repositories you
>>> can enable in ppm. See the documentation of ppm. Or if you use the GUI
>>> version: Click on the gray cog icon (right most icon) and the PPM 
>>> Preferences
>>> window is opened.
>>>
>>> See also the ppm documentation, which in a default install can be
>>> reached via the documentation installed at:
>>>
>>> file:///C:/Perl/html/index.html
>>
>> While trying to install it through CPAN, I got this error
>>
>> cpan> install DBD::DB2
>> Running install for module 'DBD::DB2'
>> Running make for I/IB/IBMTORDB2/DBD-DB2-1.80a.tar.gz
>> Fetching with LWP:
>> http://ppm.activestate.com/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.80a.tar.gz
>> Error reading 'C:\Perl64\cpan\FTPstats.yml': Alert: While trying to 'parse' 
>> YAML file
>>  'C:\Perl64\cpan\FTPstats.yml'
>> with 'YAML::XS' the following error was encountered:
>>   Usage: YAML::XS::LibYAML::Load(yaml_sv) at C:\Perl64\lib/YAML/XS.pm line 
>> 48.
>>
>>
>> Stashing away as 'C:\Perl64\cpan\FTPstats.yml.1303620067' to prevent 
>> further interruptions. You may want to remove that file later.
>> Could not rename: Permission denied
>
> Well, that problem was solved. I changed the Readonly permission on Perl64 
> folder. Then I ran "C:\Program Files (x86)\Microsoft Visual Studio 
> 9.0\Common7\Tools\vsvars32.bat". But Now I am getting Linker error.
>
> Constants.obj : fatal error LNK1112: module machine type 'X86' conflicts with 
> target machine type 'x64'
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
> 9.0\VC\BIN\link.EXE"' : return code '0x458'
> Stop.
> NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\BIN\nmake.exe' : return 
> code '0x2'
> Stop.
>
> I am using Windows 7 64-bit. I guess I am using 32-bit DBD-DB2. Where can I 
> get 64-bit perl modules?

OK, I downloaded Active Perl 32-bit and installed it. DBD::DB2 is not 
included but DBD::Oracle is there and working fine. I ran vsvars32.bat. 
Then from CPAN, when I issued install DBD::DB2, it gave so many 
warnings and finally with these following 6 errors, it stopped.

dbdimp.obj : error LNK2019: unresolved external symbol _SQLGetLength@20 
referenced in function _get_lob_length
dbdimp.obj : error LNK2019: unresolved external symbol 
_SQLGetSubString@40 referenced in function _get_lob_data
dbdimp.obj : error LNK2019: unresolved external symbol _sqledcls_api@8 
referenced in function _db2_data_sources
dbdimp.obj : error LNK2019: unresolved external symbol _sqledgne_api@12 
referenced in function _db2_data_sources
dbdimp.obj : error LNK2019: unresolved external symbol _sqledosd_api@16 
referenced in function _db2_data_sources
dbdimp.obj : error LNK2019: unresolved external symbol 
_SQLBindFileToParam@32 referenced in function _db2_bind_ph
blib\arch\auto\DBD\DB2\DB2.dll : fatal error LNK1120: 6 unresolved 
externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
Studio 9.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.

Now, is it Win 7 64-bit OS error or they are in the DBD::DB2 package? 
Please help.


-- 
Thanks and regards,
Joydeep




------------------------------

Date: Sun, 24 Apr 2011 13:20:31 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: DBD DB2
Message-Id: <87zknflde8.fsf@castleamber.com>

Joydeep Chakrabarty <c.joydeep@gmail.com> writes:

> OK, I downloaded Active Perl 32-bit and installed it. DBD::DB2 is not
> included but DBD::Oracle is there and working fine. I ran
> vsvars32.bat. Then from CPAN, when I issued install DBD::DB2, it gave
> so many warnings and finally with these following 6 errors, it
> stopped.

Did you follow my earlier advice? Go to ppm and add the additional
resources. The module(s) you want to install might already be available
via the alternative repositories. If you use the graphical version of
ppm, click on the cog icon and check the repositories that are
available. In the same window you can add several alternative
repositories which are not added by default.

-- 
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/


------------------------------

Date: Sat, 23 Apr 2011 11:45:55 -0700 (PDT)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: for @{ my $x } on Perl 5.10 (bug?)
Message-Id: <63f40398-8aed-4ba4-b5e0-91addb40c8ec@n2g2000prj.googlegroups.com>

On Apr 23, 9:37=A0am, John Bokma <j...@castleamber.com> wrote:
> "C.DeRykus" <dery...@gmail.com> writes:
> > On Apr 22, 7:38=A0am, John Bokma <j...@castleamber.com> wrote:
> >> John Bokma <j...@castleamber.com> writes:
> >> > "C.DeRykus" <dery...@gmail.com> writes:
>
> >> >> On Apr 20, 12:53=A0pm, John Bokma <j...@castleamber.com> wrote:
> >> >>> perl -e 'use strict; use warnings; print for @{ my $x }'
> >> >>> Can't use an undefined value as an ARRAY reference at -e line 1.
>
> >> >>> This is perl, v5.8.8 built for x86_64-linux-thread-multi
>
> >> >>> perl -e 'use strict; use warnings; print for @{ my $x }'
>
> >> >>> This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi
>
> >> >>> Is this a known bug? At least, I assume that the latter working is=
 a bug.
>
> >> >> Same with 5.12.2:
>
> >> >> perl =A0-Mstrict -wle "print if @{my $x}"
> >> >> Can't use an undefined value as an ARRAY reference at -e line 1.
>
> >> >> perl =A0-Mstrict -wle "print for @{my $x}"
>
> >> >> At the very least it seems quirky that the
> >> >> former fails and the latter doesn't.
>
> >> > Thanks Charles, I've reported it using perlbug.
>
> >>http://rt.perl.org/rt3/Ticket/Display.html?id=3D89024
>
> >> It looks like it's a feature. Haven't checked the change logs yet, but=
 I
> >> have the feeling that this was done to make
>
> >> my $x->{ foo } =3D 3;
>
> > But the case above is an lvalue so $x autovivifies.
>
> > In the other example though:
>
> > =A0 =A0perl =A0-Mstrict -wle "print if @{my $x}"
>
> > 'strict' generates a "Can't use an undefined
> > value as an ARRAY reference" and autoviv will
> > occur only without 'strict'.
>
> > Make the above an lvalue and there's no error:
>
> > =A0 =A0perl =A0-Mstrict -wle "print if @{my $x}=3D()"
>
> > Similarly, 'use strict' should also complain
> > in the case below since there's no lvalue:
>
> > =A0 =A0perl =A0-Mstrict -wle "print for @{my $x}"
>
> Quote from the reply Eric Brine wrote [1]
>
> =A0 =A0 Just like the argument list of sub calls, The list over which
> =A0 =A0 foreach iterates is evaluated in lvalue context as required by
> =A0 =A0 foreach's aliasing property.
>
> This also means that since 5.10 (?):
>
> perl -e 'use strict; use warnings; sub foo { my @y=3D@_ }; foo( @{my $x} =
)'
>
> Doesn't result in:
> Can't use an undefined value as an ARRAY reference at -e line 1.
>
> While I see now somewhat the logic behind it on the other hand I am
> afraid that this will result in very subtle bugs. I am not a new to
> Perl, yet I now and then manage to make mistakes like:
>
> exists $x->{ foo }{ bar } or ...
>
> and overlooking that I just created a key foo.
>
> [1]http://rt.perl.org/rt3/Ticket/Display.html?id=3D89024
>

Thanks for the cite... that makes sense now.

--
Charles DeRykus


------------------------------

Date: Sun, 24 Apr 2011 12:33:16 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: for @{ my $x } on Perl 5.10 (bug?)
Message-Id: <slrnir7v3c.psf.hjp-usenet2@hrunkner.hjp.at>

On 2011-04-23 16:37, John Bokma <john@castleamber.com> wrote:
> While I see now somewhat the logic behind it on the other hand I am
> afraid that this will result in very subtle bugs. I am not a new to
> Perl, yet I now and then manage to make mistakes like:
>
> exists $x->{ foo }{ bar } or ...
>
> and overlooking that I just created a key foo.

no autovivification qw(exists);

may help.

	hp



------------------------------

Date: Sun, 24 Apr 2011 13:17:38 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: for @{ my $x } on Perl 5.10 (bug?)
Message-Id: <874o5nms3h.fsf@castleamber.com>

"Peter J. Holzer" <hjp-usenet2@hjp.at> writes:

> On 2011-04-23 16:37, John Bokma <john@castleamber.com> wrote:
>> While I see now somewhat the logic behind it on the other hand I am
>> afraid that this will result in very subtle bugs. I am not a new to
>> Perl, yet I now and then manage to make mistakes like:
>>
>> exists $x->{ foo }{ bar } or ...
>>
>> and overlooking that I just created a key foo.
>
> no autovivification qw(exists);

Thanks Peter, I wasn't aware of that pragma.

-- 
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/


------------------------------

Date: Sun, 24 Apr 2011 03:40:58 -0600
From: Uno <Uno@example.invalid>
Subject: Re: grabbing a facebook group
Message-Id: <91i9hbF6n2U1@mid.individual.net>

On 04/22/2011 05:02 PM, John Bokma wrote:
> Ted Zlatanov<tzz@lifelogs.com>  writes:
>
>> On Fri, 22 Apr 2011 14:45:09 -0500 John Bokma<john@castleamber.com>  wrote:
>>
>> JB>  I am /convinced/ that some people have left this group /because/ of
>> JB>  the virtual dick swinging of some regulars here.
>>
>> I want NAMES, John, NAMES!  We must bring every last one of them back!
>
> Well, I am back, sort of.
>

tja, I wonder what principality Uri seems to inhabit.
-- 
uno


------------------------------

Date: Sat, 23 Apr 2011 16:22:51 -0700 (PDT)
From: Raymundo <gypark@gmail.com>
Subject: Re: I can't understand a sentence "Look out for implicit assignments in while conditionals" in 'perlsub'
Message-Id: <0eb9049f-ec11-4733-bc5e-c5b5d20053d5@s40g2000prg.googlegroups.com>

On 4=BF=F924=C0=CF, =BF=C0=C0=FC1=BD=C303=BA=D0, Tad McClellan <ta...@seesi=
g.invalid> wrote:
> Raymundo <gyp...@gmail.com> wrote:
> > Then, does the last sentence (with the sentence before it) mean:
>
> > 2) If I am assigning to $_ in the loop for some reason, I have to
> > localize $_:
> >    while ( <STDIN> ) { ... local $_ =3D something; ... }
>
> Yep, that is what you have to "look out" for (unless you use
> a lexical variable rather than a package variable).
>

Thank you very much!


------------------------------

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 3364
***************************************


home help back first fref pref prev next nref lref last post