On Fri, 16 Nov 2001, Tomasi, Chuck wrote:
> Good point. I should be a little more imaginative. Sometimes making up
> meaningful variable and function names is the hardest part of writing code.
It is indeed!
> Another thing I found about the references, the order of the parameters
>
ues etc.
I guess the first thing is "What are you after? Then put together a hash
and/or array to get what you need."
Wags ;)
-Original Message-
From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 08:54
To: Wagner-David; '[EMAIL PROTECTED
(@$aref) loop walks right over the hash ref and I get information at
the end of @leftovers "main::hash".
--Chuck
> -Original Message-
> From: Dave Storrs [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 11:38 AM
> To: '[EMAIL PROTECTED]'
> S
This may or may not solve your problem, but
Name your sub something other than 'ref'. Ref is a reserved word in Perl.
(perldoc -f ref for details on what it does)
Dave
> > > --arg.pl---
> > > #/usr/plx/bin/perl -w
> > >
> > > use strict;
> > >
> > > sub ref
> > > {
>
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 11:29 AM
> To: 'Tomasi, Chuck'; '[EMAIL PROTECTED]'
> Subject: RE: Populating a referenced hash
>
>
> > -Original Message-
> > From: Tomasi, Chuck [mailto
> -Original Message-
> From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 12:16 PM
> To: 'Bob Showalter'; '[EMAIL PROTECTED]'
> Subject: RE: Populating a referenced hash
>
>
> > Your sub looks ok, but of cou
> Your sub looks ok, but of course we can't tell if any of
> the regexes are actually matching.
The regexes are matching. I put a quick forech() loop to print out the keys
and their values. Everything looks OK at the end of the sub.
> Instead of ${$href}{'UserID'}, which is valid syntax, the
>
> -Original Message-
> From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 11:54 AM
> To: 'Wagner-David'; '[EMAIL PROTECTED]'
> Subject: RE: Populating a referenced hash
>
>
> My mistake on $hash{'$User
d [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 10:29 AM
> To: 'Tomasi, Chuck'; '[EMAIL PROTECTED]'
> Subject: RE: Populating a referenced hash
>
>
> Your print using:
> print "User ID = $hash{'$UserID'}\n";
>
Wags ;)
-Original Message-
From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 07:29
To: '[EMAIL PROTECTED]'
Subject: Populating a referenced hash
Perl: 5.6.0
OS: Solaris 7
Goal: Scan a text file for key words/values and populate a hash
My parsing works, but t
Perl: 5.6.0
OS: Solaris 7
Goal: Scan a text file for key words/values and populate a hash
My parsing works, but the main() never sees the values properly. If I'm
passing by reference, why isn't the hash I passed getting populated in the
main namespace?
Thanks
--Chuck
--arg.pl-
11 matches
Mail list logo