You ran into a Perlism Single quotes donāt interpolate the special
character ā@ā - double quotes do. Which is why you have to escape it
with double quotes.
You ran into a Perlism Single quotes donāt interpolate the special
character ā@ā - double quotes do. Which is why you have to escape it
with double quotes.-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf
Of Hasan Muhammad
Sent: Monday, January 30, 2006 10:48 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] escaping @ in email addresses in
RT_SiteConfig.pm ā todo or not to do?āwhen this address is set asā¦
Set($OwnerEmail, āadmin@test-network.usā);
ā¦it results in this errorā¦
Possible unintended interpolation of @test in string at
/etc/rt/RT_SiteConfig.pm line 34.
ā¦when the database is created (or dropped)āwhen the @ is escaped asā¦
Set($OwnerEmail, āadmin@test-network.usā);
ā¦no error (message) occursāhowever, no error message occurs with the other email addressā¦
Set($CorrespondAddress, ācorrespond@rt.test-network.usā);
Set($CommentAddress, ācomment@rt.test-network.usā);
ā¦whether they are escaped or notāwhat is the correct method for specifying email addresses,
with or without the escape?Hasan
CentOS 4.2server
rt-3.4.5-1==============================================================
āSetup on Centos 4.2 Server perā¦
Request Tracker Wiki
ā¦using (see INSTALLATION PROCEDURE below)ā¦
yum install perl-DBD-Pg rt rt-mail-dispatcher mysql-server lynxāthen after making local configuration changes (see FILE
CHANGES and INSTALLATION PROCEUDURE
below)ā¦
/usr/sbin/rt-setup-database --action init --dba root
ādba-password contribs.org
ā¦results in error messageā¦
Possible unintended interpolation of @test in string at
/etc/rt/RT_SiteConfig.pm line 34.āFILE CHANGES: MADE AFTER BASE CENTOS 4.2 SERVER INSTALLā¦
ā /etc/rt/RT_SiteConfig.pm.orig 2006-01-12
23:04:30.000000000 -0500
+++ /etc/rt/RT_SiteConfig.pm 2006-01-19 23:39:33.000000000 -0500-Set( $rtname, āexample.comā);
+Set($rtname, ātest_network_usā);+Set($Organization , ārt.test-network.usā);
+Set($Timezone, āUS/Easternā);
+Set($WebBaseURL, āhttp://rt.test-network.usā);
+Set($WebPath, ā/ā);
+Set($WebURL , $WebBaseURL . $WebPath . ā/ā);
+
+Set($CorrespondAddress, ācorrespond@rt.test-network.usā);
+Set($CommentAddress, ācomment@rt.test-network.usā);
+Set($SendmailPath, ā/usr/sbin/sendmailā);
+Set($SendmailArguments , ā-oi -tā);
+
+Set($LogToSyslog, āā);
+Set($LogToFile, ādebugā);
+Set($LogDir, ā/var/log/rtā);
+Set($LogToFileNamed , ārt.logā);
+
+Set($OwnerEmail, āadmin@test-network.usā);
+Set($MyTicketsLength, 20);
+
+Set($DatabasePassword , ācontribs.orgā);
+
+Set($AmbiguousDayInPast , 0);
+1;
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
You ran into a Perlism Single quotes donāt interpolate the special
character ā@ā - double quotes do. Which is why you have to escape it
with double quotes.
ā¦but is not this line that caused the error messageā¦
Set($OwnerEmail, āadmin@test-network.usā);
ā¦already escaped with double quotes?
Hasan
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
Hello!On Mon, 2006-01-30 at 10:57, Hasan Muhammad wrote:
ā āSchultz, Ericā ESchultz@corp.untd.com wrote:
You ran into a Perlism Single quotes donāt interpolate the special
character ā@ā - double quotes do. Which is why you have to escape it
with double quotes.ā¦but is not this line that caused the error messageā¦
Set($OwnerEmail, āadmin@test-network.usā);
ā¦already escaped with double quotes?
Those double quotes cause Perl to examine the string between them,
looking for variable names to expand. Since Perl considers ā@fooā the
same as join(" ", @foo), it wants to interpolate @test as a Perl array
ā¦ which it isnāt, so you get the complaint you mentioned. Putting a
backslash ahead of the @ explains to Perl that itās really just an @.
If you put it all in single quotes, Perl considers that a string literal
which it shouldnāt examine, so no complaints.
The end result: Donāt put email addresses in double quotes if you can
avoid it; if you canāt avoid it, you need to use @.
Cheers!
āj
Jim Meyer, Geek at Large purp@acm.org
Hi all. Iām writing a custom scrip that performs some ābusiness timeā
calculations on tickets, with the idea of determining SLA compliance.
The business details are boring, but Iāve got a weird technical problem.
Iām using Jesse Vincentās most excellent Business::Hours module to perform
the calculation that I want. It works fine. When itās done, Iāve got a time
in UNIX epoch seconds.
Here is where things go weird. I want to convert the UNIX epoch seconds into
a string, along these lines:
MM/DD/YYYY hh:mm:ss AM|PM TZ
No problem, Iāll just use the POSIX package and the good old strftime
function. Letās say the UNIX epoch seconds are stored in $MySeconds, then
Iāve got code like this:
my $TimeString = strftime(ā%m/%d/%Y %r %Zā,localtime($MySeconds));
The problem is, about 5% of the time, this scrip fails, and the RT error log
shows:
[Tue Jan 31 00:10:58 2006] [error]: Scrip 339 Commit failed: Usage:
POSIX::strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1,
isdst = -1) at (eval 33876) line 50.
So, I figure, strftime just got bad data. So I use $RT::Logger->error to
send $MySeconds and localtime($MySeconds) to the error log.
My epoch seconds are good, but the output of localtime($MySeconds) seems to
vary, even when supplied with the same input data. Sometimes posting
localtime($MySeconds) to the error log results in a string posted to the
error log, like
Thu Jan 19 08:00:00 2006
Other times, it results in an ARRAY:
Time::tm=ARRAY(0xde1a0f0)
In the first case, I always get a good string out of strftime. In the second
case, I always get the POSIX::strftime error and the scrip execution fails.
Ideas? Iām thinking that PERL is calling different versions of localtime().
Maybe. How would I find out?
Iām also mystified why this code works literally 95 times out of 100, but
fails every once in awhile.
Rick R.
For computer help, call xHELP (x4357 or 713-348-4357)
On the web: http://helpdesk.rice.edu/
Rick Russell
Helpdesk Supervisor, Client Services
IT/Academic & Research Computing
Rice University
Voice: 713.348.5267 Fax: 713.348.6099
OpenPGP/GnuPG Public Key at ldap://certificate.rice.edu
761D 1C20 6428 580F BD98 F5E5 5C8C 56CA C7CB B669
rickr.vcf (560 Bytes)
signature.asc (252 Bytes)
Brandon S. Allbery KF8NH wrote:
Something is using Time::localtime, but not consistently. You can work
around it by calling CORE::localtime which always gets the Perl built-in.
Of course, about 5 minutes after I sent e-mail about it, I had an
inspiration and decided to change all instances of ālocaltimeā and
āstrftimeā in my code to
POSIX::localtime
and
POSIX::strftime
respectively. I suspect (bearing further testing) that this will permanently
fix it.
For computer help, call xHELP (x4357 or 713-348-4357)
On the web: http://helpdesk.rice.edu/
Rick Russell
Helpdesk Supervisor, Client Services
IT/Academic & Research Computing
Rice University
Voice: 713.348.5267 Fax: 713.348.6099
OpenPGP/GnuPG Public Key at ldap://certificate.rice.edu
761D 1C20 6428 580F BD98 F5E5 5C8C 56CA C7CB B669
rickr.vcf (560 Bytes)
signature.asc (252 Bytes)
My epoch seconds are good, but the output of localtime($MySeconds)
seems to
vary, even when supplied with the same input data. Sometimes posting
localtime($MySeconds) to the error log results in a string posted
to the
error log, likeThu Jan 19 08:00:00 2006
Other times, it results in an ARRAY:
Time::tm=ARRAY(0xde1a0f0)
Something is using Time::localtime, but not consistently. You can
work around it by calling CORE::localtime which always gets the Perl
built-in.
brandon s. allbery [linux,solaris,freebsd,perl]
allbery@kf8nh.com
system administrator [openafs,heimdal,too many hats]
allbery@ece.cmu.edu
electrical and computer engineering, carnegie mellon university
KF8NH