Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Generating a List of numbers

by JavaFan (Canon)
on Jan 31, 2012 at 02:45 UTC ( #950859=note: print w/replies, xml ) Need Help??


in reply to Generating a List of numbers

I would do something like (untested):
use autodie; my %byte_count; open my $fh1, "<", "TmpLookingForIPFile"; while (<$fh1>) { chomp; $byte_count{$_} = 0; } open my $fh2, "<", "TmpIPFile"; while (<$fh2>) { next if /^sh|^\s*Source|^$DestDevice|^Accounting|^^M|^$/; # Do NO +T end with |/ here, as it then will always match chomp; my ($dest, $bytes) = (split)[1, 3]; $byte_count{$dest} += $bytes if exists $byte_count{$dest}; } while (my ($ip, $bytes) = each %byte_count) { my_sub($ip, $bytes); } sub my_sub { ... something that uses the ip and the byte count }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950859]
help
Chatterbox?
[Corion]: Meh. I get the feeling I should post a call-to-action for people to test their modules with the upcoming 5.26 (or 5.25.latest), as it seems that the smoke testers don't really weed out modules that fail without . in @INC
[Corion]: But without instructions on how to easily test things yourself, I don't think such a call to arms is helpful
[Corion]: (this post on nntp.perl.org / p5p makes it seem to me that smoke testers seem to have a blind spot there)
[Corion]: Hmmm. Maybe setting $ENV{PERL5LIB}=" some path without dot"; perl Makefile.PL; make test already is enough to locally test your module...
[Corion]: Meh, no, will need a BEGIN hook...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2017-03-27 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (317 votes). Check out past polls.