Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: The text preceding <STDIN> is not printed

by c_config (Initiate)
on Aug 17, 2016 at 20:23 UTC ( [id://1169948]=note: print w/replies, xml ) Need Help??


in reply to The text preceding <STDIN> is not printed

As more experienced programmers pointed out (thank you to afoken!!!), I've had the buffering issue. After reading this article at perl.plover.com/FAQs/Buffering.html, I've applied the filehandle HOT. Now my script works as expected and looks like this:
#!/usr/bin/perl -w use strict; use warnings; print "Please, enter the hex number : \n"; S|=1; my $hex = <STDIN>; print "$hex", "\n"; chomp ($hex); print "You've entered hex: ", $hex, "\n"; print "The decimal equivalent is ", hex "$hex", "\n";
Thank you very much for the help!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1169948]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2026-04-17 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.