#!/usr/local/bin/perl use strict; use warnings; use File::HomeDir qw(home); use constant { DUNSTRC_PATH => home() . '/.config/dunst/dunstrc', NOTIFYSEND_PATH => '/usr/local/bin/notify-send' }; sub main() { my @lines; open(FH, '<', DUNSTRC_PATH) or die $!; @lines = do { local $/; }; close(FH); open(FH, '>', home() . '/tmp') or die $!; print FH @lines; close(FH); return; } main(); __END__