Reference and assignment question

2008-01-29 Thread Roman Daszczyszak
I was exploring why something didn't work the way I expected using DBM::Deep (0.983 from ActiveState) and came upon some behavior I don't understand. I think it has something to do with using bless or tie, but I have not used either yet. Here is my code. My questions are in the comments for the

Re: Odd DBM::Deep behavior "cannot store tied value" using literal key name

2008-01-08 Thread Roman Daszczyszak
Chas. Owens wrote: > Is there a reason you have chosen DBM::Deep? It seems to have > problems. The latest version fails its tests (and not just on Win32) > and the version you are using seems to have other problems. I would > probably use a normal DBM and use YAML (Pure Perl) or YAML::Syck > (f

Re: Odd DBM::Deep behavior "cannot store tied value" using literal key name

2008-01-08 Thread Roman Daszczyszak
On Jan 8, 2008 12:33 PM, Roman Daszczyszak <[EMAIL PROTECTED]> wrote: > However, I believe I "discovered" the source of my original 'tied' > error: I was working on a mapped network drive, not a local drive. I > don't know for sure, but since moving to

Need help understanding DBM::Deep and Data::Compare behavior

2008-01-08 Thread Roman Daszczyszak
Hi all, I am trying to write a script that will regularly pull information from a Windows XP system, store it in a database (DBM::Deep), and if requeried, report the changes and update the database. However, the test code I have below has two behaviors that I do not understand: 1) If I assign an

Re: Odd DBM::Deep behavior "cannot store tied value" using literal key name

2008-01-08 Thread Roman Daszczyszak
he original problem (something using Data::Compare with DBM::Deep). :) Thanks for the help! On Jan 7, 2008 3:02 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > > On Jan 7, 2008 6:22 AM, Roman Daszczyszak <[EMAIL PROTECTED]> wrote: > > On Jan 4, 2008 5:45 PM, Chas. Owens <[EM

Re: Odd DBM::Deep behavior "cannot store tied value" using literal key name

2008-01-07 Thread Roman Daszczyszak
On Jan 4, 2008 5:45 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > When I downgrade to 0.983 I immediately get "DBM::Deep: File type > mismatch" even with your original code. I would suggest upgrading > DBM::Deep to version 1.0006. > Unfortunately, the Activestate Windows build for 5.8 DBM::Deep 1.

Re: Odd DBM::Deep behavior "cannot store tied value" using literal key name

2008-01-04 Thread Roman Daszczyszak
4, 2008 5:03 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Jan 4, 2008 9:13 AM, Roman Daszczyszak <[EMAIL PROTECTED]> wrote: > snip > > The above code works as-is, but if I uncomment the line(s) above > > (marked with a comment), I get the error: DBM::Deep: Canno

Odd DBM::Deep behavior "cannot store tied value" using literal key name

2008-01-04 Thread Roman Daszczyszak
Hi all, I am trying to create a test script for some work I'm trying to do with Data::Compare using DBM::Deep, but the test code is acting flaky and I'm not sure why. In a previous (and working) script, I have a DBM::Deep hash keyed using IP addresses. Inside the hash is an array that contains s

Re: Data::Compare module help

2007-12-12 Thread Roman Daszczyszak
Oops.. I made one mistake in my explanation. The structure in question is a hash of usernames each containing another hash of the user attributes. I'm trying to use the code to ignore an attribute in the second-level hash. Will that work? On Dec 12, 2007 3:49 PM, Roman Daszczyszak &l

Data::Compare module help

2007-12-12 Thread Roman Daszczyszak
Hi all, I am trying to utilize Data::Compare to compare two data structures containing user names and account attributes from Windows XP systems. Using Win32API::Net, it returns an array of usernames, which can be looped through to pull a hash of each users' attributes. However, comparing these h

Re: Looking for a Perl module for proper IP sorting

2006-11-13 Thread Roman Daszczyszak
Please sort the IP addresses with this way could help you, @list = sort { $b <=> $a } @ip_addresses; Wouldn't this do the same kind of sort I've been doing (aka a textual one)? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Looking for a Perl module for proper IP sorting

2006-11-13 Thread Roman Daszczyszak
my @sorted = sort { my @a = $a =~ /(\d+)/g; my @b = $b =~ /(\d+)/g; shift @a <=> shift @b or shift @a <=> shift @b or shift @a <=> shift @b or shift @a <=> shift @b } @ips; Rob Thanks, that did it! Now I have to figure out why that works... hmm.. Roman -- To unsubscribe, e-

Looking for a Perl module for proper IP sorting

2006-11-13 Thread Roman Daszczyszak
I have a bit of code that collects and stores all the IP addresses used on my network. However, when I sort the list via 'sort' the IP addresses are listed as if they were text, so the output looks like this: 192.168.0.1 192.168.0.100 192.168.0.101 192.168.0.114 192.168.0.115 192.168.0.116 192.16

RE: Trouble with variable scoping

2006-09-01 Thread Roman Daszczyszak
From: "Charles K. Clarkson" <[EMAIL PROTECTED]> To: Date: Thu, 31 Aug 2006 10:41:33 -0500 Subject: RE: Trouble with variable scoping Roman Daszczyszak wrote: : In my perl script, I have a "global" variable called : @excludedIPAddresses, declared at the top of the sc

Trouble with variable scoping

2006-08-31 Thread Roman Daszczyszak
In my perl script, I have a "global" variable called @excludedIPAddresses, declared at the top of the script using my: use strict; use warnings; use Net::Ping; use Net::Netmask; use Net::NBName; use DBM::Deep; # User-configured variable declarations my @su

Multiple matching question

2006-08-10 Thread Roman Daszczyszak
Hello all, I have several text files with a few thousand contacts in each, and I am trying to pull out all the contacts from certain email domains (about 15 of them). I wrote a script that loops through each file, then loops through matching each domain to the line and writes the results to two

Other ways to assign a filehandle to a variable?

2006-07-27 Thread Roman Daszczyszak
After reading Randal's March 2000 LM column and learning that you can assign a filehandle to a scalar by doing something like: open(FILE, $filename) or die "whatever"; $value = *FILE{IO}; I am wondering if there are other, perhaps better, ways of doing this? FYI, I googled for "assigning fileha

Need help with error from certain ASCII characters in a CSV file

2006-07-06 Thread Roman Daszczyszak
Hello all, I am using a script to parse a CSV file with approximately 65,000 records. Some of these records contain characters such as é, ì, etc. I can read and write lines containing these characters via a file handle, however when I try and parse the line using the module Class::CSV, it fails