Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Interpolation: when it occurs? another beginner question..

by Discipulus (Prior)
on Feb 25, 2013 at 11:50 UTC ( #1020500=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!perl
    use strict;
    ...
    descr is null and list is empty
    descr is null and list is empty
    descr is null and list is empty
    
  2. or download this
    my $text = q{
      Dear $person,
    ...
      I know that this text is not interpolated.
      But I wish it could be...
    
  3. or download this
    my $n = sub {1};
    my $m = sub {&$n*2};
    ...
    __OUTPUT__
    1 2 4
    2 4 8
    
  4. or download this
      How can I expand variables in text strings?
        Let's assume that you have a string that contains placeholder vari
    +ables.
    ...
            );
            $text =~ s/\$(\w+)/$user_defs{$1}/g;
    
  5. or download this
    my $color = "red";
    my $fruit = "apple";
    ...
    >>Hi, my name is $name.  Please hand me a $color $fruit.<<
    ->Hi, my name is chromatic.  Please hand me a red apple.<-
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1020500]
Front-paged by Arunbear
help
Chatterbox?
[marto]: good morning all, TCIF
[Discipulus]: TCIF & chips marto! and sane dots too
[Corion]: Hi marto ;) All Hail Crunchy!

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2017-02-24 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (353 votes). Check out past polls.