Help for this page

Select Code to Download


  1. or download this
    $AGE = 17;
    $text = 'I am $AGE years old';      # note single quotes
    $text =~ s/(\$\w+)/$1/eeg;           # print I am 17 years old
    $text =~ s/(\$\w+)/$1 * 2/eegx;  #I tried to double the age, but faile
    +d
    
  2. or download this
    $text = "I am 17 years old";
    $text =~ s/(\d+)/2 * $1/eg; #now I am 34 years old