I thought this is possible, but maybe I'm wrong. Ok, here's the issue:
I want to print the values of a bunch of variables so I thought I'll
take a shortcut and do this:
foreach (qw(var1 var2 var3 var4))
{
print $_ - ${$_}\n;
}
I had thought that interpolating the variable name (${$_})
On Wed, Sep 01, 2004 at 08:11:22AM -0700, Palit, Nilanjan wrote:
I want to print the values of a bunch of variables so I thought I'll
take a shortcut and do this:
foreach (qw(var1 var2 var3 var4))
{
print $_ - ${$_}\n;
}
I had thought that interpolating the variable name (${$_})
You can also try:
foreach (qw(var1 var2 var3 var4))
{
eval ('print '.$_.' - $'.$_.'\n');
}
Either way works.
Tal Cohen
PS
... but it printed nothing.
Did you assign a value to $var1, $var2, $var3, $var4? :)
-Original Message-
From: [EMAIL PROTECTED]
Y'all are quick on the send button. To repeat...
I thought this is possible, but maybe I'm wrong. Ok, here's the issue:
I want to print the values of a bunch of variables so I thought I'll
take a shortcut and do this:
foreach (qw(var1 var2 var3 var4))
{
print $_ - ${$_}\n;
}
I had thought
Thanks for the responses. I did use my to declare the variables -
removing that allowed me to reference the variables correctly.
-Nilanjan
PS: Apologies for the multiple posts. I post rather infrequently and the
time before this, I had had a lot of problems (which I found out later
was due to
PN == Palit, Nilanjan [EMAIL PROTECTED] writes:
PN Thanks for the responses. I did use my to declare the variables -
PN removing that allowed me to reference the variables correctly.
and no one warned you about the evils of doing that. read this:
AB == Alex Brelsfoard [EMAIL PROTECTED] writes:
AB I am not using CGI to handle the information coming in from forms. It's a
AB long story, but believe me, it works out better this way.
i don't believe you. show us proof. 99% of home rolled cgi solutions
have bugs and security holes. are
AB I am not using CGI to handle the information coming in from forms. It's a
AB long story, but believe me, it works out better this way.
URI i don't believe you. show us proof. 99% of home rolled cgi solutions
URI have bugs and security holes. are you part of the 1% who knows all the
URI
On Wed, Sep 01, 2004 at 10:32:40AM -0700, Palit, Nilanjan wrote:
Thanks for the responses. I did use my to declare the variables -
removing that allowed me to reference the variables correctly.
You almost certainly don't want to do what you were trying to do though.
A hash would be the logical
AS == Aaron Sherman [EMAIL PROTECTED] writes:
AS On Wed, 2004-09-01 at 14:35, Uri Guttman wrote:
the symbol table is just a special hash tree with
global side effects. so why not just use a regular hash as it is safer
(no global side issues), more flexible (you can pass it around,
Thanks. Good stuff.
--Alex
- Original Message -
From: Jeremy Muhlich
To: [EMAIL PROTECTED]
Sent: Wednesday, September 01, 2004 3:30 PM
Subject: Re: [Boston.pm] Setting cookies in different browsers
On Wed, 2004-09-01 at 14:53, Alex Brelsfoard wrote:
I am most certainly
11 matches
Mail list logo