Re: how to create a hash on the fly

2010-04-15 Thread raphael()
On Thu, Apr 15, 2010 at 10:55 AM, Uri Guttman u...@stemsystems.com wrote: r == raphael() raphael.j...@gmail.com writes: r # abc -- this_should_be_hash_name r {space} random_name_or_number date other_things_1 other_things_2 r {space} random_name_or_number date other_things_1

Re: how to create a hash on the fly

2010-04-15 Thread Uri Guttman
r == raphael() raphael.j...@gmail.com writes: r On Thu, Apr 15, 2010 at 10:55 AM, Uri Guttman u...@stemsystems.com wrote: please learn to edit quoted emails. you added 4 lines and left my entire post. r You are right! but of course! :) r But as a beginning Perl programmer I find

Re: Incrementing letters in for loop

2010-04-15 Thread C.DeRykus
On Apr 14, 5:22 am, shawnhco...@gmail.com (Shawn H Corey) wrote: C.DeRykus wrote: And, here's the doozy for me as I tried remembering:       If the final value specified is not in the sequence that the       magical increment would produce, the sequence continues       until the next

Re: Problem in installing ActivePerl 5.10 on Windows 7 with x64 chipset

2010-04-15 Thread Sisyphus
- Original Message - From: Bob McConnell r...@cbord.com Has ActiveState produced a 64 bit package yet? Yes, x64 packages have been available for a couple of years (give or take). That is, ActiveState currently provide an msi package for both x86 (32-bit build of perl) and x64

Re: Problem in installing ActivePerl 5.10 on Windows 7 with x64 chipset

2010-04-15 Thread Rene Schickbauer
Sisyphus wrote: All four of those packages should install and run fine on 64-bit windows. I can vouch for that re the x86 and x64 zip packages on Vista 64, but I've not personally tried the msi packages (as I'm always worried they'll do something I don't want them to do ... possibly that's

AW: Problem in installing ActivePerl 5.10 on Windows 7 with x64 chipset

2010-04-15 Thread Thomas Bätzler
Hi, Rene Schickbauer rene.schickba...@gmail.com wrote: For me, the msi packages worked quite well for the last few years. Altough i'm currently using the x86 versions due to some trouble with a few packages - mostly the ones that link to an external closed-source library, but i also had

Re: Nested if and elsif and else

2010-04-15 Thread Harry Putnam
Uri Guttman u...@stemsystems.com writes: i disagree that it is elegant. too often if/else lists are not needed. many can be replaced by dispatch tables. if one of the clauses does just a return or next/last that can be replaced with a modifier or shorter statement. without ANY serious work, i

Not understanding deleted symbol key access

2010-04-15 Thread Linux Expert
I'm following an example in Mastering Perl pg 130. He demonstrates setting package variables $m and $n and displays their contents as well as their keys held in the symbol table. He then proceeds to delete the symbol table keys for said variables, yet they still somehow hold their value. What I

Re: Nested if and elsif and else

2010-04-15 Thread rkb
Harry Putnam wrote: Uri Guttman u...@stemsystems.com writes: i disagree that it is elegant. too often if/else lists are not needed. many can be replaced by dispatch tables. if one of the clauses does just a return or next/last that can be replaced with a modifier or shorter statement.

Re: Nested if and elsif and else

2010-04-15 Thread Harry Putnam
r...@i.frys.com writes: Here's an example I gave in a similar question in another forum. Thanks... I'm sorry to ask more but if someone asked to be shown an if/elsif/else construct being replaced by a dispatch table, I don't really see how that answered there question. It didn't for me.

Re: Nested if and elsif and else

2010-04-15 Thread Jim Gibson
On 4/15/10 Thu Apr 15, 2010 9:21 AM, Harry Putnam rea...@newsguy.com scribbled: r...@i.frys.com writes: Here's an example I gave in a similar question in another forum. Thanks... I'm sorry to ask more but if someone asked to be shown an if/elsif/else construct being replaced by a

Re: Nested if and elsif and else

2010-04-15 Thread Ron Bergin
On Apr 15, 9:21 am, rea...@newsguy.com (Harry Putnam) wrote: r...@i.frys.com writes: Here's an example I gave in a similar question in another forum. Thanks... I'm sorry to ask more but if someone asked to be shown an if/elsif/else construct being replaced by a dispatch table, I don't

XML Parser Error

2010-04-15 Thread Open Source
I'm getting this error: Undefined subroutine XML::Simple::XMLin called at ./sample.pl line 3. Here's my code and input file: use XML::Simple; use Data::Dumper; $data = XMLin(sample.xml); print Dumper($data); ?xml version='1.0'? employee nameJohn/name age43/age genderM/gender

Date_GetPrev error

2010-04-15 Thread Tony Esposito
Hello, Date_GetPrev only getting 3 previous days, not 5 previous days.  Using Perl 5.8.x. Code use strict; use Date::Manip; my @days = ( 'Fri', 'Mon', 'Tue', 'Wed', 'Thu' ); Date_Init(TZ=CST6CDT); foreach (@days) {   print $_ . \n; } my @dates = (); my $today = ParseDate('today'); foreach

Re: Date_GetPrev error

2010-04-15 Thread Uri Guttman
TE == Tony Esposito tony1234567...@yahoo.co.uk writes: TE foreach (@dates) { TE   pop(@dates); why are you popping @dates there? you are looping over it from left to right but also losing elements from the right. TE   print $_ . \n; TE } -- Uri Guttman --

Re: Nested if and elsif and else

2010-04-15 Thread Harry Putnam
Ron Bergin r...@i.frys.com writes: Sorry for not posting the if/elsif/else block, but to me that part appeared to be obvious, but I guess it wasn't. Probably would have been for all but the densist I guess. Not the first time I've been guilty of that. I see that Jim has posted the

Re: Date_GetPrev error

2010-04-15 Thread Tony Esposito
Thx.  I see that I do not need to do both!  Got it fixed. From: Uri Guttman u...@stemsystems.com To: Tony Esposito tony1234567...@yahoo.co.uk Cc: Beginners Perl beginners@perl.org Sent: Thu, 15 April, 2010 13:04:09 Subject: Re: Date_GetPrev error TE == Tony

ExtUtils::MakeMaker, execute Perl code during make test

2010-04-15 Thread Steve Bertrand
Hi all, In one of my projects, I've written a test file t/22-upgrade.t. I have a test within this file that looks for an existing installation, checks the versions, and compares the configuration files An upgrade does not overwrite the existing config, instead printing out a warning with a list

Re: ExtUtils::MakeMaker, execute Perl code during make test

2010-04-15 Thread Steve Bertrand
On 2010.04.15 18:50, Steve Bertrand wrote: Hi all, In one of my projects, I've written a test file t/22-upgrade.t. [..snip..] However, when I run make test, the Perl code for print does not execute. Replying my own post, this project is currently only used by us internally. What I've done

Re: how to create a hash on the fly

2010-04-15 Thread Steve Bertrand
On 2010.04.15 03:37, raphael() wrote: On Thu, Apr 15, 2010 at 10:55 AM, Uri Guttman u...@stemsystems.com wrote: r == raphael() raphael.j...@gmail.com writes: r # abc -- this_should_be_hash_name the proper solution is to use a hash to hold these hashes. this is cleaner, safer,

Re: how to create a hash on the fly

2010-04-15 Thread raphael()
On Fri, Apr 16, 2010 at 7:47 AM, Steve Bertrand st...@ibctech.ca wrote: On 2010.04.15 03:37, raphael() wrote: On Thu, Apr 15, 2010 at 10:55 AM, Uri Guttman u...@stemsystems.com wrote: r == raphael() raphael.j...@gmail.com writes: r # abc -- this_should_be_hash_name the

Re: how to create a hash on the fly

2010-04-15 Thread Steve Bertrand
On 2010.04.15 22:52, raphael() wrote: It always comes down to desire and will to do something. yep. It also comes down to whether you (or your job function) meet the need or want. Personally, I find that learning comes from want, not need though. I agree that had I mastered references most of