Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: why won't it wrap??

by tadman (Prior)
on May 01, 2002 at 10:40 UTC ( [id://163232]=note: print w/replies, xml ) Need Help??


in reply to why won't it wrap??

Maybe if you printed $line instead of $_? You've faked yourself out it seems.

Also, you're opening INPUT but not actually using it. You're still reading that file because, coincidentally, that is what <> does.

A little touch up:
use strict; my $count = 0; open (INPUT, $ARGV[0]) || die "Could not read $ARGV[0]\n"; foreach my $line (<INPUT>) { chomp ($line); $line =~ s/(.{60})/$1\n/g; $count += />/g; print ">$count\n$line\n\n"; } close (INPUT);
I'm not entirely sure why you're only printing split lines.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found