Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
        append_file( $filePath, map { "$_\n" } @smb);
        # append_file( $filePath, "\n"); # if you want to append multiple 
    +times
    }
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
        s{ ^\s* | \s*$ }{}gx for @smb;
        io($path)->appendln(@smb);
    }
    
  3. or download this
    $ cat test_1.txt
    chkconfig smb: OK
    ...
    apt-daily.timer                            enabled
    motd-news.timer                            enabled
    snapd.refresh.timer                        enabled