Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Interpolation: when it occurs? another beginner question..

by Discipulus (Monsignor)
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
    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};
    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
            $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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1020500]
Front-paged by Arunbear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2017-12-13 23:26 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (381 votes). Check out past polls.