Posted By

kkindoh on 07/08/06


Tagged

size screen


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

kenshin
ramon


How to get screen size


 / Published in: Perl
 

Does not work under emacs shell mode

  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  

You need to login to post a comment.