Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
sed私は次のようなことができます:
sed
#!/bin/sed -f s/pattern/replacement/g
上記のperlの最も単純な同等物は何ですか?
#!/usr/bin/env perl while (my $m = <>) { $m =~ s/pattern/replacement/g; print $m; }
perlではそれはただ
#!/usr/bin/perl -nw s/pattern/replacement/g
それはそのようになります :
my $str = "fred"; $str =~ s/f/g/g;