Rob Richardson <mailto:[EMAIL PROTECTED]> wrote:

: I have a routine named trace() that writes a string to a
: text file. The following two lines: 
: 
:       $user = $userList->GetUser($logname);
:       trace("User: $user->LoginName(), $user->FirstName(),
$user->LastName()\n"); 
: 
: give me the following result:
: 
: User: User=HASH(0x174c234)->LoginName(),
: User=HASH(0x174c234)->FirstName(), User=HASH(0x174c234)->LastName()
: 
: I am losing track of what is a reference to what, and what
: needs to be dereferenced into what, but I don't know why or
: what it is I need to do.  I've done similar things elsewhere
: in this application without this problem, but I don't see
: what I'm doing differently.

    The problem seems to be in the call to trace(). Functions
(and methods) won't interpolate in quoted strings without the
@{ ... } construct. Try it this way.


trace( sprintf "User: %s, %s, %s\n",
                $user->LoginName(),
                $user->FirstName(),
                $user->LastName()    );


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to