Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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;

Comment on Re: how to delete part of the line?
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2015-07-06 06:54 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (70 votes), past polls