Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Easy One!

Posted on 2004-10-12
3
Medium Priority
?
144 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 1600 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 85

Assisted Solution

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

Author Comment

by:precision
ID: 12296836
Thanks guys!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

971 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