Problem with Hashes

2007-11-16 Thread Travis Hervey
I have the below code that is reading in a csv file and writing an xml file. The code as is will work fine if I remove the use strict line. ( I would prefer not to do this.) However as it is now with the use strict it gives me a runtime error of: "Can't use string ("") as a HASH ref while "stric

Re: Problem with Hashes

2007-11-16 Thread Paul Lalli
On Nov 16, 10:26 am, [EMAIL PROTECTED] (Travis Hervey) wrote: > I have the below code that is reading in a csv file and writing an xml > file. The code as is will work fine if I remove the use strict line. ( > I would prefer not to do this.) However as it is now with the use > strict it gives me

RE: Problem with Hashes

2007-11-16 Thread Travis Hervey
with Hashes On 11/16/07, Travis Hervey <[EMAIL PROTECTED]> wrote: > I have the below code that is reading in a csv file and writing an xml > file. The code as is will work fine if I remove the use strict line. ( > I would prefer not to do this.) All of us would prefer that you k

Re: Problem with Hashes

2007-11-16 Thread Tom Phoenix
On 11/16/07, Travis Hervey <[EMAIL PROTECTED]> wrote: > I have the below code that is reading in a csv file and writing an xml > file. The code as is will work fine if I remove the use strict line. ( > I would prefer not to do this.) All of us would prefer that you keep 'use strict'! > However

Re: Problem with hashes

2002-10-10 Thread John W. Krahn
Nicole Seitz wrote: > > Hi there! Hello, > I'm very new to Perl and just don't understand an error message I got.Hope you > can help me. > > Now, the file I'm working with contains the following data: > > ;Structural Safety;Elsevier SD;;; > ;Structural Safety (95 ... );ZB-HP;Elsevier;nur onli

Re: Problem with hashes

2002-10-10 Thread Nicole Seitz
On Thursday 10 October 2002 19:32, you wrote: > I think your script is failing at the defined($line = ). So the > hash is not getting populated at all. I think this because your call to > open didn't include a <, as in > > open FH, "< your_file" or die $!; > > Try adding that to your open call a

Re: Problem with hashes

2002-10-10 Thread David Garamond
Nicole Seitz wrote: > 17 elsif ($line =~/^;([^\(]+)\s?[^\)]+\)\s?;(ZB-HP);Elsevier;/ ){ > 18#print "$1\t$2\n\n"; > 19$title = $1; > 20$title =~ s/\s$//; > 21$titles{$title}= $2; > 22} > 23} > 24 while ( ($

RE: Problem with hashes

2002-10-10 Thread nkuipers
I think your script is failing at the defined($line = ). So the hash is not getting populated at all. I think this because your call to open didn't include a <, as in open FH, "< your_file" or die $!; Try adding that to your open call and see if it makes a difference. >= Original Message

Problem with hashes

2002-10-10 Thread Nicole Seitz
Hi there! I'm very new to Perl and just don't understand an error message I got.Hope you can help me. Now, the file I'm working with contains the following data: ;Structural Safety;Elsevier SD;;; ;Structural Safety (95 ... );ZB-HP;Elsevier;nur online (HGF); ;Subsurface sensing technologies and

Re: Problem with Hashes ??

2002-08-21 Thread pn
Hi I am having trouble getting the following script to work. This is a script that I have inherited and am hacking to get it work. In this code, the following check is failing: # Enter Foreach Loop foreach $net (keys %nets) { print "Inside Foreach Loop\n"; print "The value of \$net is : $n

Re: Problem with Hashes

2002-01-22 Thread Jeff Bisbee
Can you include a dump of the Data Structure in quesiton and possibly a bigger snippet of what you're trying to do? Jeff SIDE NOTE... When things get crazy in your data structures its a good idea to take a peak and s

Problem with Hashes

2002-01-21 Thread Kennedy, Todd
Hello, I hope someone can help me. I am attempting to modify a perl script that uses hashes and my problem is that I am trying to add hashes values to the array $o_traffic_rec but I can't seem to reference the value of the new hash. The array is defined as $o_traffic_rec{hosts}{$var1} I am tryi