Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Interpolation: when it occurs? another beginner question..

by Discipulus (Canon)
on Feb 25, 2013 at 11:50 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found