[32101] in Perl-Users-Digest
Perl-Users Digest, Issue: 3365 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 26 00:09:26 2011
Date: Mon, 25 Apr 2011 21: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 Mon, 25 Apr 2011 Volume: 11 Number: 3365
Today's topics:
Re: DBD DB2 <c.joydeep@gmail.com>
Re: DBD DB2 <rvtol+usenet@xs4all.nl>
Re: DBD DB2 <c.joydeep@gmail.com>
File::Slurp .16 is on cpan <uri@StemSystems.com>
Re: File::Slurp .16 is on cpan <klaus03@gmail.com>
HTML::Template->param() : You gave me an odd number of <laredotornado@zipmail.com>
Re: HTML::Template->param() : You gave me an odd number sln@netherlands.com
Re: HTML::Template->param() : You gave me an odd number <john@castleamber.com>
Re: HTML::Template->param() : You gave me an odd number sln@netherlands.com
Re: HTML::Template->param() : You gave me an odd number <john@castleamber.com>
Re: HTML::Template->param() : You gave me an odd number <glex_no-spam@qwest-spam-no.invalid>
Re: HTML::Template->param() : You gave me an odd number <tadmc@seesig.invalid>
Template::Simple .04 is on cpan <uri@StemSystems.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 25 Apr 2011 10:24:32 +0530
From: Jaydip Chakrabarty <c.joydeep@gmail.com>
Subject: Re: DBD DB2
Message-Id: <4db4fe8b$0$312$14726298@news.sunsite.dk>
On 04/24/2011 11:50 PM, John Bokma wrote:
> 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.
>
I added all the repositories that were available in the GUI PPM. But
DBD::DB2 is not there. Do you know any other repositories that I should
add to it?
------------------------------
Date: Mon, 25 Apr 2011 14:43:14 +0200
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: DBD DB2
Message-Id: <4db56c63$0$81479$e4fe514c@news.xs4all.nl>
On 2011-04-23 17:25, Joydeep Chakrabarty wrote:
> I am trying to install DBD for DB2. [...] I
> am using Windows 7 64-bit with Active Perl 5.12.3.
HTH:
http://community.activestate.com/forum/manual-install-perl-dbd-db2-using-ppm-local-drive
--
Ruud
------------------------------
Date: Mon, 25 Apr 2011 20:23:57 +0530
From: Joydeep Chakrabarty <c.joydeep@gmail.com>
Subject: Re: DBD DB2
Message-Id: <4db58b07$0$309$14726298@news.sunsite.dk>
Dr.Ruud pretended :
> On 2011-04-23 17:25, Joydeep Chakrabarty wrote:
>
>> I am trying to install DBD for DB2. [...] I
>> am using Windows 7 64-bit with Active Perl 5.12.3.
>
> HTH:
>
> http://community.activestate.com/forum/manual-install-perl-dbd-db2-using-ppm-local-drive
I have already gone through that link. The repository,
http://ppm4.activestate.com/MSWin32-x86/5.12/1200/package-all.xml is
the default repository and it's already there in PPM. Moreover DBD::DB2
is not there in that repository.
--
Thanks and regards,
Joydeep
------------------------------
Date: Mon, 25 Apr 2011 03:49:54 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: File::Slurp .16 is on cpan
Message-Id: <87liyysrbx.fsf@quad.sysarch.com>
i have released File::Slurp .16 to cpan. the major change is adding the
prepend_file() sub which inserts data at the beginning of a file. that
is a fairly common FAQ and there is no simple fast and clean way to do
it so this covers that problem.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Mon, 25 Apr 2011 05:05:29 -0700 (PDT)
From: Klaus <klaus03@gmail.com>
Subject: Re: File::Slurp .16 is on cpan
Message-Id: <824299b0-565d-497d-ba55-74381acfd179@u38g2000prd.googlegroups.com>
On 25 avr, 09:49, "Uri Guttman" <u...@StemSystems.com> wrote:
> i have released File::Slurp .16 to cpan. the major change is adding the
> prepend_file() sub which inserts data at the beginning of a file. that
> is a fairly common FAQ and there is no simple fast and clean way to do
> it so this covers that problem.
Thanks for releasing a new version of File::Slurp. I have installed it
on my Windows ActiveState Perl x64
C:\PerlModules\File-Slurp\File-Slurp-9999.16>perl -v
This is perl 5, version 12, subversion 0 (v5.12.0) built for MSWin32-
x64-multi-thread
(with 1 registered patch, see perl -V for more detail)
All tests passed (some skipped on my Windows machine). I will use
File::Slurp ver 9999.16 in my applications.
C:\PerlModules\File-Slurp\File-Slurp-9999.16>nmake test
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
C:\Perl64\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/append_null.t ....... ok
t/binmode.t ........... ok
t/data_list.t ......... ok
t/data_scalar.t ....... ok
t/error.t ............. ok
t/error_mode.t ........ ok
t/file_object.t ....... ok
t/handle.t ............ ok
t/inode.t ............. skipped: skip inode test on windows
t/large.t ............. ok
t/newline.t ........... ok
t/no_clobber.t ........ ok
t/original.t .......... ok
t/paragraph.t ......... ok
t/perms.t ............. skipped: meaningless on Win32
t/pod.t ............... skipped: Test::Pod 1.14 required for testing
PODe
t/pod_coverage.t ...... skipped: Test::Pod::Coverage 1.04 required for
testing POD coverage
t/pseudo.t ............ ok
t/read_dir.t .......... ok
t/slurp.t ............. ok
t/stdin.t ............. ok
t/stringify.t ......... ok
t/tainted.t ........... ok
t/write_file_win32.t .. ok
All tests successful.
Files=24, Tests=277, 4 wallclock secs ( 0.14 usr + 0.08 sys = 0.22
CPU)
Result: PASS
------------------------------
Date: Mon, 25 Apr 2011 13:46:24 -0700 (PDT)
From: Dave <laredotornado@zipmail.com>
Subject: HTML::Template->param() : You gave me an odd number of parameters to param()!
Message-Id: <83df2b0d-fab3-4778-9fe2-0df8f2f6c20a@w24g2000yqb.googlegroups.com>
Hi,
I'm using Perl 5.10.1. I'm trying to fill in an HTML::Template, which
consists of
<TMPL_LOOP NAME=TESTS>
<tr><td><a href="<TMPL_VAR NAME=ABSOLUTE_PATH>"><TMPL_VAR
NAME=FILE_SHORT_NAME></a></td></tr>
</TMPL_LOOP>
but I'm getting an error when I try and do the following ...
my @loop_arr;
foreach (@test_files) {
my $test_file = $_;
my %params_hash;
$params_hash{'absolute_path'} = $test_file;
$params_hash{'file_short_name'} = $test_file;
push(@loop_arr, %params_hash);
}
# open the html template
my $template = HTML::Template->new(filename => '/opt/scripts/selenium/
report_suite.templ');
$template->param(TESTS => @loop_arr);
The error is complaining about the last line. I tried changing
"@loop_arr" to "$loop_arr" but that gave some undefined variable
errors. Could someone point out the error(s) of my ways?
Thanks, - Dave
------------------------------
Date: Mon, 25 Apr 2011 14:24:23 -0700
From: sln@netherlands.com
Subject: Re: HTML::Template->param() : You gave me an odd number of parameters to param()!
Message-Id: <ngpbr695fei05peitbb2548ds8nak59dnb@4ax.com>
On Mon, 25 Apr 2011 13:46:24 -0700 (PDT), Dave <laredotornado@zipmail.com> wrote:
>Hi,
>
>I'm using Perl 5.10.1. I'm trying to fill in an HTML::Template, which
>consists of
>
><TMPL_LOOP NAME=TESTS>
> <tr><td><a href="<TMPL_VAR NAME=ABSOLUTE_PATH>"><TMPL_VAR
>NAME=FILE_SHORT_NAME></a></td></tr>
></TMPL_LOOP>
>
>
>but I'm getting an error when I try and do the following ...
>
>my @loop_arr;
>foreach (@test_files) {
> my $test_file = $_;
> my %params_hash;
> $params_hash{'absolute_path'} = $test_file;
> $params_hash{'file_short_name'} = $test_file;
> push(@loop_arr, %params_hash);
>}
># open the html template
>my $template = HTML::Template->new(filename => '/opt/scripts/selenium/
>report_suite.templ');
>$template->param(TESTS => @loop_arr);
>
maybe => [@loop_arr]
since => imply's a hash element, which can't be an array,
but can be a reference to an array.
-sln
------------------------------
Date: Mon, 25 Apr 2011 18:37:38 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: HTML::Template->param() : You gave me an odd number of parameters to param()!
Message-Id: <874o5llx6l.fsf@castleamber.com>
sln@netherlands.com writes:
> On Mon, 25 Apr 2011 13:46:24 -0700 (PDT), Dave <laredotornado@zipmail.com> wrote:
>>$template->param(TESTS => @loop_arr);
>>
> maybe => [@loop_arr]
>
> since => imply's a hash element, which can't be an array,
> but can be a reference to an array.
In which case you might want to use => \@loop_arr instead. Correct me if
I am wrong but you're now copying @loop_arr into an empty hash you
created a reference too. Sometimes that's what you want (for example if
you want to keep a copy), but in this case most likely not.
--
John Bokma j3b
Blog: http://johnbokma.com/ Facebook: http://www.facebook.com/j.j.j.bokma
Freelance Perl & Python Development: http://castleamber.com/
------------------------------
Date: Mon, 25 Apr 2011 18:01:42 -0700
From: sln@netherlands.com
Subject: Re: HTML::Template->param() : You gave me an odd number of parameters to param()!
Message-Id: <lr5cr6dfot3gjf8c0f164d1f2k5nhm5rnl@4ax.com>
On Mon, 25 Apr 2011 18:37:38 -0500, John Bokma <john@castleamber.com> wrote:
>sln@netherlands.com writes:
>
>> On Mon, 25 Apr 2011 13:46:24 -0700 (PDT), Dave <laredotornado@zipmail.com> wrote:
>
>>>$template->param(TESTS => @loop_arr);
>>>
>> maybe => [@loop_arr]
>>
>> since => imply's a hash element, which can't be an array,
>> but can be a reference to an array.
>
>In which case you might want to use => \@loop_arr instead. Correct me if
>I am wrong but you're now copying @loop_arr into an empty hash you
>created a reference too. Sometimes that's what you want (for example if
>you want to keep a copy), but in this case most likely not.
It was hard to tell what he wanted to do. Looked like he wanted to copy
the array to this place, therefore the new array. Otherwise, it appears
if he doesen't know what [] is, he isin't going to know what \@ar is.
I stopped guessing what's in the minds of people.
-sln
------------------------------
Date: Mon, 25 Apr 2011 21:44:15 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: HTML::Template->param() : You gave me an odd number of parameters to param()!
Message-Id: <87zkndk9z4.fsf@castleamber.com>
Tad McClellan <tadmc@seesig.invalid> writes:
> John Bokma <john@castleamber.com> wrote:
>> sln@netherlands.com writes:
>>
>>> On Mon, 25 Apr 2011 13:46:24 -0700 (PDT), Dave <laredotornado@zipmail.com> wrote:
>>
>>>>$template->param(TESTS => @loop_arr);
>>>>
>>> maybe => [@loop_arr]
>>>
>>> since => imply's a hash element, which can't be an array,
>>> but can be a reference to an array.
>>
>> In which case you might want to use => \@loop_arr instead. Correct me if
>> I am wrong but you're now copying @loop_arr into an empty hash you
> ^^^^
> ^^^^
> s/hash/array/;
Thanks Tad, indeed that should have read array :-)
--
John Bokma j3b
Blog: http://johnbokma.com/ Facebook: http://www.facebook.com/j.j.j.bokma
Freelance Perl & Python Development: http://castleamber.com/
------------------------------
Date: Mon, 25 Apr 2011 16:21:33 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: HTML::Template->param() : You gave me an odd number of parameters to param()!
Message-Id: <4db5e5de$0$4352$815e3792@news.qwest.net>
Dave wrote:
> Hi,
>
> I'm using Perl 5.10.1. I'm trying to fill in an HTML::Template, which
> consists of
>
> <TMPL_LOOP NAME=TESTS>
> <tr><td><a href="<TMPL_VAR NAME=ABSOLUTE_PATH>"><TMPL_VAR
> NAME=FILE_SHORT_NAME></a></td></tr>
> </TMPL_LOOP>
>
>
> but I'm getting an error when I try and do the following ...
>
> my @loop_arr;
> foreach (@test_files) {
> my $test_file = $_;
> my %params_hash;
> $params_hash{'absolute_path'} = $test_file;
> $params_hash{'file_short_name'} = $test_file;
> push(@loop_arr, %params_hash);
push( @loop_arr, \%params_hash );
> }
> # open the html template
> my $template = HTML::Template->new(filename => '/opt/scripts/selenium/
> report_suite.templ');
> $template->param(TESTS => @loop_arr);
$template->process(TESTS => \@loop_arr);
>
> The error is complaining about the last line. I tried changing
> "@loop_arr" to "$loop_arr" but that gave some undefined variable
> errors. Could someone point out the error(s) of my ways?
Give the documentation a try.
------------------------------
Date: Mon, 25 Apr 2011 20:16:41 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: HTML::Template->param() : You gave me an odd number of parameters to param()!
Message-Id: <slrnirc6v0.h8q.tadmc@tadbox.sbcglobal.net>
John Bokma <john@castleamber.com> wrote:
> sln@netherlands.com writes:
>
>> On Mon, 25 Apr 2011 13:46:24 -0700 (PDT), Dave <laredotornado@zipmail.com> wrote:
>
>>>$template->param(TESTS => @loop_arr);
>>>
>> maybe => [@loop_arr]
>>
>> since => imply's a hash element, which can't be an array,
>> but can be a reference to an array.
>
> In which case you might want to use => \@loop_arr instead. Correct me if
> I am wrong but you're now copying @loop_arr into an empty hash you
^^^^
^^^^
s/hash/array/;
> created a reference too. Sometimes that's what you want (for example if
> you want to keep a copy), but in this case most likely not.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Mon, 25 Apr 2011 03:51:03 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Template::Simple .04 is on cpan
Message-Id: <87hb9msra0.fsf@quad.sysarch.com>
i have released Template::Simple .04 to cpan. this was meant to be .03
but in my haste i released that without doing a full test run. some
changes i made (which passed their own tests!) caused others to fail. my
bad. so i just fixed all the tests and made some minor fixes in the code
for that too.
but the major change is exciting. T::S now has compiled templates. you
can load a template by name and then compile it. the render call is
exactly the same (you must pass the template name for a compiled
template). it will render it blazingly fast. there is a benchmark in the
extras/ dir that compare T::S regular and compiled templates to
Template::Teeny (compiled only) and template toolkit (whatever comes
plain from cpan). T::S compiled templates are about 34 times faster that
TT's in this test. i am sure some of you will bitch and moan about this
so just edit that script and send me code on improving the benchmark.
the docs cover all about compiling templates and the few caveats and
restrictions. you can even dump the generated perl source of a compiled
template for your amusement and hand coded optimizations!
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
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 3365
***************************************