Help for this page

Select Code to Download


  1. or download this
    my $line = 'She was very absorbed in her homework.';
    my $word = 'absorb';
    ...
    $_=$line;
    s/ ($word)//ig;
    print "\$1 is $1\n";
    
  2. or download this
    #This also fails
    s/(\b$word)//ig;
    ...
    #or EVEN THIS!
    my $pat = qr/$word/;
    s/\b($word)//gi;