Re: splt and hash problem

2008-06-10 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > I think you're using the tab character for indenting, giving you eight-column > indentation which is too much to show the structure of the blocks properly. > Four-column indenting is recommended. Which assuming you use tabs means you just need to tell the edit

Re: splt and hash problem

2008-06-10 Thread Rob Dixon
Rob Dixon wrote: > > Johnson, Reginald (GTS) wrote: >> >> Thanks for assistance Rob. By adding the parentheses in the split I get >> the expected results. Yes I do need to cleanup the code. The lines that >> are indented are only for debugging, so I am going to delete them >> anyways. I will keep y

Re: splt and hash problem

2008-06-10 Thread Rob Dixon
Johnson, Reginald (GTS) wrote: > > Thanks for assistance Rob. By adding the parentheses in the split I get > the expected results. Yes I do need to cleanup the code. The lines that > are indented are only for debugging, so I am going to delete them > anyways. I will keep your suggestions in mind fo

RE: splt and hash problem

2008-06-10 Thread Johnson, Reginald (GTS)
l.org Cc: Johnson, Reginald (GTS) Subject: Re: splt and hash problem Johnson, Reginald (GTS) wrote: > > I am trying to split and entry from hash and keep getting the following > warning "Use of implicit split to @_ is deprecated at ./chargeback line > 34." > I'm n

Re: splt and hash problem

2008-06-09 Thread Rob Dixon
Johnson, Reginald (GTS) wrote: > > I am trying to split and entry from hash and keep getting the following > warning "Use of implicit split to @_ is deprecated at ./chargeback line > 34." > I'm not sure how to correct this. What I want the code to do is take the > input file and get a hash of the

splt and hash problem

2008-06-09 Thread Johnson, Reginald (GTS)
I am trying to split and entry from hash and keep getting the following warning "Use of implicit split to @_ is deprecated at ./chargeback line 34." I'm not sure how to correct this. What I want the code to do is take the input file and get a hash of the node names. I did this to eliminate duplica

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread Tim Bowden
I need to find a way to get HTML::Parser return the text between the tag caught by the start_h handler and the related closing tag. Could someone please point me in the right direction? Cut down code thus far: #!/usr/bin/perl -wT use strict; use HTML::Parser; my %choices; my $file = 'test_snipp

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread Tim Bowden
Thanks Chas, most useful. Regards, Tim Bowden On Mon, 2008-02-25 at 09:55 -0500, Chas. Owens wrote: > On Mon, Feb 25, 2008 at 9:01 AM, Tim Bowden <[EMAIL PROTECTED]> wrote: > > Making progress. Needed to understand hash references, and how to > > de-reference them. > snip > > Quick cheat sheet:

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread MK
On 02/25/2008 09:01:27 AM, Tim Bowden wrote: -> Making progress. Needed to understand hash references, and how to -> de-reference them. delete($HASH{$KEY}); if that's what you mean; good luck with the stupid stick (i hope it ain't me) -> -> Tim Bowden -> -> On Mon, 2008-02-25 at 14:54 +0900

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread Chas. Owens
On Mon, Feb 25, 2008 at 9:01 AM, Tim Bowden <[EMAIL PROTECTED]> wrote: > Making progress. Needed to understand hash references, and how to > de-reference them. snip Quick cheat sheet: #make a hash reference my $ref = \%hash; my $ref = { key1 => "val1", key2 => "val2" }; my $ref = { %hash }; #

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread Tim Bowden
Making progress. Needed to understand hash references, and how to de-reference them. Tim Bowden On Mon, 2008-02-25 at 14:54 +0900, Tim Bowden wrote: > Hi all, > > I'm using HTML::Parser to process files containing snippets of html > looking like: > First optionAnother > choicepick me > > I'm w

scalar / hash problem in HTML::Parser

2008-02-24 Thread Tim Bowden
Hi all, I'm using HTML::Parser to process files containing snippets of html looking like: First optionAnother choicepick me I'm wanting to create a hash of option value, name pairs. Ie, 1 => "First option",2=>"Another choice" and so on. Problem is, I don't know how to handle the hash returned i

Re: maximum file size for while() loop? -> maybe HASH problem?

2007-01-20 Thread Tom Phoenix
On 1/19/07, Bertrand Baesjou <[EMAIL PROTECTED]> wrote: While running my script it seems to use around a gigabyte of memory (there is 1GB of RAM and 1GB of swap in the system), might this be the problem? If you're running low on memory, unless you're working on an inherintly large problem, you

Re: maximum file size for while() loop? -> maybe HASH problem?

2007-01-19 Thread Paul Johnson
On Fri, Jan 19, 2007 at 03:17:19PM +0100, Bertrand Baesjou wrote: > foreach $line () { See, this isn't a while loop, as you have in the subject. That is the cause of your problems. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: maximum file size for while() loop? -> maybe HASH problem?

2007-01-19 Thread Bertrand Baesjou
Ken Foskey wrote: On Fri, 2007-01-19 at 13:16 +0100, Bertrand Baesjou wrote: Hi, I am trying to read data from a file, I do this by using the "while (){ $line}" construction. However with files with a size of roughly bigger than 430MB it seems to crash the script :S Syntax seems all fi

Re: Hash problem

2006-09-28 Thread Dr.Ruud
"Johnson, Reginald (GTI)" schreef: > I guess it > is a good practice to use data::dumper when you are developing > programs. ITYM: Data::Dumper (casing matters). -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: Hash problem

2006-09-28 Thread D. Bolliger
Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 22:56: > I guess it > is a good practice to use data::dumper when you are developing programs. What you should always use is (as others pointed out) the lines: use strict; use warnings; to improve detection of errors. Data::Dumper is use

RE: Hash problem

2006-09-28 Thread Johnson, Reginald \(GTI\)
-Original Message- From: D. Bolliger [mailto:[EMAIL PROTECTED] Sent: Thursday, September 28, 2006 4:32 PM To: beginners@perl.org Subject: Re: Hash problem Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 21:58: > I am doing an example from Perl Objects, References &

Re: Hash problem

2006-09-28 Thread John W. Krahn
Johnson, Reginald (GTI) wrote: > I am doing an example from Perl Objects, References & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name and I'm not sure > why. Here is my output. > > this is person=>HASH(0x20040014) > thi

Re: Hash problem

2006-09-28 Thread D. Bolliger
Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 21:58: > I am doing an example from Perl Objects, References & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name and I'm not sure > why. Here is my output. > > this

Re: Hash problem

2006-09-28 Thread chen li
--- "Johnson, Reginald (GTI)" <[EMAIL PROTECTED]> wrote: > I am doing an example from Perl Objects, References > & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name > and I'm not sure > why. Here is my output. > > this

Hash problem

2006-09-28 Thread Johnson, Reginald \(GTI\)
I am doing an example from Perl Objects, References & modules. I suspect many of you already use this book as a reference. My hash is showing the address instead of the name and I'm not sure why. Here is my output. this is person=>HASH(0x20040014) this is who=>HASH(0x20040014) HASH(0x20040014) i

RE: Hash problem

2006-02-15 Thread Timothy Johnson
: beginners@perl.org Subject: Hash problem Dear Perl users, I have some problems wih the folowing algorithm: And now the main problem. I want to add File C, which will contain certain names, e.g.: Castro John etc. How to modify my script to sum only those AD's from file A, which not exists in f

Hash problem

2006-02-15 Thread Andrej Kastrin
Dear Perl users, I have some problems wih the folowing algorithm: File A: - ID - 001 AD - Bill AD - Castro AD John ID - 002 AD - Andrew AD - Mike etc. - Then in the second file I have some values for each AD: - Andrew - 10 Bill - 20

Re: Hash problem

2006-01-31 Thread Andrej Kastrin
John W. Krahn wrote: Andrej Kastrin wrote: Dear all, Hello, I have bar separated file: name1|345 name2|201 ... I store it into a hash; while () { chomp; ($name,$score) = split (/\|/,$_); $hash{$name} = $score; } Then I have second file: ID - 001 NA - name1 NA - name2 ID - 0

Re: Hash problem

2006-01-30 Thread John W. Krahn
Andrej Kastrin wrote: > Dear all, Hello, > I have bar separated file: > name1|345 > name2|201 > ... > > I store it into a hash; > while () { > chomp; > ($name,$score) = split (/\|/,$_); > $hash{$name} = $score; > } > > Then I have second file: > ID - 001 > NA - name1 > NA - name2 > > ID

Re: Hash problem

2006-01-30 Thread John Doe
Andrej Kastrin am Montag, 30. Januar 2006 16.50: > John Doe wrote: > >Andrej Kastrin am Montag, 30. Januar 2006 10.14: > >>Dear all, > >> > >>I have bar separated file: > >>name1|345 > >>name2|201 > >>... > >> > >>I store it into a hash; > >>while () { > >> chomp; > >> ($name,$score) = split (/

Re: Hash problem

2006-01-30 Thread Andrej Kastrin
John Doe wrote: Andrej Kastrin am Montag, 30. Januar 2006 10.14: Dear all, I have bar separated file: name1|345 name2|201 ... I store it into a hash; while () { chomp; ($name,$score) = split (/\|/,$_); $hash{$name} = $score; } Let's assume the resulting hash is %scores. T

Re: Hash problem

2006-01-30 Thread John Doe
Andrej Kastrin am Montag, 30. Januar 2006 10.14: > Dear all, > > I have bar separated file: > name1|345 > name2|201 > ... > > I store it into a hash; > while () { >chomp; >($name,$score) = split (/\|/,$_); >$hash{$name} = $score; > } Let's assume the resulting hash is %scores. > Then

Hash problem

2006-01-30 Thread Andrej Kastrin
Dear all, I have bar separated file: name1|345 name2|201 ... I store it into a hash; while () { chomp; ($name,$score) = split (/\|/,$_); $hash{$name} = $score; } Then I have second file: ID - 001 NA - name1 NA - name2 ID - 002 NA - name2 NA - name4 ... I match all ID's and NA's: while

Re: Constant Hash problem

2005-12-20 Thread Andreas Pürzer
John W. Krahn schrieb: Kevin Old wrote: So to achieve an anonymous hash I'd have to do the following, correct? use constant STOPWORDS => { 'a' => 1, 'about' => 1, 'above' => 1, 'across' => 1,

Re: Constant Hash problem

2005-12-19 Thread John W. Krahn
Shawn Corey wrote: > John W. Krahn wrote: >> Shawn Corey wrote: >>> for my $key ( sort keys %{ { STOPWORDS } } ){ >>> my $value = ${ { STOPWORDS } }{$key}; >> >> >> In both lines you are copying the entire list to an anonymous hash. >> If you >> want efficient code (and less punctuation) you shou

Re: Constant Hash problem

2005-12-19 Thread Shawn Corey
John W. Krahn wrote: Shawn Corey wrote: for my $key ( sort keys %{ { STOPWORDS } } ){ my $value = ${ { STOPWORDS } }{$key}; In both lines you are copying the entire list to an anonymous hash. If you want efficient code (and less punctuation) you should just use a hash. Efficiency. There's

Re: Constant Hash problem

2005-12-19 Thread John W. Krahn
Kevin Old wrote: > On 12/16/05, John W. Krahn <[EMAIL PROTECTED]> wrote: >>Kevin Old wrote: >>>On 12/16/05, John W. Krahn <[EMAIL PROTECTED]> wrote: Kevin Old wrote: >I'm trying to define a constant hash and have the following: > >use constant STOPWORDS => map { lc $_ , 1 } qw(

Re: Constant Hash problem

2005-12-19 Thread Kevin Old
On 12/16/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Kevin Old wrote: > > On 12/16/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > >>Kevin Old wrote: > >> > >>>I'm trying to define a constant hash and have the following: > >>> > >>>use constant STOPWORDS => map { lc $_ , 1 } qw(a about above acro

Re: Constant Hash problem

2005-12-17 Thread John W. Krahn
Shawn Corey wrote: > John W. Krahn wrote: >> You can't because perl implements constants using subroutines and >> subroutines >> can only return a list. > > Perl subroutines return only lists but it converts them to hashes > automatically: > > #!/usr/bin/perl > > use strict; > use warnings; > >

Re: Constant Hash problem

2005-12-17 Thread Shawn Corey
John W. Krahn wrote: You can't because perl implements constants using subroutines and subroutines can only return a list. Perl subroutines return only lists but it converts them to hashes automatically: #!/usr/bin/perl use strict; use warnings; use Data::Dumper; sub list_to_hash { retu

Re: Constant Hash problem

2005-12-16 Thread John W. Krahn
Kevin Old wrote: > On 12/16/05, John W. Krahn <[EMAIL PROTECTED]> wrote: >>Kevin Old wrote: >> >>>I'm trying to define a constant hash and have the following: >>> >>>use constant STOPWORDS => map { lc $_ , 1 } qw(a about above across adj >>>after); >>> >>>I do not get a hash from this. >>You are d

Re: Constant Hash problem

2005-12-16 Thread Kevin Old
On 12/16/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Kevin Old wrote: > > Hello everyone, > > Hello, > > > I'm trying to define a constant hash and have the following: > > > > use constant STOPWORDS => map { lc $_ , 1 } qw(a about above across adj > > after); > > > > I do not get a hash from th

Re: Constant Hash problem

2005-12-16 Thread John W. Krahn
Kevin Old wrote: > Hello everyone, Hello, > I'm trying to define a constant hash and have the following: > > use constant STOPWORDS => map { lc $_ , 1 } qw(a about above across adj > after); > > I do not get a hash from this. You are defining STOPWORDS as a list. > This does work, however: >

Re: Constant Hash problem

2005-12-16 Thread Wiggins d'Anconia
Kevin Old wrote: > Hello everyone, > > I'm trying to define a constant hash and have the following: > > use constant STOPWORDS => map { lc $_ , 1 } qw(a about above across adj > after); > > I do not get a hash from this. > > This does work, however: > > my %stopwords = map { lc $_ , 1 } qw(a

Constant Hash problem

2005-12-16 Thread Kevin Old
Hello everyone, I'm trying to define a constant hash and have the following: use constant STOPWORDS => map { lc $_ , 1 } qw(a about above across adj after); I do not get a hash from this. This does work, however: my %stopwords = map { lc $_ , 1 } qw(a about above across adj after); use constan

RE: Hash Problem

2005-09-25 Thread Jeff 'japhy' Pinyan
On Sep 23, Ryan Frantz said: From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] foreach my $process (in $sobj->InstancesOf("Win32_LogicalDisk")) { next if $ignoreDriveTypes{ $process->{DriveType} }; So this would evaluate to true if $process->{DriveType} matches a key in the hash? It wo

Re: Hash Problem

2005-09-23 Thread John W. Krahn
Ryan Frantz wrote: > Perlers, Hello, > I'm working on a small script that checks the free space on local fixed > drives on my system. Since there other drive types (i.e. floppy, > CD-ROM, network maps) I want to exclude those. I decided to use a hash > but the script still displays all of the d

RE: Hash Problem

2005-09-23 Thread Ryan Frantz
> -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] > Sent: Friday, September 23, 2005 3:45 PM > To: Ryan Frantz > Cc: beginners perl > Subject: Re: Hash Problem > > On Sep 23, Ryan Frantz said: > > > I'm working

Re: Hash Problem

2005-09-23 Thread Jeff 'japhy' Pinyan
On Sep 23, Ryan Frantz said: I'm working on a small script that checks the free space on local fixed drives on my system. Since there other drive types (i.e. floppy, CD-ROM, network maps) I want to exclude those. I decided to use a hash but the script still displays all of the drives on my sys

RE: Hash Problem

2005-09-23 Thread Ryan Frantz
> -Original Message- > From: Bakken, Luke [mailto:[EMAIL PROTECTED] > Sent: Friday, September 23, 2005 3:26 PM > To: Ryan Frantz > Subject: RE: Hash Problem > > Ryan Frantz wrote: > > > my %ignoreDriveTypes = ( > > 'floppy' => &

Hash Problem

2005-09-23 Thread Ryan Frantz
Perlers, I'm working on a small script that checks the free space on local fixed drives on my system. Since there other drive types (i.e. floppy, CD-ROM, network maps) I want to exclude those. I decided to use a hash but the script still displays all of the drives on my system. If I just use si

Re: ref / hash problem

2005-08-01 Thread John Doe
Brent Clark am Montag, 1. August 2005 16.42: > Hi list > > I have my data as so (Thanks to Data::Dumper) > > 'Grac01' => { > 'StndRm' => 'Standard Room', > 'Suite' => 'Suite', > 'Pent' => 'Penthouse' >

ref / hash problem

2005-08-01 Thread Brent Clark
Hi list I have my data as so (Thanks to Data::Dumper) 'Grac01' => { 'StndRm' => 'Standard Room', 'Suite' => 'Suite', 'Pent' => 'Penthouse' }, My code is as so. foreach my $roomCode ( keys %{ $ref_hash

Re: looping over a tied hash problem

2005-05-11 Thread Dave Gray
> Dave, I've got some more code here that should explain exactly what I'm > trying to do, what do you think of the structure? As you can probably tell > I'm having problems accessing the keys and values from a tied hash, any > ideas how I can get the keys and the values printed to the screen? > >

Re: looping over a tied hash problem

2005-05-10 Thread Dave Gray
I'm kind of lost as to what you're actually trying to do. Instead of posting functions with nothing calling them, you should include a code snippet (as simple as possible) that can be run to demonstrate the problem. Preferably not using those functions. Fix one thing at a time. With that said, thi

looping over a tied hash problem

2005-05-10 Thread Graeme McLaren
HI all, I have a function which is tying a hash and when I pass it to another function I want to be able to get the values of the hash in the order they were set in, how would I do this? Here's the function with the hash: sub get_users_table_a

Re: Hash problem

2004-12-26 Thread Mike Blezien
Randy W. Sims wrote: Mike Blezien wrote: Hello, I'm working on settup a hash something like this: my $catid = 'A'; my(%conf); $conf{cat} = { A => ( ["15.00","Three months(90days)","90"], ["30.00","Six months(180 days)","180"],

Re: Hash problem

2004-12-26 Thread Randy W. Sims
Mike Blezien wrote: Hello, I'm working on settup a hash something like this: my $catid = 'A'; my(%conf); $conf{cat} = { A => ( ["15.00","Three months(90days)","90"], ["30.00","Six months(180 days)","180"], ["4

Hash problem

2004-12-26 Thread Mike Blezien
Hello, I'm working on settup a hash something like this: my $catid = 'A'; my(%conf); $conf{cat} = { A => ( ["15.00","Three months(90days)","90"], ["30.00","Six months(180 days)","180"], ["45.00","Nine months(2

Re: Splicing Hash problem - possible with "map"?

2004-09-06 Thread Jeff 'japhy' Pinyan
On Sep 6, John W. Krahn said: >> map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; > >Very good Gunnar! But the regexp may not work in all cases. > >my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1(?:\D|$)/, keys %myhash; That regex can also be written as /^1(?!\d)/, which r

Re: Splicing Hash problem - possible with "map"?

2004-09-06 Thread John W. Krahn
Gunnar Hjalmarsson wrote: Edward WIJAYA wrote: Just thought whether it is possible to do it with "map" function? Make it into one-liner? It is. my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; Very good Gunnar! But the regexp may not work in all cases. my %myNEW

Re: Splicing Hash problem - possible with "map"?

2004-09-06 Thread Gunnar Hjalmarsson
Edward WIJAYA wrote: Just thought whether it is possible to do it with "map" function? Make it into one-liner? It is. my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: [

Re: Splicing Hash problem - possible with "map"?

2004-09-06 Thread Edward WIJAYA
Hi, Thanks so much for the replies. If you literally mean "starts with '1'", i.e., you don't know any more about the key, Yes I literally mean "1" not "10", "100", etc. Just thought whether it is possible to do it with "map" function? Make it into one-liner? then first you must find the key, or us

RE: Splicing Hash problem

2004-09-06 Thread Thomas Bätzler
Edward WIJAYA <[EMAIL PROTECTED]> asked: > How can I take out/splice(?) the element of that hash that > start with '1' and store it into another hash. So in the end > I will have two hashes: Off the top of my head, I'd say my @temp = grep /^1/, keys %myhash; my %myNEWhash; foreach my $k (@temp)

Re: Splicing Hash problem

2004-09-06 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Edward WIJAYA) writes: >Hi, > >If I have this hash: > >%myhash = { > '4 atc' => 'TGCGCatcGA', > '5 ctg' => 'AGctgTGTTT', > '3 NO MOTIF' => 'TCCGTGCGCT', > '1 NO MOTIF' => 'ATGGTTAGGG', #need to splice this >

Re: Splicing Hash problem

2004-09-06 Thread Remo Sanges
On Sep 7, 2004, at 3:15 AM, Edward WIJAYA wrote: How can I take out/splice(?) the element of that hash that start with '1' and store it into another hash. So in the end I will have two hashes: %myNEWhash = { '1 NO MOTIF' => 'ATGGTTAGGG'}; and the current becomes: %myhash = { '4 atc' => '

Splicing Hash problem

2004-09-06 Thread Edward WIJAYA
Hi, If I have this hash: %myhash = { '4 atc' => 'TGCGCatcGA', '5 ctg' => 'AGctgTGTTT', '3 NO MOTIF' => 'TCCGTGCGCT', '1 NO MOTIF' => 'ATGGTTAGGG', #need to splice this '2 caa' => 'GAAGcaaGGC' }; How can I take out/splice(?) the element of th

RE: OLE Hash problem getting AD lastLogon

2003-11-22 Thread Tim Johnson
s why it was showing up as a hash. -Original Message- From: R. Joseph Newton [mailto:[EMAIL PROTECTED] Sent: Saturday, November 22, 2003 1:26 PM To: Tim Johnson Cc: Beginners List Subject: Re: OLE Hash problem getting AD lastLogon Tim Johnson wrote: > I'm having trouble getting

Re: OLE Hash problem getting AD lastLogon

2003-11-22 Thread R. Joseph Newton
Tim Johnson wrote: > I'm having trouble getting the lastLogon property of a user in AD using > Perl and LDAP. Below is my code. The problem is that I keep getting a > blessed Win32::OLE hash returned instead of a number when returning the > value of lastLogon. This is the first issue, and it lo

RE: OLE Hash problem getting AD lastLogon (final version)

2003-11-21 Thread Tim Johnson
Okay, this was such a pain in the buttocks that I decided to post the "final" code. (I'll tweak it a bit later, but this is functional) My apologies to someone, I found the pack(),unpack() part on the Internet, and I'm not sure who the original author is. ###

RE: OLE Hash problem getting AD lastLogon

2003-11-21 Thread Tim Johnson
Okay, I made it one step further. I had to convert the variable to a VT_R8 variable. Now I can't seem to find any documentation on how this relates to the date. I guess from here on out it's a Microsoft, not a Perl question, but I'll post the code I have so far, because I know others have run

OLE Hash problem getting AD lastLogon

2003-11-20 Thread Tim Johnson
I'm having trouble getting the lastLogon property of a user in AD using Perl and LDAP. Below is my code. The problem is that I keep getting a blessed Win32::OLE hash returned instead of a number when returning the value of lastLogon. The "hash" has no keys, so I think this might be a mismapping

Re: HASH PROBLEM!!

2003-06-20 Thread david
Eric Walker wrote: > I have a check I am doing with a hash. > > if (exists $deref{$drcrule}) > > > This check fails as if the keyvalue is a part of the hash, but when I > print out the keys like this > foreach my $item (%{$deref}){ > print "$item\n"; > } > > And it is not in the list. I ran

RE: HASH PROBLEM!!

2003-06-20 Thread Gupta, Sharad
-- From: Eric Walker [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2003 2:39 PM To: perlgroup Subject: HASH PROBLEM!! I have a check I am doing with a hash. if (exists $deref{$drcrule}) This check fails as if the keyvalue is a part of the hash, but when I print out the keys like this for

HASH PROBLEM!!

2003-06-20 Thread Eric Walker
I have a check I am doing with a hash. if (exists $deref{$drcrule}) This check fails as if the keyvalue is a part of the hash, but when I print out the keys like this foreach my $item (%{$deref}){ print "$item\n"; } And it is not in the list. I ran this on a previous data that had this in

Re: our %hash problem when require

2002-07-15 Thread Jeff 'japhy' Pinyan
On Jul 15, Connie Chan said: >> >## params.pl in /lib/ ## >> >my $lib{root} = 'C:/myLib/'; my $rt = $lib{root}; >> >my $lib{char_maps} = $rt."chinese/gbb5.map"; >> >my $lib{gb_map} = $rt."chinese/gb.map"; >> > >> >my $lib{temp} = $rt."temp/"; >> >> Warning: you cannot my() a subscript. >>

Re: our %hash problem when require

2002-07-15 Thread Connie Chan
> >## params.pl in /lib/ ## > >my $lib{root} = 'C:/myLib/'; my $rt = $lib{root}; > >my $lib{char_maps} = $rt."chinese/gbb5.map"; > >my $lib{gb_map} = $rt."chinese/gb.map"; > > > >my $lib{temp} = $rt."temp/"; > > Warning: you cannot my() a subscript. > > my $foo[$i]; # is a syntax error

RE: our %hash problem when require

2002-07-15 Thread Bob Showalter
> -Original Message- > From: Connie Chan [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 10:30 AM > To: Bob Showalter; [EMAIL PROTECTED] > Subject: Re: our %hash problem when require > > > > The "our" declaration is for the current file on

Re: our %hash problem when require

2002-07-15 Thread Jeff 'japhy' Pinyan
On Jul 15, Connie Chan said: >>1 >Hehe... I forgot the 1; again , but I do have this in my code. =) > >> my $ref = \%lib1::abc; >How about if I don't package it ? and hopefully just make it looks >like %ENV ? For my case in real , that's something like this : > >## params.pl in /lib/ ## >my $lib{

Re: our %hash problem when require

2002-07-15 Thread Connie Chan
> The "our" declaration is for the current file only, so you need > "our" in Script 1. O seems I am hopeness... > $a is a "special" variable (used in sort blocks), so it gets a > "free pass" from use strict, just like all the other special > variables ($_, $/, etc.). Was you the guy tol

Re: our %hash problem when require

2002-07-15 Thread Jeff 'japhy' Pinyan
On Jul 15, Connie Chan said: >### Lib 1 ### >use strict; >our %abc; >$abc{a} = 1; >$abc{b} = 2; >### EOF Lib 1 ### > >### Lib 2 ### >use strict; >our $a = "ME"; >### EOF Lib 2 ### You've made the mistake of using $a (or $b) as a variable name. These two variables are protected from use strict '

Re: our %hash problem when require

2002-07-15 Thread Connie Chan
>1 Hehe... I forgot the 1; again , but I do have this in my code. =) > my $ref = \%lib1::abc; How about if I don't package it ? and hopefully just make it looks like %ENV ? For my case in real , that's something like this : ## params.pl in /lib/ ## my $lib{root} = 'C:/myLib/'; my $rt = $lib{ro

RE: our %hash problem when require

2002-07-15 Thread Bob Showalter
> -Original Message- > From: Connie Chan [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 9:28 AM > To: [EMAIL PROTECTED] > Subject: our %hash problem when require > > > Some days ago, I've interested in the using of 'our' var, > how

Re: our %hash problem when require

2002-07-15 Thread drieux
On Monday, July 15, 2002, at 06:27 , Connie Chan wrote: > Some days ago, I've interested in the using of 'our' var, > however, I do have some problem on using this with require. part of what is going on here, is essentially the transition model from how things were 'possible' in perl4 - before

our %hash problem when require

2002-07-15 Thread Connie Chan
Some days ago, I've interested in the using of 'our' var, however, I do have some problem on using this with require. ### Lib 1 ### use strict; our %abc; $abc{a} = 1; $abc{b} = 2; ### EOF Lib 1 ### ### Lib 2 ### use strict; our $a = "ME"; ### EOF Lib 2 ### ### Script 1 ### use strict; eval