NAME
IO::Plumbing::Util - freebies in the bag
SYNOPSIS
use IO::Plumbing::Util qw(shell_quote shell_unquote);
my $bad_fn = q{pw"`sudo rm -rf *`"n3d};
print shell_quote($bad_fn); # pw\"\`\ sudo\ rm\ \-rf\ \*\`\"n3d
print shell_unquote(shell_quote($bad_fn)); # identity, we hope ;)
DESCRIPTION
A couple of small functions for turning command line arguments into something which you can safely paste back into the shell to run, even in the face of arbitrary weird rubbish.
FUNCTIONS
- shell_quote(@args)
-
Returns a string which should be safe for saving, through X buffers, and later decoding with a Bourne Shell or
shell_unquote
. - shell_unquote($string)
-
Returns a list. Of course there are many inputs the shell would consider a special character where this module blithely lets it through.
AUTHOR AND LICENCE
Copyright 2007, Sam Vilain. All Rights Reserved. This program is free software; you can use it and/or modify it under the same terms as Perl itself.