lib::http - Using virtually a Perl library from the Internet with the HTTP protocol.

2005-02-20 Thread Graciliano M. P.
Felow PM Authors,

Recently I was developing a new module, called lib::http, where is possible
to use a Perl library installed in other server over the internet. Also with
this release is distributed a modified Perl interpreter, actually a modified
TinyPerl, that doesn't have any lib, but with it is possible to use a full
perl installation over the internet.

The main idea is to use Perl without need to install anything, and to have a
central point to load modules, where is possible to update a full grid of
servers changing only a single place. So, we can update all the services
writed in Perl that works in our grid changing a single Perl installation,
what is much more faster, and as a plus we can hide some modules, since we
can tell to load this modules only in the memory, without need to store them
fisically in the server.

lib::http was created only in the last week and still need tests, of course,
but it's working very well, and already have support for gzip compression,
index of a perl library in the server side, and works in any simple HTTP
server.

You can find it at:
http://search.cpan.org/~gmpassos/lib-http-0.01/lib/lib/http.pm

Enjoy! ;-P

Regards,
Graciliano M. P.




-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.1.0 - Release Date: 18/2/2005



Re: Including a 480K data file with a module

2005-01-05 Thread Graciliano M. P.
You should compress the data and than append it with __DATA__ or as a string
saved with Base64 to avoid binary errors.

Here's a simple sample:

  use Compress::Zlib qw(compress uncompress) ;
  use MIME::Base64 qw(encode_base64 decode_base64) ;

  my $uncompressed = 'some sample data' ;

  my $base64 = encode_base64( compress($uncompressed) ) ;

  print $base64\n ;

  my $original = uncompress( decode_base64($base64) ) ;

  print $original\n ;

Regards,
Graciliano M. P.

- Original Message -
From: Scott W Gifford [EMAIL PROTECTED]
To: module-authors@perl.org
Sent: Wednesday, January 05, 2005 12:48 AM
Subject: [Spam] Including a 480K data file with a module


 Hello,

 I'm working with T.J. Mather on updating Geo::PostalCode.  One of the
 things we're looking at is how to manage the ZIP code database that's
 necessary for its operation.  I've proposed creating a
 Geo::PostalCode::US module as a very simple subclass of
 Geo::PostalCode, and bundling the ZIP code data with that module.  The
 data is 1.3MB uncompressed, and compressed the entire module is about
 480K.  We have some concerns this may be frowned on, however, so I
 thought I'd get some feedback here.

 The advantages of having the data on CPAN is that the entire module is
 self-sufficient and widely mirrored.  It makes it much easier to
 install, and if you have a CPAN distribution on CD or in a local
 mirror, you have everything you need.  The disadvantage is that it
 takes up 480K on every single CPAN mirror.

 Are there other modules that do this?  Is there a consensus on what's
 appropriate?  And what are the list members opinions on the matter?

 Thanks!

 -ScottG.

 E-mail classificado pelo Identificador de Spam Inteligente Terra.
 Para alterar a categoria classificada, visite

http://www.terra.com.br/centralunificada/emailprotegido/imail/imail.cgi?+_u=
gmpowers_l=1,1104896949.850686.30145.lusaca.terra.com.br,2642,2003112711410
1,20031127114101

 Esta mensagem foi verificada pelo E-mail Protegido Terra.
 Scan engine: McAfee VirusScan / Atualizado em 29/12/2004 / Versão:
4.4.00 - Dat 4417
 Proteja o seu e-mail Terra: http://www.emailprotegido.terra.com.br/



 --
 No virus found in this incoming message.
 Checked by AVG Anti-Virus.
 Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 3/1/2005





-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 3/1/2005



CPAN Testers and PREREQ_PM doesn't work very well!!!!!!

2004-12-21 Thread Graciliano M. P.
Hello,

Is not the 1st time that I receive a FAIL report from CPAN telling that is
not possible to find module X at @INC, saying to add the PREREQ_PM at
MakeFile.PL.

Well, I always put the PREREQ_PM at MakeFile.PL. So, some testers are
ignoring this informations in the MakeFile and producing error reports!

I want to know if this is only with me or happens for other authors.

For me this is a big problem, 1 because we have a wrong report at CPAN
downgrading our modules, 2nd because we waste time with a bug that doesn''t
exists, 3d we start to lose credibility in a tool of CPAN that is very
important, the bug and test mechanism.

So, please, let's fix that or at least find why it happens.

Regards,
Graciliano M. P.

Just to have the full informations. Here's the error reported:

PERL_DL_NONLAZY=1 /home/nothingmuch/perlsmoke/build/5.6.2/bin/perl
-Iblib/lib -Iblib/arch test.pl
1..1
# Running under perl version 5.006002 for linux
# Current time local: Tue Dec 21 23:56:20 2004
# Current time GMT:   Tue Dec 21 21:56:20 2004
# Using Test.pm version 1.25
Can't locate Object/MultiType.pm in @INC (@INC contains: blib/lib blib/arch
/home/.perlsmoke/5006002/.cpanplus/5.6.2/build/Scalar-MultiValue-0.03/blib/l
ib
/home/.perlsmoke/5006002/.cpanplus/5.6.2/build/Scalar-MultiValue-0.03/blib/a
rch /home/nothingmuch/perlsmoke/build/5.6.2/lib/5.6.2/i686-linux
/home/nothingmuch/perlsmoke/build/5.6.2/lib/5.6.2
/home/nothingmuch/perlsmoke/build/5.6.2/lib/site_perl/5.6.2/i686-linux
/home/nothingmuch/perlsmoke/build/5.6.2/lib/site_perl/5.6.2
/home/nothingmuch/perlsmoke/build/5.6.2/lib/site_perl .) at
blib/lib/Scalar/MultiValue.pm line 30.
BEGIN failed--compilation aborted at blib/lib/Scalar/MultiValue.pm line 30.
Compilation failed in require at test.pl line 8.
BEGIN failed--compilation aborted at test.pl line 8.
make: *** [test_dynamic] Error 2


And here's my MakeFile.PL for this module:


use ExtUtils::MakeMaker;

WriteMakefile(
'NAME'  = 'Scalar::MultiValue' ,
'VERSION_FROM'  = 'lib/Scalar/MultiValue.pm' ,
'PREREQ_PM' = {'Object::MultiType'  = 0.04} ,
($] = 5.005 ?
  ( ABSTRACT_FROM = 'lib/Scalar/MultiValue.pm',
AUTHOR= 'Graciliano M. P. [EMAIL PROTECTED]'
   ) : ()
 ),
);




-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.5.0 - Release Date: 9/12/2004



PLDelphi - Perl embeded into your Delphi applications.

2004-10-03 Thread Graciliano M. P.
I have just released PLDelphi, that will embed Perl into your Delphi
applications and will
enable the use of Perl objects and evaluations directly from Delhpi.

Also you will be able to count with the Perl REGEXP resources and CPAN
components.

You can download it at:
http://search.cpan.org/~gmpassos/PLDelphi-0.01/

PLDelphi is based in a previous work, PLJava, and both have similar
intefaces:
http://search.cpan.org/~gmpassos/PLJava-0.04/

Enjoy. ;-P
Graciliano M. P.




[ANNOUNCE - HDB 1.0] Hybrid Database - Handles multiple databases with the same interface.

2004-09-13 Thread Graciliano M. P.
This is the 1st release of HDB (Hybrid Database) at CPAN:
http://search.cpan.org/~gmpassos/HDB-1.0/

=head1 NAME

HDB - Hybrid Database - Handles multiple databases with the same interface.

=head1 DESCRIPTION

HDB is an easy, fast and powerfull way to access any type of database. With
it you don't need to know SQL, DBI, or the type of the database that you are
using.
HDB will make all the work around between the differences of any database.
From HDB you still can use DBI and SQL commands if needed, but this won't be
portable between database types.
If you use only HDB querys (not DBI) you can change the database that you
are using, Server and OS without change your code! For example, you can
test/develope your code in your desktop (let's say Win32) with SQLite, and
send your code to the Server (Linux), where you use MySQL.

=head1 USAGE

  use HDB ;

  my $HDB = HDB-new(
  type = 'sqlite' ,
  file = 'test.db' ,
  ) ;

  ... or ...

  my $HDB = HDB-new(
  type = 'mysql' ,
  host = 'some.domain.com' ,
  user = 'foo' ,
  pass = 'bar' ,
  ) ;

  $HDB-create('users',[
  'user' = 100 ,
  'name' = 100 ,
  'age' = 'int(200)' ,
  'more' = 1024*4 ,
  ]);

  $HDB-insert( 'users' , {
  user = 'joe' ,
  name = 'joe tribianny' ,
  age  = '30' ,
  } ) ;

  ... or ...

  $HDB-users-insert( {
  user = 'joe' ,
  name = 'joe tribianny' ,
  age  = '30' ,
  } ) ;


  ...

  my @sel = $HDB-select('users' , 'name =~ joe' , '@%' ) ;

  foreach my $sel_i ( @sel ) {
my %cols = %$sel_i ;
...
  }

  ...

  my $hdbhandle = $HDB-select('users' , '%');

  while( my %cols = $hdbhandle ) {
foreach my $Key ( keys %cols ) { print $Key = $cols{$Key}\n ;}
...
  }

  ...

  $HDB-update('users' , 'user eq joe' , { user = 'JoeT' } ) ;

  ...

  $HDB-disconnect ;





PLJava - Perl embeded into Java (calling Perl from Java) - 1sr release - call for tests and review, please.

2004-07-13 Thread Graciliano M. P.
Recently on perlmonks.com I have posted a prototype of Perl embeded into
Java (#372197=Embeding Perl into Java to use CPAN modules directly from
Java), as a simplier alternative for JPL (not any more in development). One
advantage over JPL is that PLJava works on Win32.

Now I have finished the basic wrappers to work with Perl from Java,
specially to control and use Perl objecs directly from Java. Also I have
added support for multiple Java Native Threads calling the same Perl
interpreter, so, is possible to use PLJava with Java RMI, since for each RMI
application you have a Thread that is not the main.

Also I have wrapped the basics of the module XML::Smart to Java as class
XMLSmart.

Note that PLJava was made to be installed into Java, or to be with your Java
applications, and not to be installed on Perl. So, you can publish your Java
application using Perl without need to ask for the user to install Perl to
run it.

The 1st release is at:
http://www.cpan.org/authors/id/G/GM/GMPASSOS/PLJava-0.01.tar.gz
http://www.cpan.org/authors/id/G/GM/GMPASSOS/PLJava-0.01.readme

I have tested it on Win32, and need some test over Linux yet, but it should
work, at least with small changes.

I will appreciate any type of feedback. Thanks in advance. ;-P

Regards,
Graciliano M. P.

USAGE

  import perl5.Perl ;
  import perl5.SV ;

  public class test {

public static void main(String argv[]) {

   Perl.eval(print qq`Hello World!\n` ;) ;

   ///

   SV foo = Perl.NEW(foo) ; // $foo = new foo() ;

   foo.call(subtest) ;  // $foo-subtest() ;

   ///

   String s = Perl.eval( 'time: ' + time() ) ;

   int i = Perl.eval_int( 2**10 ) ; // 1024

   int n = Perl.eval_int( 10/3 ) ; // 3
   int d = Perl.eval_double( 10/3 ) ; // 3.33

   ///

   SV array = Perl.eval_sv(  [ 'a' , 'b' , 'c' ]  ) ;

   String e0 = array.elem(0) ; // a
   String e1 = array.elem(1) ; // b
   String e2 = array.elem(2) ; // c

   ///

   SV hash = Perl.eval_sv(  { a = 11 , b = 22 , c = 33 }  ) ;

   String k_a = hash.key(a) ; // 11
   String k_b = hash.key(b) ; // 22
   String k_c = hash.key(c) ; // 33

 }

  }





LibZip - Create very low weight self executables. (This is the generator of TinyPerl).

2004-06-11 Thread Graciliano M. P.
I have just released LibZip 0.02 (first version on CPAN).

The main idea of this module is to create the smaller Perl distribution as
possible, having all the Perl enverioment compressed, including the
distribution of scripts in a small package. One good example is TinyPerl
(http://tinyperl.sf.net), that have Perl CORE and a basic library in less
than 600Kb, what make possible to install Perl fast in any computer
connected to the internet.

With LibZip a hello World script turned on a executable will have only 357Kb
(Win32), And the new version of TinyPerl will have 550Kb.

I'm sending this e-mail asking for some tests and feedback before use it to
create and release the new version of TinyPerl.

Thanks in advance! ;-P

Take a look in the directory ./tinyperl inside the distribution as example.

Regards,
Graciliano M. P.



PerlHack - Adding new flag into a SV

2004-04-23 Thread Graciliano M. P.
Hello,

I'm working on a module that need to add a new flag to a SV that is stored
by it. Actually I just need to find a way to mark that SV by this module,
so, will be possible to identify this SVs from the others.

*Why use a flag?

Because if I just use the number of a SV and its type, I can't guarantee
that is the same SV that I have stored, since Perl can reuse that SV after
clean it. If I just use the type and the number is possible that until the
next access to this SV, that SV was actually destroied, than a new SV can be
created with the same type and number. So, adding a flag I can guarantee
that it wasn't cleanned until that, since when a SV is cleanned its flag is
reseted.

I need to know if someone already done something like that, and if you, all
the developers that hack Perl internals, think that this is the best way to
do that, and if it is, if this is a secure thing to do.

Also I need to know if exits some reserved range for external flags defined
in Perl, since I can't use a number for the flag that is in use, or any
range that can be in use in the future.

*Why do that?

Is for the module Hash::NoRef, where I need to store a value/object without
actually make a reference to it. I previously tried to store a reference
value and decrement its REFCNT, but this will create a lot of problems,
including CORE dump of the interpreter, specially if we try to access this
value after the destruction of it, since is impossible to know if a
reference was destroied when the REFCNT is artificialy changed, and also we
can access a recycled SV. As a new approach I will store the type and number
of the SV, and mark that SV to guarantee that it wasn't destroied. After
this I can access the SV getting it directly from the list of SVs in use.

Thanks in advance and wish me luck! ;-P

Regards,
Graciliano M. P.




Re: how to build C in MakeMaker (part II)

2004-04-21 Thread Graciliano M. P.
Take a look in the module PAR, it does something like that

GMP
- Original Message -
From: Tim Harsch [EMAIL PROTECTED]
To: Perl Mod Authors [EMAIL PROTECTED]
Sent: Wednesday, April 21, 2004 3:10 PM
Subject: how to build C in MakeMaker (part II)


 I think the way I would like to do it would be to have this stand alone
 build *if needed* (hence perhaps using make), during the make test phase
 of building the module.

 Is there a way to have my Makefile.PL put extra steps in the test section
of
 the Makefile output?

 - Original Message -
 From: Tim Harsch [EMAIL PROTECTED]
 To: Perl Mod Authors [EMAIL PROTECTED]
 Sent: Tuesday, April 20, 2004 5:04 PM
 Subject: how to build C in MakeMaker


  I have a very small C program I want to include with my Perl module.  Is
  there a way to have MakeMaker compile this for me when they compile my
 Perl
  module?
 
  The C program will be stand alone, ie not linked to my .pm
 


 Esta mensagem foi verificada pelo E-mail Protegido Terra.
 Scan engine: VirusScan / Atualizado em 14/04/2004 / Versão: 1.5.2
 Proteja o seu e-mail Terra: http://www.emailprotegido.terra.com.br/

 E-mail classificado pelo Identificador de Spam Inteligente Terra.
 Para alterar a categoria classificada, visite

http://www.terra.com.br/centralunificada/emailprotegido/imail/imail.cgi?+_u=
gmpowers_l=1082571051.588684.6033.gravatal.terra.com.br




XML::Smart 1.5.5 released

2004-03-23 Thread Graciliano M. P.
I have just released XML::Smart 1.5.5

http://www.cpan.org/authors/id/G/GM/GMPASSOS/XML-Smart-1.5.5.tar.gz

The main pourpose of this announcement is to tell to the developers that
uses XML::Smart to update to the last version, since I receive a lot of
e-mails asking for support in bugs or resources that where already fixed in
the last versions.

Now XML::Smart seems to be used a lot in production projects, and this is
only possible due the tests made by all the users, what made XML::Smart much
more stable in it's quest to handle easy the complexity of XML. Soo, I say
thanks for all the reports, advices, comments and patches that I have
received. ;-P


Regards,
Graciliano M. P.

Changes (1.5+):

1.5.5 2004-03-23
- Added methods set_auto() , set_auto_node(), set_binary(), set_cdata().
- Fixed bug on copy().
- Fixed bug with date() when CONTENT key is found and should be CDATA or
BINARY.


1.5.4 2004-02-23
- Added autoload of parts of the module, to save load memory.


1.5.3 2004-02-23
- Just minor changes and fixes.


1.5.2 2004-02-15
- Fixed some minor bug on PUSH and UNSHIFT.
- Added support for multiple nodes for the same tag and interpolation of
different nodes.
- Removed duplicated entry of '/.CONTENT/0' at '/order' key.
- Added new tests and revision of the previous tests.


1.5.1 2004-02-05
- Fixed simple bug when XML::Smart object used on recursions/loops.


1.5 2004-01-15
- Added method aliase tree_pointer().
- Added method root().
- Added event handlers: on_start, on_char, on_end.
- Multiple contents handled in different way. $xml-{CONTENT} is tied
  and the data will be at $xml-{'/.CONTENT/0} , $xml-{'/.CONTENT/1} ,
$xml-{'/.CONTENT/2}...
- data() will keep the multiple contents order.
- content(i , data) can be used to set a content part.
- $srt = content() returns all the multiple contents grouped.






New module Date::Object - An alternative to DateTime, but not a replacement.

2004-03-20 Thread Graciliano M. P.
I have just released the module Date::Object, that in the first view is an
alternative to DateTime, at least for the most common things when handling
dates.

http://search.cpan.org/~gmpassos/Date-Object-0.01/

The main pourpose is to handle dates using a single object or make multiple
Date::Objects work together to calculate and handle dates.

Other main poupose of Date::Object is to find a simple way to store dates in
a persistent enverioment (any database) using a simple INTEGER field.

The use of a INTEGER field for that make possible searches in the DB by
ranges, what is impossible with normal storages of dates, specially if they
are saved as STRING, generally in the comon format of -MM-DD. Also an
INTEGER field have all the informations of a date, including year, month,
day, hour, minute, second and timezone. Other good thing is that any DB
supports INTEGER fields, what doesn't make our Perl code dependent of the
SQL nuances of each different way to handle dates of each DB.

Internally Date::Object has a simple architecture and is small compared to
other Date modules, since all is based in the time() (all the seconds from
1970-1-1) of the object. Soo, each object has it's own time value and
timezone, and from this 2 values any information is calculated. Soo, change
only 2 values make all the work easier to create the module and move the
date through the timeline, and with simple methods is possible to add/remove
days, weeks, months, years, and make comparations.

As any other author that releases a new module, I'm asking for some feedback
about the module.

Thanks in advance.

Regards,
Graciliano M. P.




New Perl module Statistics::R

2004-02-21 Thread Graciliano M. P.
I have released the new module Statistics::R and need some feedback of it's
status.
This will permit the control of the the R (R-project) interpreter through
Perl in different architectures and OS.

You can for example, start only one instance of the R interpreter and have
different Perl process accessing it. What will save the initiation time of R
and memory.

Soo, I will appreciate if some one can test it in different OS. Tested with
Win32 and Linux.

http://search.cpan.org/~gmpassos/Statistics-R-0.01/

Thanks in advance.

Regards,
Graciliano M. P.




Need advice for new module for Fast CGI, for enverioments without mod_perl.

2004-02-04 Thread Graciliano M. P.
Hy,

I'm planning a module to suppor users that doesn't have mod_perl, but need
to run persistent scripts, like in the old Fast CGI system.

The idea is to the user don't need to has shell access to install, just drop
it in the /cgi-bin directory, and you can access a bridge between a process
that has your Perl script and Apache.

Soo, in the cgi-bin, let's say, you have a binary built in C, that make a
socket connection (or nay other IPC) to a another process that is a Perl
script that will receive all the %ENV that Apache send, soo the script can
simulate that is inside Apache.

The concept is very simple, just need to find a way to make all of this in a
portable way.

Soo, what name I can give for this? I just have no idea.

  - CGI::FastBridge?

I know that Fast CGI is already there, but this is for users that can't ask
to the administrator to install anything. Let's say that will be possible to
make this work on SF without change any configuration of the server.

Regards,
Graciliano M. P.




(fast reply please!) Idea for new module: A bridge between Perl and R-project

2004-01-29 Thread Graciliano M. P.
I'm working on a module that make a bridge between the R-project
intepreter and Perl. Actually I need to have this done today, soo, I will
ask for a fast reply. Thanks in advance.

Soo, I need some adivices for the name of the module. Here are some names,
just vote in one or send suggestions(please).

  - Rbridge
  - Rcaller
  - Bridge2R

Regards,
Graciliano M. P.




Re: New module Mail::SendEasy

2004-01-26 Thread Graciliano M. P.
RE: New module Mail::SendEasyRE: New module Mail::SendEasy
  I know that already exists a lot of SMTP, AUTH and e-mail
  senders at CPAN,
  but no one in one single package. Specially one that doesn't have
  dependencies, like libnet.
 Ok, so it doesnt need libnet But why is that an advantage? libnet is
 core nowadays, and on Activestate
 Perl has been core for ages (which is where you would expect SMTP to be
 most heavily used.)
 Besides this is there really any reason for yet another MIME::Lite
 replacement?
 Yves

Humm, MIME::Lite need sendmail or some object instance that send e-mails to
reaally send an e-mail.

MIME::Lite is more to can build the content of your e-mail, what is just a
part of all the process to send an e-mail.

By the awy, I use Mail::SendEasy in Win32, soo, I can't use sendmail. And we
know that the sendmail approach to send e-mails in this days is not the
best, specially if you want a resource that is platform independent.

Note that I have created Mail::SendEasy to be the handler of the mail system
of a framework. Soo, the developer that uses this framework doesn't need,
and shouldn't, care about how the e-mail is sent. It just write the e-mail.

Also it handles SMTP AUTH, one of the purposes that I have wrote it, since
our main Web Hoster, for security, need authentication to can send e-mails.

Well, as you can see, the main purpose is to have all this resource in one
self contained package.

Regards,
Graciliano M. P.




How about class Foo {...} definition for Perl?

2004-01-17 Thread Graciliano M. P.
I have just released the module Class::HPLOO, that anables the well know
style for class declaration in Perl.

But I want know if already exists another filter that implements that, since
I have looked and haven't found anything about, only Perl6::Classes that
doesn't work very well, since is very easy to write a code that breaks the
filter.

For me is much more easier to create a Perl Module with Class::HPLOO, since
I just tell the class name and the methods, and all the OO code that I need
to write is automatically done. Than I can run it as it was, or I can
convert it to a normal Perl Module file, not dependent to the filter.

You can get it at:
http://search.cpan.org/~gmpassos/

But I want to know what the other module author think about it, since this
is a tool for us?

Just some example of syntax:

  use Class::HPLOO ;

  class Foo extends Bar , Baz {

vars ($VERSION , $GLOBAL_PUBLIC) ;

$VERSION = '0.01' ;

my $GLOBAL_PRIVATE ;

## Initializer (called by default new):
sub Foo (%args)

  $this-{X} = $args{x} ;
  $this-{Y} = $args{y} ;
}

sub x { $this-{X} }
sub y { $this-{Y} }

sub test_args ($x , $y , \%opts , [EMAIL PROTECTED] , $more ) {
  print  $x\n ;
  print  $y\n ;

  my @keys = map { $_ = 1 } (keys %opts , @list) ;

  print  $more\n ;
}

sub old_style {
  my ( $x , $y ) = @_ ;
  print  $x , $y\n ;
}

sub test_html_block {
  print % html_foo( $this-x , $this-y ) ;
}

% html_foo($x , $y)
  hr
  X: $x , Y: $y
  hr
%

  }

And this will produce this PM code:

  { package Foo ;

use vars qw(@ISA) ; push(@ISA , qw(Bar Baz UNIVERSAL)) ;

sub new

  my $class = shift ;
  my $this = bless({} , $class) ;
  my $ret_this = $this-Foo(@_) if defined Foo ;
  $this = $ret_this if ( UNIVERSAL::isa($ret_this,$class) ) ;
  $this = undef if ( $ret_this eq '0' ) ;
  return $this ;
}

sub CLASS_HPLOO_HTML

  return '' if !$CLASS_HPLOO_HTML{$_[0]} ;
  no strict ;
  return eval( ${$CLASS_HPLOO_HTML{$_[0]}}[0] .  CLASS_HPLOO_HTML;
  \n. ${$CLASS_HPLOO_HTML{$_[0]}}[1] .CLASS_HPLOO_HTML\n .
(shift)[1]) if ( ref($CLASS_HPLOO_HTML{$_[0]}) eq 'ARRAY' ) ;
  return eval(CLASS_HPLOO_HTML;
  \n. $CLASS_HPLOO_HTML{$_[0]} .CLASS_HPLOO_HTML\n . (shift)[1] ) ;
}


use vars qw($VERSION $GLOBAL_PUBLIC) ;

$VERSION = '0.01' ;

my $GLOBAL_PRIVATE ;

sub Foo

  my $this = shift ;
  my %args = @_ ;
  @_ = () ;

  $this-{X} = $args{x} ;
  $this-{Y} = $args{y} ;
}

sub x { my $this = shift ; $this-{X} }
sub y { my $this = shift ; $this-{Y} }

sub test_args

  my $this = shift ;
  my $x = shift(@_) ;
  my $y = shift(@_) ;
  my %opts = ref($_[0]) eq 'HASH' ? %{ shift(@_) } : ( ref($_[0]) eq
'ARRAY' ? @{ shift(@_) } : shift(@_) ) ;
  my @list = ref($_[0]) eq 'ARRAY' ? @{ shift(@_) } : ( ref($_[0]) eq
'HASH' ? %{ shift(@_) } : shift(@_) ) ;
  my $more  = shift(@_) ;

  print  $x\n ;
  print  $y\n ;

  my @keys = map { $_ = 1 } (keys %opts , @list) ;

  print  $more\n ;
}

sub old_style

  my $this = shift ;

  my ( $x , $y ) = @_ ;
  print  $x , $y\n ;
}

sub test_html_block

  my $this = shift ;

  print CLASS_HPLOO_HTML('_foo',( $this-x , $this-y )) ;
}

  $CLASS_HPLOO_HTML{'_foo'} = [ q`my $x = shift(@_) ;my $y = shift(@_) ;` ,
'CLASS_HPLOO_HTML' ];
  hr
  X: $x , Y: $y
  hr

  CLASS_HPLOO_HTML

  }

  1;

The best thing is to handle automatically the arguments of the method,
specially when you want HASH or ARRAY references, what cut off some hard
code.

I also use this to introduce Perl developers that don't know very well OO in
Perl, but know in Java, to the OO development, since everything that we
develope need to be in OO style.

Regards,
Graciliano M. P.





Safe::World 0.09

2004-01-16 Thread Graciliano M. P.
I have just released Safe::World 0.09, and I would like to ask for some
tests of it

From version 0.08 to 0.09 I have added a XS module, due incompatibilities of
one of the dependences, Safe::Hole/0.08, since Safe::Hole 0.09 breaks *INC
behavior for Safe::World.

I'm asking for tests, since the enverioment that Safe::World creates is
complex, and need to work in any Perl version from Perl-5.6+, and OS.

Thanks in advance.

Regards,
Graciliano M. P.




New user: About this list style.

2004-01-16 Thread Graciliano M. P.
I have just subscribed to this list, and before start posting to it I want
to ask some things.

What is the style of the list?

* Is about help other authors to develope their modules?
* Help to test and give feedback about modules?
* Announce new modules?

Weel, this is what I hope that I can found here.

Regards,
Graciliano M. P.