Solved

Easy One!

Posted on 2004-10-12
3
135 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 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