Skip to content

Instantly share code, notes, and snippets.

@gfx
Last active September 4, 2019 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gfx/e0ae67b9f95a9905c893f2e15b56533b to your computer and use it in GitHub Desktop.
Save gfx/e0ae67b9f95a9905c893f2e15b56533b to your computer and use it in GitHub Desktop.
perl -Masroot foo.pl # run it as root
# usage: use asroot; # run it as root
package asroot;
use strict;
use warnings;
# TODO: inherits @INC
exec "sudo", $^X, $0, @ARGV if $< != 0;
1;
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment