How do you use sed from Perl?

前端 未结 10 522
渐次进展
渐次进展 2021-01-18 01:14

I know how to use sed with grep, but within Perl the below fails. How can one get sed to work within a Perl program?

c         


        
10条回答
  •  暖寄归人
    2021-01-18 01:23

    You can use

    perl -pe 's/search/replace/g'
    

    in place of

    sed 's/search/replace/'
    

    .. However ..

    Those are meant for command line or shell scripts. Since youre already in a perl script, the correct answer was given by "Paul Tomblin" above.

    Have fun, eKerner.com

提交回复
热议问题