Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

abaxaba's scratchpad

by abaxaba (Hermit)
on Jun 04, 2004 at 18:05 UTC ( #361035=scratchpad: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    open (X,$0);X([<X>]);sub X{$x=shift;print pack("C*",
    ...
    map{s|\#||;eval}(grep/x/,(grep/^\#/,@$x))))));}
    #$x="2x37|13x3X2|23x5|29x2X2|2X5|5x13|5x2x11|3x37|29x2X2|13x2X3|101|19
    +x3x2";
    #$x="|2X5|2X4x5|101|19x3x2|3X3x2X2|2X5|2X3x3X2|97|3X2x11|107|101|19x3x
    +2";
    
  2. or download this
    use CGI qw(param); 
    
    my %hash= map{my $v=[param($_)];$_,$#$v>0?join
                 ("\0",@$v):shift@$v}param();
    
  3. or download this
    my $x=50; #blocksize
    foreach (my $i=0;$i<=int($#ary/50);$i++) 
    ...
        my @keep = @ary[$i*$x..$end]; 
        # Do stuff with @keep
    }
    
  4. or download this
    my @sorted;
    my @array=(0..10);
    ...
    
    @sorted=map{(shift @first, shift @array)}(0..$#array);
    push (@sorted, shift @first) if ++$#first;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-05-21 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?