code_junkie

What's the best way to tell if your perl's running on -e?

Nov 11th, 2011
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. my $process_info = `ps $$ | tail -1`;
  2. my $is_oneliner
  3. = $process_info =~ m/perl.*?s+-[^P{IsLower}e]*e[^P{IsLower}e]*s+/m
  4. ;
  5.  
  6. package MMN;
  7. use My::Module::Name '/./';
  8. use Exporter ();
  9. @ISA = 'Exporter';
  10. @EXPORT = @My::Module::Name::EXPORT_OK;
  11. 1;
  12.  
  13. perl -MMy::Module::Name=/./ -e ...
Add Comment
Please, Sign In to add comment