Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.37 KB | None | 0 0
  1. # perl cookbook ch15.12
  2. # this is a revised version.
  3.  
  4. use strict;
  5. use warnings;
  6. use Term::ReadLine;
  7.  
  8. my $predefined_cmd = q[ls -all ~];
  9.  
  10. my $term = Term::ReadLine->new("APP DESCRIPTION");
  11. my $OUT = $term->OUT || *STDOUT;
  12.  
  13. $term->addhistory($predefined_cmd);
  14.  
  15. my $cmd = $term->readline("Use ARROW KEY to access predefined CMD\n> ");
  16.  
  17.  
  18. print {$OUT} qx/$cmd/ ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement