Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: how to delete part of the line?

by akho (Hermit)
on May 21, 2009 at 21:07 UTC ( #765548=note: print w/replies, xml ) Need Help??


in reply to how to delete part of the line?

General advice: use strictures and the 3-argument form of open. Something like this:
use strict; use warnings; open my $in, '<', 'infile'; open my $out, '>', 'outfile'; my @values; while (my $line = <$in>) { chomp $line; my ($value,) = $line =~ /^line\d+=(.+)/; push @values, $value if (defined $value); } print $out join('/', @values); close $in; close $out;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://765548]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2016-12-09 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (148 votes). Check out past polls.