Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How to add each line into single line in txt file PERL?

by Ratazong (Monsignor)
on Feb 19, 2013 at 13:41 UTC ( #1019555=note: print w/replies, xml ) Need Help??


in reply to How to add each line into single line in txt file PERL?

Hi Hellena,

I'm a bit guessing what you want to achieve. I assume you have the problem that Dump($post) is printed more than once in case there is more than one unique line in both files. You can evade this by leaving the loop once you printed the first time. That could be done the following way, using last:

foreach my $line(keys %results){ if ($results{$line} == 1) { print Dump($post) ; last; } }
HTH, Rata

Replies are listed 'Best First'.
Re^2: How to add each line into single line in txt file PERL?
by Hellena (Initiate) on Feb 19, 2013 at 13:48 UTC
    Yes thats it, thaks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019555]
help
Chatterbox?
[LanX]: shmem I upvoted your reply ... for sympathy only
[LanX]: ;)
[Discipulus]: good night monks!
[shmem]: LanX: oh... now I have to figure out if this is good or bad news.
LanX bad day monks ?
[LanX]: hope you find sleep
[shmem]: LanX: which one?
[LanX]: the last
Discipulus yes a very bad day
[shmem]: grandola, vila morena

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-04-29 22:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (534 votes). Check out past polls.