How to get screen size


/ Published in: Perl
Save to your folder(s)

Does not work under emacs shell mode


Copy this code and paste it in your HTML
  1. ## Under UNIX encironment
  2. ##
  3. use Term::ReadKey;
  4. my $hsize= ( Term::ReadKey::GetTerminalSize( \*STDOUT)) [0];
  5.  
  6. #--------------------------------------------------------------
  7. ## Under Windows environment
  8. ##
  9. use Win32::Console;
  10. my $cons= Win32::Console->new();
  11. my $hsize= ( $cons->Info()) [0];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.