CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [cupofdoug] Appending to the end of a line from an input file: Edit Log



Kenosis
User

Apr 15, 2013, 11:16 AM


Views: 1110
Re: [cupofdoug] Appending to the end of a line from an input file

Here's another option:


Code
use strict; 
use warnings;

while (<DATA>) {
$_ = ( sprintf '%6f', ".$_" ) * 1e6;
print "$_\n";
}

__DATA__
11
5555
999999
22
7777
444444


Output:


Code
110000 
555500
999999
220000
777700
444444



(This post was edited by Kenosis on Apr 15, 2013, 3:21 PM)


Edit Log:
Post edited by Kenosis (User) on Apr 15, 2013, 3:21 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives