Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: An easier way to construct lists of numbers?

by yosefm (Friar)
on Jan 24, 2004 at 15:39 UTC ( #323839=note: print w/ replies, xml ) Need Help??


in reply to Re: An easier way to construct lists of numbers?
in thread An easier way to construct lists of numbers?

Very nice, Chady.

I'd like to add a few things:

First, to filter out the unused ($lite[$something][5]) you can change:

$h{$xy} = [$_->[0], $_->[1]];
to:
$h{$xy} = [$_->[0], $_->[1]] if $_->[5];

Second, when you write a loop, you should try to include only the essential stuff in it, so your program runs faster and consumes less resources. so this:

for my $o (0 .. $#line) { select BLA print ... select STDOUT }

can become:
select BLA; for my $o (0 .. $#line) { print ... } select STDOUT;
But it's also possible to give a file handle to print, like so: print HANDLE "Something\n"; and then you don't have to select and reselect at-all.

perl -e'$b=unpack"b*",pack"H*","59dfce2d6b1664d3b26cd9969503";\ for(;$a<length$b;$a+=9){print+pack"b8",substr$b,$a,8;}'
My public key


Comment on Re: Re: An easier way to construct lists of numbers?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-07-30 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls