in reply to Perl in Bash

As Corion says, Lack of bash interpolation is the problem.

to fix, try:

perl -pe 's%REPLACE_HERE%'$p'%g' abc.txt > $p
Which gets the $p outside the single quotes. (untested)

        "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams

Replies are listed 'Best First'.
Re^2: Perl in Bash
by morgon (Priest) on Mar 16, 2015 at 16:50 UTC
    Or maybe simpler
    perl -pe "s%REPLACE_HERE%$p%g" abc.txt > $p