Solved

Easy One!

Posted on 2004-10-12
3
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

738 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