In article [EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:
It did complain or else I would have sent a thank you for making it work
already ;)
[long, upside clipped]
Please at least clip the old text if you are going to top-post. We're mostly
top-to-bottom readers here (makes following code and
On Tuesday, September 30, 2003, at 08:44 PM, [EMAIL PROTECTED] wrote:
OK version x.3
Please just change these lines to make it work. The calling program
test.pl fails on the assignment line:
Will do, but I'm not 100% sure you're listening to the suggestions we
give.
Bareword fname not allowed
On Tuesday, September 30, 2003, at 09:04 PM, [EMAIL PROTECTED] wrote:
Thank for you help. Now asome enlighten questions.
- Are the fname and lname implicitly declared?
These are now really variables, they're just keys to the hash we made
into an object.
- I guess you can't have vars outside of
Ok - I got it finally.
I've used the use strict; in my progs. You're right. it helps to identify
loosely hanging vars that'll get ya.
Thanks, I'm getting a hang of it slowly, frustratingly but surely. I'm
just touching onto this perl class object thing but it seems pretty
interesting. I'm trying
[EMAIL PROTECTED] wrote:
Can someone make this work like I want? I'm trying to create a package
USER and reference/change it. The only thing I'm able to do is to call the
sub prtAll. I just want a structure that I can pass around in perl.
test.pl
---
use USER;
#this does NOT work
#this does NOT work
#how do i reference these vars
USER::fname=bob;
USER::lname=Bingham;
You need the $, like this...
$USER::fname=bob;
$USER::lname=Bingham;
But this may be what you really want. It will allow you to create multiple
USER objects, each with different values stored in them.
On Tuesday, September 30, 2003, at 06:01 PM, [EMAIL PROTECTED] wrote:
Can someone make this work like I want? I'm trying to create a package
USER and reference/change it. The only thing I'm able to do is to call
the
sub prtAll. I just want a structure that I can pass around in perl.
test.pl
James and Bob,
OK version x.2
- I want to create a user object with value initialized.
- Initialize/Change it anytime
test.pl
---
use UserInfo;
my $ui = new UserInfo();
$ui-(fname) = bob;
$ui-(lname) = Bingham;
#change name
$ui-(fname) = robert;
print ui: [ . $ui-full_name() . ]\n;
exit
James and Rob,
OK version x.2
- I want to create a user object with value initialized.
- Initialize/Change it anytime
test.pl
---
use UserInfo;
my $ui = new UserInfo();
$ui-(fname) = bob;
$ui-(lname) = Bingham;
#change name
$ui-(fname) = robert;
print ui: [ . $ui-full_name() . ]\n;
exit
On Tuesday, September 30, 2003, at 06:51 PM, [EMAIL PROTECTED] wrote:
James and Bob,
OK version x.2
- I want to create a user object with value initialized.
I showed you how to do this in my last message. Go back and take a
look.
- Initialize/Change it anytime
It's best to do this with
subclasses :) ...but I would hold off on that until everything
else sinks in.
Rob
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 7:53 PM
To: James Edward Gray II
Cc: [EMAIL PROTECTED]
Subject: Re: Look At This Package
James and Rob,
OK
To: James Edward Gray II
Cc: [EMAIL PROTECTED]
Subject: Re: Look At This Package
James and Rob,
OK version x.2
- I want to create a user object with value initialized.
- Initialize/Change it anytime
test.pl
---
use UserInfo;
my $ui = new UserInfo();
$ui-(fname) = bob;
$ui-(lname
OK version x.3
Please just change these lines to make it work. The calling program
test.pl fails on the assignment line:
Bareword fname not allowed while strict subs in use at utest line 8.
Bareword lname not allowed while strict subs in use at utest line 9.
Bareword fname not allowed while
Can't believe you guys didn't catch it. I had parenthesis instead of
braces ;)
$ui-(fname) = bob; #incorrect ()
$ui-{fname} = bob; #correct {}
Thank for you help. Now asome enlighten questions.
- Are the fname and lname implicitly declared?
- I guess you can't have vars outside of the methods
14 matches
Mail list logo