[BNE-PM] I need a little bit of help here...]

Ramon Buckland r.buckland at qut.edu.au
Sun Sep 12 00:39:33 CDT 1999



-------- Original Message --------
Subject: Re: [BNE-PM] I need a little bit of help here...
Date: Sun, 12 Sep 1999 15:37:41 +1000
From: Ramon Buckland <r.buckland at qut.edu.au>
To: Andrew Pollock <apollock at bit.net.au>
References: <004a01befa8d$824f7250$575e12cb at minotaur.bit.net.au>

Hi Andrew .. 

I noticed you haven't had a reply (well not comming
back through the list anyways)

Here is what I know (anyone may sure well correct me)

If you pass \$to to a function .. 
you are (yep) passing the reference. the address if you like to the var
$to

to get the value from the reference .. you 
would do a

${$ref} if its a scalar 
@{$ref} if its a list  (passed like \@arry)
%{$ref} if its a hash  (passed like \%hash)

AND the beauty 

you can also in most situations.. negate the {}'s
like

$$ref 
@$ref
%$ref

An Example
#!/usr/bin/perl

$test = 'whoo hoo';
$ref = \$test;
print "direct -> ". $test ."\n by reference -> " . $$ref ."\n";
$test = 'whoo hoo';



Does that help ?


> 
> elsif ($evtype == $main::EVENT_EMAIL)
>         {
>                 # Report is being modified by receiving mail
>                 # arg1 is \%to, arg2 is \%from
> 
>                 &main::sendMail($$to{assigned}, "received mail about
> $$to{id}",
>                 "DTS has received email about report $$to{id}");
> 
> This is the snippet of code that is relevant.
> 
> The sendMail subroutine is defined elsewhere and takes the following
> arguments:
> 
> local ($address, $subject, $message, $from, $replyTo) = @_;
> 
> The actual invocation of sendMail was given to me by the author of the
> system, but it's not working as expected and while I was waiting on a reply
> back from him, I thought I'd play around myself. The bit that is confusing
> me is the double dollar signs in front of the "to" and the "id" and the
> reference to the "to" and "from" hashes with a backslash in front of them.

-- 
Ramon Buckland, System Administrator, Facilities Support Services
Phone: 07 3864 1289  Fax: 07 3864 1823 Mobile: 0414 27 1289 (x6070)
Email: r.buckland at qut.edu.au http: www.fss.qut.edu.au
<http://www.fss.qut.edu.au/>



More information about the Brisbane-pm mailing list