Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Interpolation: when it occurs? another beginner question..

by Discipulus (Deacon)
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-07-13 01:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (245 votes), past polls