Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: Compare elements of a line in a file

by frozenwithjoy (Curate)
on Sep 13, 2012 at 08:45 UTC ( #993426=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Compare elements of a line in a file
in thread Compare elements of a line in a file

Unless I've made a typo, the following two snippets should be equivalent:

my $last = -50; # set to -50 so that the first coordinate will be incl +uded as long as it is 1 or more map {say if $_ > $last + 50; $last = $_} @n;
my $last = -50; for (@n) { if ($_ > $last + 50) { say $_; } $last = $_; }


Comment on Re^5: Compare elements of a line in a file
Select or Download Code
Re^6: Compare elements of a line in a file
by oxydeepu (Novice) on Sep 13, 2012 at 09:32 UTC

    Thanks a ton. I don't Know your name.
    Anyways it worked. Thank you.

    Best Regards
    Deepak

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2014-09-17 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (58 votes), past polls