in reply to Re: Appending strings
in thread Appending strings

I tried it and it says : syntax error at t line 80, near "s/(\w+)/$path.$1/gr" Execution of t aborted due to compilation errors.

Replies are listed 'Best First'.
Re^3: Appending strings
by toolic (Bishop) on Sep 17, 2015 at 00:44 UTC
      This is perl, v5.8.8 built for x86_64-linux-thread-multi
Re^3: Appending strings
by Anonymous Monk on Sep 17, 2015 at 01:50 UTC
    #!/usr/bin/perl # http://perlmonks.org/?node_id=1142266 use strict; use warnings; my $path = "XX.YY.ZZ"; my $s = "(ABC | (~dEf & hIJ)) & ~LMn"; (my $answer = $s) =~ s/(\w+)/$path.$1/g; print "$answer\n";

    Tweaked for older perls.