Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3215712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:12:35+00:00 2026-05-17T15:12:35+00:00

I just have begun with Perl and I want to write my own script

  • 0

I just have begun with Perl and I want to write my own script to scan a document and convert the resulting TIFF file to a PDF file. If the conversion succeeds (using tiff2pdf), I want to print “Done” at the end of the line, but I can’t seem to find a hint to do this on the Web.

My guess is that I have to get the geometry of the terminal and count the letters I already printed but that seems to be to complicated. Do you have any advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:12:36+00:00Added an answer on May 17, 2026 at 3:12 pm

    You’re right about having to inspect the size of the terminal you’re printing to. There’s many ways to do that, but the most portable and reliable way I’m aware of is Term::Size::Any.

    With that, you can get the width of the terminal you’re running in:

    use Term::Size::Any;
    my $cols = chars *STDOUT{IO};
    

    With that, you can then print whatever you want, padded with the right amount of whitespace, e.g.:

    printf "% ${cols}s", "Done\n";
    

    Also be aware that programs don’t always output to terminals. Output could, for example, be redirected to a file, so you might want to have an appropriate fallback if determining the terminal size fails.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just begun to learn Perl and found myself stymied by the result
I have just begun to write OCaml code lately hence this might be a
I just installed ActivePerl on Windows and have begun to learn Perl. In the
I have just begun working on a project which uses Mercurial as a version
I have just begun working with the Android SDK and I am having problems
I have just begun to use Visual Studio Team System 2008 Database Edition. I'm
I just have an XP machine, and i want to play around using CC.NET.
I've just begun learning Unix and have so far encountered two elementary though difficult
I have just begun playing with MooTools, and I don't understand why the following
I'm reading about the State pattern. I have only just begun, so of course

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.