[28610] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9974 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 17 03:05:49 2006

Date: Fri, 17 Nov 2006 00:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 17 Nov 2006     Volume: 10 Number: 9974

Today's topics:
    Re: FAQ 7.21 What's the difference between calling a fu <justin.0611@purestblue.com>
    Re: How can I create instantiable objects (not classes) (reading news)
    Re: How to retain only unique elements? <tadmc@augustmail.com>
    Re: howto POST and leave site? <benmorrow@tiscali.co.uk>
    Re: howto POST and leave site? <botfood@yahoo.com>
    Re: howto POST and leave site? <kkeller-usenet@wombat.san-francisco.ca.us>
        new CPAN modules on Fri Nov 17 2006 (Randal Schwartz)
    Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good? <sigzero@gmail.com>
    Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good? <john@castleamber.com>
    Re: threads crash on XP (in Tk script) <brian.raven@osbsl.co.uk>
        what the difference between these loops? <spam.meplease@ntlworld.com>
    Re: what the difference between these loops? <john@castleamber.com>
    Re: what the difference between these loops? <someone@example.com>
    Re: what the difference between these loops? <betterdie@gmail.com>
    Re: Win32::GUI or Tk ? <rmay@popeslane.clara.co.uk>
    Re: Win32::GUI or Tk ? <rvtol+news@isolution.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 17 Nov 2006 00:10:46 +0000
From: Justin C <justin.0611@purestblue.com>
Subject: Re: FAQ 7.21 What's the difference between calling a function as &foo and foo()?
Message-Id: <justin.0611-549096.00104617112006@stigmata>

In article <slrnelndo8.idr.tadmc@tadmc30.august.net>,
 Tad McClellan <tadmc@augustmail.com> wrote:

> Justin C <justin.0611@purestblue.com> wrote:
> > In article <m9jr24-li2.ln1@blue.stonehenge.com>,
> >  PerlFAQ Server <brian@stonehenge.com> wrote:
> >
> >>  When you call a function as &foo, you allow that function access to your
> >>     current @_ values, and you bypass prototypes.
> >
> > I keep seeing this. What, in Perl, is a prototype? I've tried perldoc -q 
> > but not joy. Perldoc -f prototype doesn't help me. Where can I read 
> > about this?
> 
>    "Far More Than Everything You've Ever Wanted to Know about
>     Prototypes in Perl"
> 
>     http://library.n0i.net/programming/perl/articles/fm_prototypes/
> 
> 
> The short version is: prototypes in Perl are not what you are expecting
> if you've programmed in any other programming language.

My previous coding experience has been BASIC (on a spectrum), bash, and 
the first part of an "introduction to C programming" course (they 
wouldn't run the second part due to lack of interest)... so it's all new 
to me!

Thanks to all who have replied I've enough reading to waste most of 
tomorrow morning at work! ;)

-- 
Justin C, by the sea.


------------------------------

Date: Fri, 17 Nov 2006 03:38:49 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: How can I create instantiable objects (not classes)?
Message-Id: <d9a7h.8596$ig4.8047@newsread2.news.pas.earthlink.net>

On 11/16/2006 01:40 PM, Julien wrote:
> Hi,
> 
> I have a situation where I would like to "instantiate" an object.  Note
> that I really mean object (which is an instance of its class), not
> class.  Hence, a child object inherits not only its parent object's
> attributes (and the attribute values of the parent, which will be
> common to all child instances), but also gains additional attributes
> whose values may be different on a per-object-instance basis.  So we
> have per-instance data vs. object data, a bit analoguous to having
> per-object attributes versus class data (which is common to all objects
> of the class).
> 
> To do this, I've created a parent class called "Instantiable", which
> provides a constructor method "new_instance()".  When new_instance() is
> called on an Instantiable object, it creates a new object of the class
> "Instance".  This new Instance object has a reference to it's parent
> object (a weak reference, so that destruction of the parent does not
> depend on destruction its children).   The Instance class uses an
> AUTOMETHOD (like AUTOLOAD, see Class::Std) such that if an unknown
> method is called on an Instance, this is translated into a call using
> the parent object's reference on a method of the same name and
> arguments, but with an extra argument inserted to identify which object
> instance was initially called.  Finally, any sub-class of Instantiable
> is expected to provide an "instance_init" method, which is called by
> new_instance() when appropriate.  The instance_init method can be
> CUMULATIVE, so that you can instantiate a hierarchy of Instantiable
> objects with one call.  When implementing methods, there are now 3
> types of method calls i) a class method, ii) an object (class-instance)
> method and newly iii) an object-instance method.
> 
> The application is in a situation where you have a set of identical
> objects (e.g. they are all of class Dog), but need to maintain separate
> state information for each (e.g. sleeping, barking...), even though
> they also common attributes (e.g. hair colour).  Another example are
> logic gates or flip-flops where you might have 1000s of identical
> gates, but they are in a different state.  My particular application
> has to do with biochemical states of molecules.
> 
> If anyone is interested, I can post my code (it's not quite ready yet,
> in a few days...).  I would welcome comments and tips, I would like to
> know if something equivalent or better already exists.   I am not sure
> if I am using the correct or best vocabulary for "object-instance".  I
> am not sure which is the best place to keep the instance data, though
> currently I keep in the sub-class of Instantiable and that seems to
> work.  Finally, I would like to use attributes to designate certain
> class attributes as being instance attributes instead of object
> attributes (similar to ATTR designation in Class::Std).  Also, it might
> be reasonable to split instance_init into START_INSTANCE and
> BUILD_INSTANCE to follow the standard set build Class::Std.
> 
> I've already searched CPAN for something similar but nothing jumps out
> at me.
> 
> A quick and dirty synopsys:
> 
> # class InstantiableObject is a sub-class of Instantiable
> $object = InstantiableObject->new();
> # instance name is I0, InstantiableObject::instance_init(@args) is
> called by new_instance
> $object_instance = $object->new_instance("I0", @args);
> 
> $object->foo();                 # call an object (class instance)
> method
> $object_instance->bar()    # call an object-instance method (translated
> to $object->bar("I0") )
> 
> ##############
> package InstantiableObject; {
>   use base qw(Instantiable);
>   use Class::Std;
> 
>   # class methods
>   sub fee {
>      my $class = shift;
>       ....
>   }
> 
>   # instance methods
>   sub foo {
>       my $self = shift;
>       ....
>   }
> 
>   # object-instance method
>   sub bar {
>       my $self = shift;
>       my $instance = shift;   #
>     .....
>    }
> }
> 

It sounds like what you're trying to do is "delegation." Delegation 
occurs when the programmer decides to let one object send those messages 
that it can't understand to another object. For example, an object of 
type Car might receive a message named "ticket," and since a car does 
not know what to do with a ticket, it would pass that message 
(unmodified) to an object of type Driver.

(The meter-maid placed the ticket onto the car while the driver was away.)

Read up on delegation in object-oriented programming. FYI they do 
delegation in Smalltalk often.

This is an example of delegation:

#!/usr/bin/perl

use strict;
use warnings;
use Class::Struct;

struct Driver => [ Name => '$' ];
struct Car => [ PlateNo => '$', Driver => '$' ];

my @drivers = map Driver->new (Name => $_), qw(Mark Julie James);
my @cars;

push @cars, Car->init(PlateNo => 'TN11', Driver => $drivers[0]);
push @cars, Car->init(PlateNo => 'NQ79B', Driver => $drivers[1]);
push @cars, Car->init(PlateNo => 'R8XE', Driver => $drivers[2]);
push @cars, Car->init(PlateNo => 'ST43', Driver => $drivers[2]);

# Give each car a ticket and see where the messages end up.
$_->ticket() for (@cars);

exit;

####################### packages ####

package Car;
use Scalar::Util qw(weaken);
our $AUTOLOAD;

sub init {
     my $self = new(@_);
     weaken $self->[1];
     $self;
}

sub delegate {
     my $self = shift;
     my $method = undef;
     $method = $1 if (shift() =~ /(\w+)$/);

     die "No method" unless $method;
     return if 'DESTROY' eq $method;

     if ($self->Driver->can($method)) {
         $self->Driver->$method($self, @_);
     } else {
         die ("$self: Object does not understand $method.\n");
     }
}

sub AUTOLOAD {
     my $self = shift;
     $self->delegate($AUTOLOAD, @_);
}

package Driver;

sub ticket {
     my $self = shift;
     my $car = shift;
     print $self->Name, " is handling the ticket for ",
         $car->PlateNo, ".\n";
}

# This program is under the GPL (General Public License).



-- 
paduille.4060.mumia.w@earthlink.net




------------------------------

Date: Thu, 16 Nov 2006 18:16:26 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to retain only unique elements?
Message-Id: <slrnelpvqq.m28.tadmc@tadmc30.august.net>

Sagar S <sagar.s@in.bosch.com> wrote:

> I am a newbie to Perl and now I am stuck with a problem (which may seem
> simple to all the Perl Gurus out there ;-) )


Please see the Posting Guidelines that are posted here frequently.


> I am having a list like (XYZ_A(8::7), XYZ_B(4,15), XYZ_C(4,6), XYZ_A(8,9),
> XYZ_A(6,15), XYZ_B(8,10) ) for example.


That is not a Perl list.

Please post Real Perl Code.


> The problem is I have to retain only one element of each kind (XYZ_A, XYZ_B,
> XYZ_C etc) 


Since your problem does not seem to be how to get such a list in
Perl code, then you should have been able to post it in Perl code.


> such that for each kind, only those which have the lowest first
> number are retained. I mean, after processing, the list should be
> (XYZ_B(4,15), XYZ_C(4,6),  XYZ_A(6,15))


If they must be in that order, then the problem gets a good bit harder...


> I will really appreciate any help in this direction, 


Please indicate what you need help with, and what part you already
know how to do.

The best and easiest way to show the parts that you already know how
to do is to post the Perl code that does it.

Do we need to help you create the list?

Do we need to help you extract the 2 "interesting" parts from
each list item?

Do we need to help you track which one is the least for each "name"?

Do we need to help you with the print() statement for making the
final output?


You will be much more likely to get a little help rather than get
a lot of help.

A blanket "help me" makes the task of helping so large that many
or most potential answers will just move on to helping the next
poster instead. 

I just happen to have more time than usual today, or I would have
done that too.  :-)


> probably a code snippet
> or some hints atleast.


This is a much too intricate problem for an early Perl programmer
to tackle. You'll need to learn many different things before you'll
be able to do it.

Choose a simpler problem first, move to more complex problems after
you have at least a bit of experience.

The primare elements of solving your problem are to use a m// in
a list context to pluck out the 2 interesting parts, and a
multi-level hash to record each of the 3 parts.

Multi-dimensional data structures are not a "beginning" topic...


--------------------------------
#!/usr/bin/perl
use warnings;
use strict;

my @array = ( 'XYZ_A(8::7)', 
              'XYZ_B(4,15)', 
              'XYZ_C(4,6)', 
              'XYZ_A(8,9)',
              'XYZ_A(6,15)', 
              'XYZ_B(8,10)',
            );

my %least;  # keep track of the least number for each
foreach my $item ( @array ) {
   my($name, $num) = $item =~ /([^(]+)  # up 'til the 1st paren goes in $1
                               \(       # opening paren
                               (\d+)    # some digits go in $2
                              /x;

   if ( !exists $least{ $name } ) {        # 1st time we've seen this one
      $least{ $name }{ num }  = $num;
      $least{ $name }{ item } = $item;
      next;                                # done recording this one
   }

   if ( $num < $least{ $name }{ num } ) {  # need to update
      $least{ $name }{ num }  = $num;
      $least{ $name }{ item } = $item;
   }
}

print "$least{ $_ }{ item }\n" for sort keys %least;
--------------------------------


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 16 Nov 2006 19:01:23 +0000
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: howto POST and leave site?
Message-Id: <35pu24-f4g.ln1@osiris.mauzo.dyndns.org>


Quoth "botfood" <botfood@yahoo.com>:
> I have used LWP UserAgent a couple times before to POST to a third
> party site, and then parse what I needed out of the response... But
> what I want to do now is set up appropriate fields as if from a FORM,
> and POST them to an external URL, and turn the browser over to that
> site rather than returning the response to my script...

(I presume you are in a CGI context? It is necessary to state that,
here: many (most?) people using Perl are not using it for CGI.)

> How can this be done the simplest?

In simple terms: it can't be done. HTTP doesn't have a redirect-to-POST
operation. This has nothing to do with Perl.

You could read the response and pass it straight through to the client,
probably adding a <base> element if the response is HTML. This has
nothing to do with Perl.

You could serve the client a page containing some JavaScript that makes
the appropriate form submission. This has nothing to do with Perl.

Ben

-- 
   Although few may originate a policy, we are all able to judge it.
                                               Pericles of Athens, c.430 B.C.
  benmorrow@tiscali.co.uk


------------------------------

Date: 16 Nov 2006 19:29:05 -0800
From: "botfood" <botfood@yahoo.com>
Subject: Re: howto POST and leave site?
Message-Id: <1163734145.291615.10440@k70g2000cwa.googlegroups.com>

> You could read the response and pass it straight through to the client,
> probably adding a <base> element if the response is HTML.
---------

thanks for the good idea, the rightous repitition of 'nothing to do
with perl' I could do without. Use of the LWP is for sure perl, an
example of then making a sub in the $content string to add the
appropriate <base> tag text is a nice perl thing to do, and might solve
the issue I was seeing with broken relative links on the response html.

Seems that the perl newsgroup is the same as ever, brilliant, but with
an aweful lot of attitude. You must admit, the perl/cgi lines are
sometimes indistinct, and to choose the right tool in perl, you need to
know what it is used for.

anyway thank you for the idea.

> here: many (most?) people using Perl are not using it for CGI.)
-----
 ...I wonder. That really is ALL I use perl for; not being a sys admin,

d



------------------------------

Date: Thu, 16 Nov 2006 23:11:50 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: howto POST and leave site?
Message-Id: <3u3034xq4u.ln2@goaway.wombat.san-francisco.ca.us>

In article <1163734145.291615.10440@k70g2000cwa.googlegroups.com>, botfood wrote:

[> Ben Morrow wrote: (please don't snip attributions!)]

>> here: many (most?) people using Perl are not using it for CGI.)
> -----
> ...I wonder. That really is ALL I use perl for; not being a sys admin,

I use Perl in a CGI context, in a sysadmin context, in an
HTTP client context, in a database client context, in an
SMTP client context, and in many other contexts not related
to either CGI or sysadmin.  Just because you don't doesn't
mean others don't.  So yes, mentioning context *is* important.

--keith

-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



------------------------------

Date: Fri, 17 Nov 2006 05:42:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Nov 17 2006
Message-Id: <J8v16C.159J@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

AI-PSO-0.85
http://search.cpan.org/~kylesch/AI-PSO-0.85/
Perl module for running the Particle Swarm Optimization algorithm
----
Alzabo-0.8903
http://search.cpan.org/~drolsky/Alzabo-0.8903/
A data modelling tool and RDBMS-OO mapper
----
App-Cmd-0.008
http://search.cpan.org/~rjbs/App-Cmd-0.008/
write command line apps with less suffering
----
Bio-Trace-ABIF-0.02
http://search.cpan.org/~vita/Bio-Trace-ABIF-0.02/
Perl extension for reading and parsing ABIF (Applied Biosystems, Inc. Format) files
----
Catalyst-Plugin-Authentication-Credential-BBAuth-0.01
http://search.cpan.org/~jiro/Catalyst-Plugin-Authentication-Credential-BBAuth-0.01/
Yahoo! Browser-Based Authentication for Catalyst.
----
Class-XML-Parser-0.9
http://search.cpan.org/~mmorgan/Class-XML-Parser-0.9/
Parses (and optionally validates against a DTD) an XML message into a user-defined class structure.
----
DBIx-Class-0.07003
http://search.cpan.org/~bricas/DBIx-Class-0.07003/
Extensible and flexible object <-> relational mapper.
----
DBIx-Class-Loader-ADO-0.05
http://search.cpan.org/~bricas/DBIx-Class-Loader-ADO-0.05/
DBIx::Class::Loader ADO Implementation.
----
Data-UUID-0.147_01
http://search.cpan.org/~rjbs/Data-UUID-0.147_01/
Perl extension for generating Globally/Universally Unique Identifiers (GUIDs/UUIDs).
----
Data-UUID-0.148
http://search.cpan.org/~rjbs/Data-UUID-0.148/
Perl extension for generating Globally/Universally Unique Identifiers (GUIDs/UUIDs).
----
DateTime-Calendar-WarwickUniversity-0.01
http://search.cpan.org/~diocles/DateTime-Calendar-WarwickUniversity-0.01/
Warwick University academic calendar
----
DateTime-Event-WarwickUniversity-0.01
http://search.cpan.org/~diocles/DateTime-Event-WarwickUniversity-0.01/
Warwick University academic calendar events
----
DateTime-TimeZone-0.56
http://search.cpan.org/~drolsky/DateTime-TimeZone-0.56/
Time zone object base class and factory
----
Encode-Arabic-1.4
http://search.cpan.org/~smrz/Encode-Arabic-1.4/
Encodings of Arabic
----
Encode-Mapper-1.4
http://search.cpan.org/~smrz/Encode-Mapper-1.4/
Intuitive, yet efficient construction of mappings for Encode
----
Finance-Bank-CreditMut-0.09
http://search.cpan.org/~cbouvi/Finance-Bank-CreditMut-0.09/
Check your Cr?dit Mutuel accounts from Perl
----
Getopt-Long-2.35_02
http://search.cpan.org/~jv/Getopt-Long-2.35_02/
Extended processing of command line options
----
HTML2XHTML-0.03.02
http://search.cpan.org/~oembry/HTML2XHTML-0.03.02/
Wrapper to command-line program that converts from HTML 3.x/4.x to XHTML 1.0
----
HTTP-Server-Simple-0.24
http://search.cpan.org/~jesse/HTTP-Server-Simple-0.24/
Lightweight HTTP server
----
IO-Socket-ByteCounter-v0.0.1
http://search.cpan.org/~dmuey/IO-Socket-ByteCounter-v0.0.1/
Perl extension to track the byte sizes of data in and out of a socket
----
IPC-PerlSSH-0.04
http://search.cpan.org/~pevans/IPC-PerlSSH-0.04/
a class for executing remote perl code over an SSH link
----
Language-Indonesia-0.01
http://search.cpan.org/~dns/Language-Indonesia-0.01/
Write Perl program in Bahasa Indonesia.
----
MIME-Charset-0.043
http://search.cpan.org/~nezumi/MIME-Charset-0.043/
MIME ??????????????
----
MIME-EncWords-0.040
http://search.cpan.org/~nezumi/MIME-EncWords-0.040/
deal with RFC-1522 encoded words (improved)
----
MPEG-ID3v2Tag-0.37
http://search.cpan.org/~cbtilden/MPEG-ID3v2Tag-0.37/
Parses and creates ID3v2 Tags for MPEG audio files.
----
Net-CIDR-MobileJP-0.04
http://search.cpan.org/~tokuhirom/Net-CIDR-MobileJP-0.04/
mobile ip address in Japan
----
PDL-NetCDF-0.92
http://search.cpan.org/~dhunt/PDL-NetCDF-0.92/
Object-oriented interface between NetCDF files and PDL objects.
----
POE-Component-Daemon-0.1003
http://search.cpan.org/~gwyn/POE-Component-Daemon-0.1003/
Handles all the housework for a daemon.
----
POE-Component-DirWatch-Object-0.07
http://search.cpan.org/~groditi/POE-Component-DirWatch-Object-0.07/
POE directory watcher object
----
POE-Component-IKC-0.1903
http://search.cpan.org/~gwyn/POE-Component-IKC-0.1903/
POE Inter-Kernel Communication
----
POE-Component-IKC-0.1904
http://search.cpan.org/~gwyn/POE-Component-IKC-0.1904/
POE Inter-Kernel Communication
----
POE-Component-IRC-5.12
http://search.cpan.org/~bingos/POE-Component-IRC-5.12/
a fully event-driven IRC client module.
----
POE-Component-Server-IRC-1.04
http://search.cpan.org/~bingos/POE-Component-Server-IRC-1.04/
a fully event-driven networkable IRC server daemon module.
----
PadWalker-1.2
http://search.cpan.org/~robin/PadWalker-1.2/
play with other peoples' lexical variables
----
PerlIO-nline-0.04
http://search.cpan.org/~bmorrow/PerlIO-nline-0.04/
Perl extension for newline translation
----
Querylet-0.323
http://search.cpan.org/~rjbs/Querylet-0.323/
simplified queries for the non-programmer
----
Querylet-CGI-0.142
http://search.cpan.org/~rjbs/Querylet-CGI-0.142/
turn a querylet into a web application
----
Querylet-Output-Excel-OLE-0.142
http://search.cpan.org/~rjbs/Querylet-Output-Excel-OLE-0.142/
output query results to Excel via OLE
----
Querylet-Output-Text-0.112
http://search.cpan.org/~rjbs/Querylet-Output-Text-0.112/
output querylet results to text tables
----
Sledge-Engine-0.02
http://search.cpan.org/~ikebe/Sledge-Engine-0.02/
run Sledge based application (EXPERIMENTAL).
----
Sledge-Engine-0.03
http://search.cpan.org/~ikebe/Sledge-Engine-0.03/
run Sledge based application (EXPERIMENTAL).
----
Tk-Clock-0.17
http://search.cpan.org/~hmbrand/Tk-Clock-0.17/
Clock widget with analog and digital display
----
WWW-Domain-Registry-VeriSign-0.01
http://search.cpan.org/~masahito/WWW-Domain-Registry-VeriSign-0.01/
VeriSign NDS (https://www.verisign-grs.com/) Registrar Tool
----
WebService-MusicBrainz-0.04
http://search.cpan.org/~bfaist/WebService-MusicBrainz-0.04/
----
threads-1.51
http://search.cpan.org/~jdhedden/threads-1.51/
Perl interpreter-based threads


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: 16 Nov 2006 17:19:37 -0800
From: "Robert Hicks" <sigzero@gmail.com>
Subject: Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good?
Message-Id: <1163726377.560204.14270@h48g2000cwc.googlegroups.com>


John Bokma wrote:
> merlyn@stonehenge.com (Randal L. Schwartz) wrote:
>
> >>>>>> "Richard" == Richard Williams <rdwillia@anon.example.net> writes:
> >
> > Richard> Just noticed on the O'Reilly site that the 2004 4th edition
> > of the Richard> 'Perl CD Bookshelf' is out of print (as are all the
> > other Bookshelf Richard> titles), and cdbookshelves.oreilly.com is
> > gone. I guess that means Richard> it's just Safari or dead trees from
> > now on, which seems rather a pity Richard> - the Perl CD has been my
> > main 3rd party reference since version 1, Richard> and there are
> > several obvious new candidate books for a 5th Richard> edition. Just
> > wondering if any of the O'Reilly authors here happen to Richard> know
> > if (or why) this is indeed the end of the line?
> >
> > From what I heard, piracy killed them.  It's too easy to put the
> > entire books online from the CD.
>
> Almost every O'Reilly book is either available in CHM or PDF format,
> pirated. One can download 4-9 GB of books using bittorrent in the blink
> of an eye. I am quite sure that some books are leaked when send to the
> printing departement, or even before.
>
> So it sounds to me like a non-argument.
>
> > Safari has a lot of anti-scraping
> > technology in it to prevent that, so it's safari from now on, not CDs.
> >
> > Stupid Pirates.  Ruining it for all of us.
>
> Maybe a better distribution method should be thought up? It's like
> saying that the stupid bookpress took away work from the monks. Mind, I
> am not saying that authors shouldn't be paid for their work. But if one
> can download 500 books in a few hours that's a huge temptation. Again, I
> am not saying that piracy is right.
>
> I would love to buy DRM free books online in either chm or pdf format
> and pay with paypal hassle free. And yes, the keyword here is often
> hassle free. I recently bought a PDA, and checked out some ebook sites.
> I am not going to install Adobe PDF again on my Pocket PC. It's a joke
> compared to xpdf. But I am afraid xpdf is not going to handle all those
> fancy anti-piracy measurements. It's beyond me why people keep investing
> money in stuff like that, when people who want to have it rights free
> already have it, often before the site makes it public available.
>
> Also, like the book press made it possible to have your own book printed
> instead of hiring 20 monks, or a digital camera made it possible to make
> portraits of your family members instead of hiring a painter, authors
> should consider going with the flow. The only other options are pulling
> your hairs out or start doing something else.
>
> I have published a little on my own site, yet the income from
> advertisements is more then sufficient to pay the rent.
>
> Finally, "all of us": who's us? There are people who can't afford to pay
> 60 USD for a book (I guess that's what the local price is here for a 45
> USD book). You might not consider it fair, but is it fair to get paid 8
> times less, and sucked dry by luxery that costs 50-120% more? (Talking
> in general about the situation in Mexico).
>

The benefit to me is that everyone one of the books was keyword
searchable. That is a wonderful resource to me and now it is gone.
Safari...too expensive for my tastes even for the 10 bookshelf one.

I don't think they really lost any "sales" by those CD's going online.

Robert



------------------------------

Date: 17 Nov 2006 05:00:03 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good?
Message-Id: <Xns987DE9F9A43E5castleamber@130.133.1.4>

"Robert Hicks" <sigzero@gmail.com> wrote:


> I don't think they really lost any "sales" by those CD's going online.

Same here. If O'Reilly is losing sales it's because there is so much 
available online. I mean, I bought in the past an O'Reilly for a chapter, 
even a page. Now I can find the same information in several tutorials 
online. Times have changed, and it's easy to blame it on all those bad 
guys. Probably most people having 20 GB of books haven't read most of 
them, if at all. Just pack rats.

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


------------------------------

Date: Thu, 16 Nov 2006 23:10:46 +0000
From: Brian Raven <brian.raven@osbsl.co.uk>
Subject: Re: threads crash on XP (in Tk script)
Message-Id: <u00zj8cp.fsf@osbsl.co.uk>

"MoshiachNow" <lev.weissman@creo.com> writes:

> HI,
>
> Running a Tk script on my XP I always get an error.
>
> Code:
> ########################################################################################
> #use warnings;
> use strict;
> use Win32::OLE qw( in );
> use Win32::Lanman;
> use Net::Domain qw(hostname hostfqdn hostdomain);
> use Socket 'inet_ntoa';
> use Sys::Hostname 'hostname';
> use Data::Validate::IP qw(is_ipv4);
> use Net::Ping;
> use Tk;
> use Tk::Text;
> use Tk::Scrollbar;
> use Tk::Pane;
> use threads;
>
> threads->create(sub { print("I am a thread\n"); })->join();
>
> Error:
> I am a thread
> Free to wrong pool 1822b00 not 222770 during global destruction.
>
> Any ideas?

One idea would be that threads, and modules that are not thread safe
do not mix very well. I don't know about any of the other modules that
you use, but Tk is not thread safe.

HTH

-- 
Brian Raven


------------------------------

Date: 16 Nov 2006 15:23:53 -0800
From: "doolittle" <spam.meplease@ntlworld.com>
Subject: what the difference between these loops?
Message-Id: <1163719433.840710.114560@m7g2000cwm.googlegroups.com>

My code was not working in an expected way, so i replaced the line

while ((my $key, my $value) = each %boardhash) {
 ...
}

with the lines

for (keys(%boardhash)){
   my $value = $boardhash{$_};
 ...
}

and it worked differently (more better).



------------------------------

Date: 17 Nov 2006 00:03:59 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: what the difference between these loops?
Message-Id: <Xns987DB7C765668castleamber@130.133.1.4>

"doolittle" <spam.meplease@ntlworld.com> wrote:

> My code was not working in an expected way, so i replaced the line
> 
> while ((my $key, my $value) = each %boardhash) {
> ...
> }
> 
> with the lines
> 
> for (keys(%boardhash)){
>    my $value = $boardhash{$_};
> ...
> }
> 
> and it worked differently (more better).

In what way?


perldoc -f each
perldoc -f keys

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


------------------------------

Date: Fri, 17 Nov 2006 00:31:57 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: what the difference between these loops?
Message-Id: <1q77h.6516$b07.6404@clgrps13>

doolittle wrote:
> My code was not working in an expected way, so i replaced the line
> 
> while ((my $key, my $value) = each %boardhash) {
> ...
> }
> 
> with the lines
> 
> for (keys(%boardhash)){
>    my $value = $boardhash{$_};
> ...
> }
> 
> and it worked differently (more better).

They of course do work differently (as documented.)  As to why one is better
than the other depends on the rest of your code.


John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


------------------------------

Date: 16 Nov 2006 21:28:32 -0800
From: "paul" <betterdie@gmail.com>
Subject: Re: what the difference between these loops?
Message-Id: <1163741312.076991.186010@j44g2000cwa.googlegroups.com>

while ( my ($key, $value) = each %boardhash)

use grep if you filter data from the list...

my @datastore = grep { /filtersomething/ } values (%boardhash);

Paul :)

John W. Krahn wrote:
> doolittle wrote:
> > My code was not working in an expected way, so i replaced the line
> >
> > while ((my $key, my $value) = each %boardhash) {
> > ...
> > }
> >
> > with the lines
> >
> > for (keys(%boardhash)){
> >    my $value = $boardhash{$_};
> > ...
> > }
> >
> > and it worked differently (more better).
>
> They of course do work differently (as documented.)  As to why one is better
> than the other depends on the rest of your code.
>
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you can special-order
> certain sorts of tools at low cost and in short order.       -- Larry Wall



------------------------------

Date: Fri, 17 Nov 2006 00:06:12 +0000
From: Robert May <rmay@popeslane.clara.co.uk>
Subject: Re: Win32::GUI or Tk ?
Message-Id: <OMqdnRn_QolkYcHYnZ2dnUVZ8t-dnZ2d@pipex.net>

Ted Zlatanov wrote:
> On 16 Nov 2006, rvtol+news@isolution.nl wrote:
>> MoshiachNow schreef:
>>> What is more popular/preferable/recommended for GUI in Perl:
>>> Win32::GUI or Tk ?
 >>
>> Or wxPerl?
> 
> All three have benefits.  Don't forget HTML GUIs too (though limited,
> they can do a lot, and you don't have to write a dedicated client).
> The questions are:
> 
> - what platforms will you use?
> - what do you need to do?
> - are you familiar with Win32 or Tk or wx?

That's a pretty good summary of the questions you need to ask yourself. 
  Answer them and we'll try to provide some advice.  (I'm biased to 
Win32::GUI myself, but I'll try to be objective).

Regards,
Rob.

-- 
Robert May
Win32::GUI, a perl extension for native Win32 applications
http://perl-win32-gui.sourceforge.net/


------------------------------

Date: Fri, 17 Nov 2006 01:57:55 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Win32::GUI or Tk ?
Message-Id: <ejj556.1co.1@news.isolution.nl>

Ted Zlatanov schreef:
> rvtol+news:
>> MoshiachNow:

>>> What is more popular/preferable/recommended for GUI in Perl:
>>> Win32::GUI or Tk ?
>> 
>> Or wxPerl?
> 
> All three have benefits.  Don't forget HTML GUIs too (though limited,
> they can do a lot, and you don't have to write a dedicated client).

And XUL:
http://search.cpan.org/search?q=XUL 

-- 
Affijn, Ruud

"Gewoon is een tijger."


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9974
***************************************


home help back first fref pref prev next nref lref last post