Solved

Easy One!

Posted on 2004-10-12
3
137 Views
Last Modified: 2013-12-25
I have been doing this quite a while, perl, this one is just bugging me.

I have a fixed variable called
$A = "0001";
that resides in a delimited database.
I have 2 pics for each data piece, one called 0001 and the other 0001L

Now when I call up this:
$pic = "$A";
print "http://www.mydomain.com/$A.jpg";
pulls pic just fine....

But when I try this:
print "http://www.mydomain.com/$AL.jpg";
to call up the other pic, it does not work!
0
Comment
Question by:precision
3 Comments
 
LVL 3

Accepted Solution

by:
WhisperUK earned 400 total points
ID: 12292900
I dont know PERL but i do a bit of unix scripting and I can see straight away that in the secong example you are actually asking for a variable named $AL  and you haven't got one of them. Curly braces might be the answer here so
try this instead:

print "http://www.mydomain.com/${A}L.jpg";

Hope that helps :)
0
 
LVL 84

Assisted Solution

by:ozo
ozo earned 100 total points
ID: 12294685
I do know Perl, and  WhisperUK is correct.
0
 

Author Comment

by:precision
ID: 12296836
Thanks guys!
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to dynamically set the form action using jQuery.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question