Thanks for three very helpful answers. I see that my original problem
was to focus on getting the variables correct and not paying attention
to the data I was sending to them. The three answers I received went
far beyond correcting that to point out other improvements and important
programing
Thomas == Thomas H George li...@tomgeorge.info writes:
Thomas I have learned a lot and really appreciate such quick and instructive
Thomas responses.
And if you have overall feedback about the book, I'm always curious so I can
fold it into the next edition.
--
Randal L. Schwartz - Stonehenge
I am inching my way through INTERMEDIATE PERL and tried using hashes to
solve Chapter 4, Problem 2. I never used hashes before but my attempted
solution convinced me of their value as contrasted to the solution with
arrays.
The Problem: My solution works but with an error I can't eliminate.
Hope this helps you...
#!/usr/bin/perl -w
# formatted with perltidy
use warnings;# I always use this
use strict;
my %required_list = (
life_jacket = 'preserver',
lotion = 'sunscreen',
water = 'water_bottle',
coat= 'jacket',
);
my %captain = (
name
Thomas H. George wrote:
I am inching my way through INTERMEDIATE PERL and tried using hashes to
solve Chapter 4, Problem 2. I never used hashes before but my attempted
solution convinced me of their value as contrasted to the solution with
arrays.
The Problem: My solution works but with an
Thomas H. George wrote:
The difficulty is in the next to last line, the 'unless ...'
statement which causes warning:
Use of uninitialized value in string eq at chap4-take6.pl line 49.
Some debugging hints:
1. Set the output autoflush ($|) Perl variable to a true value near the
top of your
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 as
Thanks Tom and the many others that responded. It is much appreciated.
Travis Hervey
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Tom Phoenix
Sent: Friday, November 16, 2007 12:18 PM
To: Travis Hervey
Cc: beginners@perl.org
Subject: Re: Problem
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 a
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 strict
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
I think your script is failing at the defined($line = INPUT). 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
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 ( ($key,
On Thursday 10 October 2002 19:32, you wrote:
I think your script is failing at the defined($line = INPUT). 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
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 online
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 :
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
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
18 matches
Mail list logo