Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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;


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (18)
As of 2014-07-23 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (144 votes), past polls