Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

The Monastery Gates

( #131=superdoc: print w/replies, xml ) Need Help??

Donations gladly accepted

If you're new here please read PerlMonks FAQ
and Create a new user.

New Questions
[PPM (Perl Package Manager)] Installing multiple modules from a single ppd file
1 direct reply — Read more / Contribute
by syphilis
on Mar 28, 2017 at 06:17
    Hi,
    Here follows a post I sent to ActiveState's ppm mailing list about 24 hours ago:

    <quote>

    Is it possible to have the one ppd file download, unpack and install more than one tarred and gzipped blib file.

    That is, instead of having just one "<CODEBASE HREF= ..." line, I'm looking for the option of having multiple such "<CODEBASE HREF=...." lines present in the one ppd file, such that a number of different tarred and gzipped blib files are dowwnloaded, unpacked and installed.

    Possible ? ... or do I have to put the additional files into their own separate ppm distro and pull them in with "DEPENDENCY NAME".

    Btw, is there a difference between DEPENDENCY NAME and REQUIRE NAME ?

    </quote>

    It's a very low volume mailing list, and no replies yet.
    So I thought I might repeat the post here.

    I've a vague notion that, at some time in the past, I've come across a ppd file that would install multiple perl modules, but I'm currently unable to locate such an example.

    Cheers,
    Rob
How to patch this module?
3 direct replies — Read more / Contribute
by ultranerds
on Mar 28, 2017 at 05:19
    Hi guys,

    I've setup my own server with Perl 5.22.1, and I'm having issues installing a Perl module (Kavorka, which is an annoying requirement of Net::Stripe). After some digging, it seems to be around this :

    PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::H +arness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/l +ib', 'blib/arch')" t/*.t t/01basic.t .................... ok t/02named-functions.t .......... Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Fun" at /root/.cpan/build/Kavor +ka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/02named-functions.t .......... Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/03anon-functions.t ........... Can't locate object method "declared_ +name" via package "Kavorka::Sub::Fun" at /root/.cpan/build/Kavorka-0. +037-RoeMIW/blib/lib/Kavorka/Sub.pm line 48. t/03anon-functions.t ........... Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/04named-methods.t ............ Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Method" at /root/.cpan/build/Ka +vorka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/04named-methods.t ............ Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/05anon-methods.t ............. Can't locate object method "declared_ +name" via package "Kavorka::Sub::Method" at /root/.cpan/build/Kavorka +-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 48. t/05anon-methods.t ............. Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/10positional.t ............... Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Fun" at /root/.cpan/build/Kavor +ka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/10positional.t ............... Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/11named.t .................... Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Fun" at /root/.cpan/build/Kavor +ka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/11named.t .................... Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/12invocant.t ................. Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Method" at /root/.cpan/build/Ka +vorka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/12invocant.t ................. Dubious, test returned 255 (wstat 652 +80, 0xff00)
    ...etc

    I found a report of a bug in Devel::CallParser:

    https://rt.cpan.org/Public/Bug/Display.html?id=110623

    I made the change the suggest in the patch for CallParser.xs in the .gz file, but I can't work out what this file is meant to be:

    t/pad2.t

    (I don't see it in the .gz from CPAN)

    Can anyone point me? Its sooooo frustrating that ALL of my issues are resting on this one bug, that after over a year still doesn't seem to have been fixed in the official releas :/

    Thanks!

    Andy
perl6 custom operator problem
No replies — Read more | Post response
by freakcoco
on Mar 28, 2017 at 05:07

    hi monk I am studying chemistry in the university,
    and then I try to write all the things in the textbook with Perl6 or Perl,
    like balancing the chemical formula or other process!
    Then I encountered the problem is on perl6 custom operator.
    I feel I have been repeating my code and myself when i use the feature.
    It is hard to read and write, and what is the way to deal with such problems?

    #!/usr/bin/env perl6 use v6; #basic SI(International System of Units) type role MetricPrefix { method baseOn ( Str $base , Numeric $input ) { given $base { when 'pico' { return $input * 10**-12 } when 'namo' { return $input * 10**-9 } when 'micro' { return $input * 10**-6} when 'milli' { return $input * 10**-3 } when 'centi' { return $input * 10**-2 } when 'hecto' { return $input * 10**2 } when 'kilo' { return $input * 10**3 } when 'mega' { return $input * 10**6 } when 'giga' { return $input * 10**9 } when 'tera' { return $input * 10**12 } default { fail "you must input a metric prefix which allow + pico to tera" } } } } class Mass does MetricPrefix { #basic Mass is g is different form si statda has $.g; submethod BUILD ( :$!g ) { } } class Length does MetricPrefix { has $.Length ; submethod BUILD ( :$!Length ) { } } multi postfix:<(kg)>( $input ) { return Mass.new( g => Mass.baseOn("kilo",$input) ) or fail "you Mu +st input a number"; } multi postfix:<(g)>( $input ) { return Mass.new( g => $input ) or fail "you Must input a number"; } multi infix:<+>( Mass $inputOne , Mass $inputTwo ) is assoc<right> { return Mass.new( g => $inputOne.g + $inputTwo.g) or fail "error in + there "; } multi infix:<->( Mass $inputOne , Mass $inputTwo ) is assoc<right> { return Mass.new( g => $inputOne.g - $inputTwo.g) or fail "error in + there "; } multi infix:<*>( Mass $inputOne , Mass $inputTwo ) is assoc<right> is +tighter( &infix:<+> ) is tighter( &infix:<-> ) is tighter( &infix:</> +) { return Mass.new( g => $inputOne.g * $inputTwo.g) or fail "error in + there "; } multi infix:</>( Mass $inputOne , Mass $inputTwo ) is assoc<right> is +tighter( &infix:<+> ) is tighter( &infix:<-> ) { return Mass.new( g => $inputOne.g / $inputTwo.g) or fail "error in + there "; } #the meterLeng multi postfix:<(km)>( $input ) { return Length.new( Length => Length.baseOn("kilo",$input) ) or fai +l "you Must input a number"; } multi postfix:<(m)>( $input ) { return Length.new( Length => $input ) or fail "you Must input a nu +mber"; } multi infix:<+>( Length $inputOne , Length $inputTwo ) is assoc<right> + { return Length.new( Length => $inputOne.Length + $inputTwo.Length) +or fail "error in there "; } multi infix:<->( Length $inputOne , Length $inputTwo ) is assoc<right> + { return Length.new( Length => $inputOne.Length - $inputTwo.Length) +or fail "error in there "; } multi infix:<*>( Length $inputOne , Length $inputTwo ) is assoc<right> + is tighter( &infix:<+> ) is tighter( &infix:<-> ) is tighter( &infix +:</>) { return Length.new( Length => $inputOne.Length * $inputTwo.Length) +or fail "error in there "; } multi infix:</>( Length $inputOne , Length $inputTwo ) is assoc<right> + is tighter( &infix:<+> ) is tighter( &infix:<-> ) { return Length.new( Length => $inputOne.Length / $inputTwo.Length) +or fail "error in there "; } #just a test say 10(kg) + 1(g); say 10(m) + 1(m);
How best to write a cross-platform .xs module using x64 assembler?
2 direct replies — Read more / Contribute
by cnd
on Mar 28, 2017 at 04:18
    I wish to donate an intel chip-speed algorithm to perl users.

    It works exclusively on 64bit x64 compatible CPUs (mac, windows, linux at least).

    What would be the best way to make this available, and what build instructions (if any) do I need for those platforms so users can get and use my module ?

    Is anyone aware of any existing assembler .xs modules that work at least on linux, preferable also mac and maybe windows ?

    If anyone has suggestions for which assembler toolchains and debugging environments I should use for build pre-release testing - those would also be greatly received! Chris.

Q regex escape within variable
2 direct replies — Read more / Contribute
by palkia
on Mar 28, 2017 at 04:18
    Hello.

    I tried clustering some file names based on their prefix (those beginning with closers) while ignoring the specific numerical values within them.
    To achieve this, whenever a desired prefix pattern appeared, I subbed the numerical values with \d++ so it can be used later as a regex pattern,
    however since the prefix contains closers and possibly other special regex characters, I have sandwiched all non-\d++ parts with \Q and \E,
    but that raises the error Unrecognized escape \Q passed through in regex;
    I can't seem to figure what I am missing ?
    ... if($fName =~ /^([\[\(].+?[\]\)])/) { #pref detected. generalizing digits my $pref = '^\Q'.$1.'\E'; $pref =~ s/\d++/\\E\\d++\\Q/g; #finding indexes of matches to this prefix my @matchIndexes; for(my $mex=0;$mex<@fNames;$mex++) {if($fNames[$mex] =~ /$pref/i){push(@matchIndexes,$mex);}} ...
    Thank you very much for any assistance, and have an awesome day ☺

    Update: resolved by quotemeta(), thx to Eily.
Hash vs constant vs package vs other for data structure
6 direct replies — Read more / Contribute
by oldtechaa
on Mar 27, 2017 at 14:38

    I'm using an AoAoA currently for a data structure. An example of its use would be like this: $notes[$x][$y][0] = ... As you can see, the first two dimensions refer to the location of an object and the third refers to properties of that object such as flags and other data. My problem is that although the indices always refer to the same data member, it's not very readable or maintainable if you forget the index number for the data you want.

    A couple solutions I've thought of are below:

    • Use an AoAoH instead, and refer to each data member by name
    • Use constant declarations to name each index
    • Use upper-case variables to show their status as constant names for indices
    • Use a package with setter and getter functions or public data members and use an AoA with the package objects as the contents
    • Get other ideas from PM

    What do you think? I don't want to use any external CPAN distributions and I'd like the solution to not require too much boilerplate. Thanks for your time.

Filtering rows with Parse::CSV
3 direct replies — Read more / Contribute
by Anonymous Monk
on Mar 27, 2017 at 14:02
    Hello, and thanks in advance for your help.

    I'm attempting to get all rows from a CSV file where a specific column is not null. Unfortunately, I'm only getting 1 row back.

    For example, I'd like only rows 5, 7, and 9 to be printed.

    row 1-4 : myColumn is null
    row 5 : myColumn = 'ABC'
    row 6 : myColumn is null
    row 7 : myColumn = 'CDE'
    row 8 : myColumn is null
    row 9 : myColumn is 'EFG'

    My expected results are:
    ABC
    CDE
    EFG

    Instead, my results are:
    ABC

    Here's the code I am using:

    my $parser = Parse::CSV->new( file => $CSV_File, sep_char => ',', names => 1, filter => sub { $_->{myColumn} ? $_ : undef } ); while ( my $row = $parser->fetch ) { my $myColumn_value = $row->{'myColumn'}; print ("$myColumn_value"); }
Convert string to hash
2 direct replies — Read more / Contribute
by gabrielsousa
on Mar 27, 2017 at 13:18
    i have this code
    foreach my $value (values $jsonhash{results} ) { print Dumper $value; }
    the output
    $VAR1 = { 'subnet_id' => undef, 'sp_name' => undef, 'image_name' => undef, 'ptable_name' => undef, 'global_status_label' => 'OK', 'uuid' => undef, 'model_name' => 'VMware Virtual Platform', 'provision_method' => 'build', 'configuration_status' => 0, 'operatingsystem_id' => 12, 'capabilities' => [ 'build' ], 'id' => 265, 'mac' => '00:50:56:91:c2:c1', 'enabled' => bless( do{\(my $o = 1)}, 'JSON::backportPP::Boo +lean' ), 'image_file' => '', 'environment_name' => 'production', 'use_image' => undef, 'name' => 'adm003.siege.red', 'sp_mac' => undef, 'architecture_id' => 1, 'operatingsystem_name' => 'RedHat 7.2', 'medium_name' => undef, 'configuration_status_label' => 'No changes', 'updated_at' => '2017-03-27 17:14:42 UTC', 'compute_resource_id' => undef, 'installed_at' => undef, 'puppet_ca_proxy_id' => 1, 'realm_id' => undef, 'disk' => undef, 'ip' => '192.168.133.37', 'model_id' => 1, 'owner_type' => 'User', 'subnet_name' => undef, 'certname' => 'adm003.siege.red', 'hostgroup_id' => 45, 'created_at' => '2016-11-21 15:54:36 UTC', 'compute_profile_id' => undef, 'compute_resource_name' => undef, 'environment_id' => 1, 'global_status' => 0, 'image_id' => undef, 'domain_id' => 1, 'ptable_id' => undef, 'last_report' => '2017-03-27 17:14:29 UTC', 'sp_ip' => undef, 'architecture_name' => 'x86_64', 'sp_subnet_id' => undef, 'puppet_status' => 0, 'build' => bless( do{\(my $o = 0)}, 'JSON::backportPP::Boole +an' ), 'managed' => $VAR1->{'build'}, 'domain_name' => 'siege.red', 'medium_id' => undef, 'comment' => '', 'last_compile' => '2017-03-27 17:14:36 UTC', 'hostgroup_name' => 'base/barman', 'compute_profile_name' => undef, 'owner_id' => 8, 'puppet_proxy_id' => 1, 'realm_name' => undef };
    how i convert the $value to an hash ?
Redistributable Apache Web Server with Strawberry Perl - Practical?
3 direct replies — Read more / Contribute
by whiteperl051
on Mar 27, 2017 at 05:03
    I'm looking into creating a Windows Desktop App/server with Apache for Windows and Strawberry Perl.

    The way it would work is that I redistribute Apache with Strawberry Perl with my Perl scripts which are the app. When installing my App on a Windows PC it acts like a web server serving up web pages. My app will be working like a web site. I'm planning on creating a media server. Users install it on their PC's and media is served through a web browser to their PC's or other devices.

    If I understand the Apache license correctly then I can redistribute Apache in this manner? My application will be free.

    I've tried other solutions like Mojolicious but Apache + Strawberry Perl seems to be the most stable and practical solution. Can anybody see any major issues in going this route? (Apache + Strawberry Perl) I would hate to put in many hours on this just to find it is not practical.

Howto convert Image::Grab jpg object to Image::Magick object???
2 direct replies — Read more / Contribute
by dazz
on Mar 27, 2017 at 04:24
    Hello

    I have grabbed a jpg image from an IP camera with Image::Grab. So I have a valid image object.

    I want to pass the image to a subroutine. Within the subroutine, I want to use an Image::Magick method to do a read test on the image. </p)

    Back in the main code, I want to use the grabbed image object and annotate/composite using Image::Magick methods.

    So how do I pass a Image::Grab object to a sub-routine, then apply a read-only Image::Magick method to it? How do I take a Image::Grab object and apply a write Image::Magick method to it?

    The questions are similar but different. At present, I am achieving this by saving the Image::Grab jpg to hard drive, then reading it into a Image::Magick object. It is slow and inefficient.

    Dazz

Differnece between Spreadsheet::ParseXLSX and Spreadsheet::ParseExcel
3 direct replies — Read more / Contribute
by Sonali
on Mar 27, 2017 at 02:15

    Hello PerlMonks,

    I have been trying to parse a .xls and another .xlsx file using the Spreadsheet::ParseExcel and Spreadsheet::ParseXLSX modules

    When I dump the contents of both the files into two different files, the structure of the hash generated is very different, I wanted to know what exactly is the difference between the two parsers.

    My code goes like this,

    #!/usr/local/bin/perl use warnings; use strict; use Spreadsheet::XLSX; use Spreadsheet::ParseExcel; use Data::Dumper; my $Output_FileName = 'outfile.txt'; my $Output_FileName1 = 'outfile1.txt'; my $excel = Spreadsheet::XLSX -> new ('book1.xlsx'); my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse('book2.xls'); open(my $FH, '>', $Output_FileName) or die "Could not open file '$Outp +ut_FileName' $!"; print $FH Dumper(\$excel); close $FH; open(my $FH1, '>', $Output_FileName1) or die "Could not open file '$Ou +tput_FileName1' $!"; print $FH1 Dumper(\$excel); close $FH1;

    Is there a better way to dump both the files so that I can compare the two dumped files? In my case the files were mostly full of information like font etc...

    Thank you!

Joining elements of an array in a hash
5 direct replies — Read more / Contribute
by orangepeel1
on Mar 26, 2017 at 13:29
    I have a hash of arrays
    @array1 = ("one", "two", "three", "four", "five"); @array2 = ("banana", "pear", "apple"); my %hash = (numbers => \@array1, fruit => \@array2 );
    I would like to go through all the keys to the hash and join the elements of each array. I have tried something like this
    foreach my $group (keys %hash) { push @group, @{ $hash {$group}}; foreach (@group) { $statement = join ",", @group; } }
    However it does not join them. Does anyone have any suggestions for how I might go about this?
New Meditations
#p5p finds your lack of failing tests disturbing
2 direct replies — Read more / Contribute
by Corion
on Mar 27, 2017 at 13:42

    5.26 will come with a major change in how Perl builds and runs modules. The current directory will not be in @INC when running Perl programs.

    This affects all programs that call require or use and expect files relative to the current directory to be available. Besides plugin systems, any Makefile.PL using for example Module::Install is a likely offender. So far very little has been caught in the net of CPAN testers.

    As an example, one of my tests loads Makefile.PL:

    use lib '.'; use vars '%module'; require 'Makefile.PL'; # Loaded from Makefile.PL %module = get_module_info(); my $module = $module{NAME};

    This will fail under 5.26+ without the use lib '.'; statement at the top.

    I've altered @INC, pray I do not alter it further

    If you want to check whether your modules should still work and test OK under the upcoming 5.26 release, I think that the following oneliner should give you a good indication:

    perl -M-lib=. Makefile.PL && make && make test

    If you run author tests or prefer your tests to be run using prove, you have to take care of prove invoking a fresh Perl:

    # Windows syntax: set PERL5OPT=-M-lib=. perl Makefile.PL && dmake && prove -bl xt t
    @rem Shell syntax: export PERL5OPT=-M-lib=. perl Makefile.PL && make && prove -bl xt t

    Please test your distributions and release new versions if they need . in @INC. Thanks!

    Update: Added call to action and noted where use lib '.' helps.

OT: Got fired this week
13 direct replies — Read more / Contribute
by karlgoethebier
on Mar 23, 2017 at 05:43

    As i'm aged 60 + i guess i'll never get a new job. I think i need to face retirement. I first thought to delete my account on PM and through away all the code i ever wrote as well as my hand library and forget about everything related to programming. But it isn't so easy. I spent the last 20 years with this stuff. I'll stay a bit here - for fun. And perhaps i'll learn a new programming language ;-)

    Update: What should i say? I'm deeply moved. Thank you very much to all for encouragement and good advice.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    Furthermore I consider that Donald Trump must be impeached as soon as possible

New Cool Uses for Perl
Automatically ensure your CPAN dists have up-to-date prereq version numbers
No replies — Read more | Post response
by stevieb
on Mar 26, 2017 at 19:29

    So... one of my distribution relies heavily on other distributions I've written, and it's hard to ensure my dependencies for my own modules are up-to-date in the prerequisite list in the build system. Sometimes I forget to bump a prereq before I do a release, which means I have to immediately do a one-line release the next day, because I'll have emails from CPAN Testers because tests are failing.

    I've been toying with a few ways to automatically check this for me. Below is one such hack I came up with. There's two vars that need to be set: $dist and $author. It then pulls the distribution from the CPAN, extracts all of it's prerequisite dependency information. Then, it fetches the list of all distributions I've put on the CPAN, and creates a dist/version hash.

    Note that this compares *only* the prereqs that I personally have uploaded. It'd be trivial to modify a bit to check them all.

    After the data is collected, it iterates the known dependencies, and if there's a match with one of my own other distributions, I compare versions. Currently, it just prints out the list, but I'm going to hack this into my Test::BrewBuild system as another command line option so that every build run, I'll be notified of any discrepancies. Eventually, I'll likely make it auto-update the Makefile.PL files for me with the new dep versions, as well as have it review the prereq versions in the current repo of the dist I'm working on, instead of comparing to the latest CPAN release, so I can correct the issues *before* pushing to PAUSE :)

    use warnings; use strict; use MetaCPAN::Client; my $c = MetaCPAN::Client->new; my $dist = 'RPi-WiringPi'; my $author = 'STEVEB'; check_deps($dist, $author); sub check_deps { my ($dist, $author) = @_; if ($dist =~ /:/){ die "\$dist must be hyphenated... don't use ::\n"; } my $release = $c->release($dist); my $deps = $release->{data}{dependency}; my $author_modules = author_modules($author); for my $dep (@$deps){ my $dep_mod = $dep->{module}; my $dep_ver = $dep->{version}; if (exists $author_modules->{$dep_mod}){ my $cur_ver = $author_modules->{$dep_mod}; print "$dep_mod: \n" . "\tdep ver: $dep_ver\n" . "\tcur ver: $cur_ver\n\n"; } } } sub author_modules { my ($author) = @_; my $query = { all => [ { author => $author }, { status => 'latest' }, ], }; my $limit = { '_source' => [ qw(distribution version) ] }; my $releases = $c->release($query, $limit); my %rel_info; while (my $rel = $releases->next){ my $dist = $rel->distribution; $dist =~ s/-/::/g; $rel_info{$dist} = $rel->version; } return \%rel_info; }

    Output:

    perl perl/dependency_version_compare/compare.pl RPi::DigiPot::MCP4XXXX: dep ver: 2.3603 cur ver: 2.3603 RPi::BMP180: dep ver: 2.3603 cur ver: 2.3603 RPi::ADC::MCP3008: dep ver: 2.3603 cur ver: 2.3603 RPi::SPI: dep ver: 2.3606 cur ver: 2.3606 RPi::DAC::MCP4922: dep ver: 2.3604 cur ver: 2.3604 RPi::WiringPi::Constant: dep ver: 0.02 cur ver: 0.02 RPi::DHT11: dep ver: 1.02 cur ver: 1.02 WiringPi::API: dep ver: 2.3609 cur ver: 2.3609 RPi::ADC::ADS: dep ver: 1.01 cur ver: 1.01
oneliner: autorun script when I save it in the editor
2 direct replies — Read more / Contribute
by FreeBeerReekingMonk
on Mar 26, 2017 at 18:08
    Sometimes you get spoiled by IDE's that have F5 to save and run what you have scripted so far... so... what can you do if you have 2 xterms (one for vi, the other for the output)?

    perl -E 'while(-f $ARGV[0]){ $now=(stat(_))[9]; system($^X,@ARGV) if($ +now-$prev); $prev=$now; sleep 1}' /home/user/test.pl foo bar

    with test.pl having:

    #! env perl my $p1 = $ARGV[0]; my $p2 = $ARGV[1]; print "param1=$p1 param2=$p2\n";

    yields:

    param1=foo param2=bar

    Tested to work under Win10 and Linux

    Of course, there are better implementations. inotifywait or auditd if available on your system...

    any perl golfers?

    Update: we now incorporate the improvement made by haukex. Feel free to add more parameters if you need these

New Monk Discussion
Prohibit empty nodes
2 direct replies — Read more / Contribute
by hippo
on Mar 23, 2017 at 11:54

    It's a minor annoyance but hopefully an even more minor fix. I suggest that the site code be modified such that entirely empty nodes are automatically rejected. It's a particular time-and-resource waster in the case of anonymous posts as they serve absolutely no value - would anyone dispute this?

    There might conceivably be some argument for allowing empty non-anonymous posts (although what it might be escapes me) so that could be up for debate. If you think these are worth allowing then do please contribute to this thread.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[thezip]: What idiom should I use to determine that a directory is empty (for many directories)?
[thezip]: I suppose could check if readdir() returns other than '.' and '..', but that seems ugly.

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2017-03-28 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (339 votes). Check out past polls.