Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > how do you interpoplate against units in a here-doc?

Reply
Thread Tools

how do you interpoplate against units in a here-doc?

 
 
~greg
Guest
Posts: n/a
 
      02-06-2006

problem is something like this:

var $WIDTH = 10;
print OUT <<__;
....
width: $WIDTHpx;
....
__

to print
....
width: 10px
....


What can be insert between the "$WIDTH" and the "px to make this work?

(don't want to break up the here-doc.

Thought of using $X = "" but that obviously doesn't work.
If there is a special variable (like $_)
that's == "", that might work.)




 
Reply With Quote
 
 
 
 
DJ Stunks
Guest
Posts: n/a
 
      02-06-2006
~greg wrote:
> problem is something like this:
>
> var $WIDTH = 10;
> print OUT <<__;
> ...
> width: $WIDTHpx;
> ...
> __
>
> to print
> ...
> width: 10px
> ...
>
>
> What can be insert between the "$WIDTH" and the "px to make this work?


\ (but it throws a warning)

-jp

 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      02-06-2006
"~greg" <(E-Mail Removed)> wrote:

> width: $WIDTHpx;


....

> What can be insert between the "$WIDTH" and the "px to make this work?


use: ${WIDTH}px;

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com

 
Reply With Quote
 
DJ Stunks
Guest
Posts: n/a
 
      02-06-2006

John Bokma wrote:
> "~greg" <(E-Mail Removed)> wrote:
>
> > width: $WIDTHpx;

>
> ...
>
> > What can be insert between the "$WIDTH" and the "px to make this work?

>
> use: ${WIDTH}px;
>


of course... duh.

my bad,
-jp

 
Reply With Quote
 
~greg
Guest
Posts: n/a
 
      02-06-2006

right right, sorry! sorry!

(i did try {$WIDTH} first ...
--- and it didn't work .... duh..duh! )

thanks.


"DJ Stunks" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) ups.com...
>
> John Bokma wrote:
>> "~greg" <(E-Mail Removed)> wrote:
>>
>> > width: $WIDTHpx;

>>
>> ...
>>
>> > What can be insert between the "$WIDTH" and the "px to make this work?

>>
>> use: ${WIDTH}px;
>>

>
> of course... duh.
>
> my bad,
> -jp
>




 
Reply With Quote
 
John Bokma
Guest
Posts: n/a
 
      02-06-2006
"~greg" <(E-Mail Removed)> wrote:

> right right, sorry! sorry!
>
> (i did try {$WIDTH} first ...
> --- and it didn't work .... duh..duh! )


greg, don't top post but reply underneath the part you're replying to.

Thanks,

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
M$ against Blu-ray, M$ for Blu-ray, M$ against Blu-ray, M$ forBlu-ray, ...... Blig Merk DVD Video 66 04-27-2008 04:46 AM
PSTN VOIP adapter AVOID USB powered units the cost of power willeat you LVMarc UK VOIP 13 10-20-2007 11:30 PM
PSTN VOIP adapter AVOID USB powered units the cost of power willeat you LVMarc VOIP 1 05-18-2007 04:04 PM
Lastest Patches + Zone Alarm & you think you're safe against Trojans? Howard NZ Computing 15 08-28-2003 09:09 AM



Advertisments