dereference question

Bob Kleemann rkleeman at energoncube.net
Sun Mar 9 09:13:26 CST 2003


~sdpm~
s/\$(\w+)/${$1}/;

Keep in mind though that this can be abused.  Make sure you know you can
really trust what's in INFILE.

Also, it appears that you are working on a simplistic templating system.
Have you considered using one of the pre-built systems already available?

On Sat, Mar 08, 2003 at 10:31:57PM -0800, Joel Fentin wrote:
> ~sdpm~
> open(INFILE, "<xxx.htm");
> while(<INFILE>)
> {
> $_ =~ s/\$D/${\$D}/g; #line 1
> $_ =~ s/\$D/$D/g;      #line 2
> print;
> }
> close(INFILE);
> 
> In my application, both line 1 and line 2 seem to do the same job, thus
> revealing the value contained within. But they won't work for $E or $F. Is
> there a line of code which will apply to all referenced scalars that are
> read in from the file?
> --
> Joel Fentin    tel: 760-749-8863    FAX: 760-749-8864
> email:   joel at fentin.com
> Biz:   http://fentin.com
> Personal:   http://fentin.com/me/
> 
> 
> ~sdpm~
> 
> The posting address is: san-diego-pm-list at hfb.pm.org
> 
> List requests should be sent to: majordomo at hfb.pm.org
> 
> If you ever want to remove yourself from this mailing list,
> you can send mail to <majordomo at happyfunball.pm.org> with the following
> command in the body of your email message:
> 
>     unsubscribe san-diego-pm-list
> 
> If you ever need to get in contact with the owner of the list,
> (if you have trouble unsubscribing, or have questions about the
> list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
> This is the general rule for most mailing lists when you need
> to contact a human.
~sdpm~

The posting address is: san-diego-pm-list at hfb.pm.org

List requests should be sent to: majordomo at hfb.pm.org

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.




More information about the San-Diego-pm mailing list