Integration Tests

2014-08-07 Thread marcos rebelo
requests I can use Mojolicious but I don't know what to use for the WebSocket tests. Anyone has an idea? Best Regards Marcos Rebelo -- Marcos Rebelo http://www.oleber.com/ Webmaster of http://perl5notebook.oleber.com

Re: baby perl to get the right date

2014-01-27 Thread marcos rebelo
smarter pattern to get the right value in > one single line. At least there's no simple "map" I can think of. > > Thanks, > Luca > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.o

Moose Role Derivation

2012-08-22 Thread marcos rebelo
new(parent => OBJ::OnSelf->new)) { if ( $obj->does('Likeable') ) { $obj->do_like } } the problem seems to me that is that I'm trying to do derivation on the Moose::Role, but I have no ideia how to solve the problem correctly. May I have your suggestions? Best Regards MArcos Rebelo -- Marcos Rebelo http://www.oleber.com/ Webmaster of http://perl5notebook.oleber.com

encoding and PDF::API2

2011-10-07 Thread marcos rebelo
Producer' => 'LibreOffice 3.3', 'Creator' => 'Writer', 'Author' => 'Marcos Rebelo', 'Title' => 'my title', 'Keywords' => 'my keywords' };

Re: How can I install a perl module without a root authority?

2011-08-16 Thread marcos rebelo
ed to copy the .pm file to my own lib directory directly, but it > says "can't locate loadable perl module ". > > Is there any other way to install perl modules without a root authority? > > Thanks. > -- Marcos Rebelo http://www.oleber.com/ Webmaster of http://

Re: Sorting a String

2011-08-16 Thread marcos rebelo
> > Obviously \n is at end of every line in the string.  I need it sorted. >  How would I approach this? > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > &g

Re: discover all packages subclassing some other package

2011-06-11 Thread marcos rebelo
I found an half solution, since it doesn't get me the ->ALL_PACKAGES<- mro::get_isarev($classname) How do I get the ->ALL_PACKAGES<-? Thanks for all your help Marcos Rebelo On Sat, Jun 11, 2011 at 08:25, marcos rebelo wrote: > > I need to discover all the packages (

discover all packages subclassing some other package

2011-06-10 Thread marcos rebelo
reation of ->ALL_PACKAGES<- Thanks for all your help Marcos Rebelo -- Marcos Rebelo http://www.oleber.com/ Webmaster of http://perl5notebook.oleber.com

Re: how do i push a hashref into another hashref

2011-06-07 Thread marcos rebelo
let_domU_data > > my %hash1 = %$select_all_website; > > foreach (keys %$selet_domU_data) { > push (@{$selet_domU_data->{$_}}, { rets => %hash1 ); > } > > > print Dumper ([$selet_domU_data]); > > i also tried a combination of many other things but does not seem to work &

Re: memory doesn't free after lexical block

2011-05-19 Thread marcos rebelo
is about coding. > > The secret to great software:  Fail early & often. > > Eliminate software piracy:  use only FLOSS. > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://lear

Re: Perl source code beautifier

2011-04-18 Thread marcos rebelo
try perltidy http://search.cpan.org/dist/Perl-Tidy/bin/perltidy Best Regards Marcos Rebelo On Mon, Apr 18, 2011 at 12:05, Bruno Costacurta wrote: > Hello, > > I'm looking for a command line tool for Perl source code beautifier. > Thanks for your help and advice. > > Bye,

Re: Dynamic replacement of the variable

2011-04-17 Thread marcos rebelo
http://www.shlomifish.org/ > "The Human Hacking Field Guide" - http://shlom.in/hhfg > > Judaism: God is all the shit, all the non-shit and all the intermediate > demi-shits in between. > > Please reply to list if it's a mailing list post - http://shlom.in/reply . &

Re: Regular expression to capitalize first letter of words in sentence

2011-04-14 Thread marcos rebelo
this snippet more clear: #!/usr/local/bin/perl use v5.10; use strict; use warnings; my $text = "jack and jill went up the hill to fetch a pail of water"; $text =~ s~(\w{3,})~\u$1~g; $text =~ s~\b(and)\b~\l$1~ig; $text =~ s~\b(the)\b~\l$1~ig; say $text; Best Regards Marcos Rebelo On Thu, Apr

Re: call method by name

2011-04-12 Thread marcos rebelo
On Tue, Apr 12, 2011 at 15:54, Paul Johnson wrote: > On Tue, Apr 12, 2011 at 03:26:49PM +0200, marcos rebelo wrote: >> Hi all >> >> I have a code like: >> >> foreach my $key ( ... ) { >>    my $sub = "get_$key"; >>    $self->$sub; >&

call method by name

2011-04-12 Thread marcos rebelo
Hi all I have a code like: foreach my $key ( ... ) { my $sub = "get_$key"; $self->$sub; ... } If I can do this, I can also do it without the variable $sub. What is the syntax? please Best Regards Marcos Rebelo -- Marcos Rebelo http://www.oleber.com/ Milan Perl Mongers

Re: inteligent DBI

2011-04-07 Thread marcos rebelo
We have a internal wrapper, The problem is that doesn't work with Oracle ;) I'm implementing it now. Oracle madness Best Regards Marcos Rebelo On Thu, Apr 7, 2011 at 11:57, Rob Coops wrote: > Even if it is not possible at the moment you could always overwrite this > function

inteligent DBI

2011-04-07 Thread marcos rebelo
s a parameter in the bind_param I would really like to do something like: $dbh->do( 'INSERT INTO my_table(field_1) VALUES (?)', [ 'pippo', { 'ora_type' => SQLT_BIN } ] ) is there a way to do this? maybe with some DBIx Best Regards Marcos Rebelo -- Marcos Re

Re: Oracle nightmare

2011-04-06 Thread marcos rebelo
_table SET field_2 = ? WHERE field_2 = ?" with ParamValues: :p1='pippo', :p2="não"] at script.pl line 66. Best Regards Marcos On Wed, Apr 6, 2011 at 12:07, Paul Johnson wrote: > On Wed, Apr 06, 2011 at 10:24:37AM +0200, marcos rebelo wrote: >> Hi all >> >

Oracle nightmare

2011-04-06 Thread marcos rebelo
( $field_1, $field_2 )"; say($nao_str eq $field_2 ? 'ok' : 'nok'); } } { my $sth = $dbh->prepare( 'UPDATE my_table SET field_2 = ? WHERE field_2 = ?' ); $sth->bind_param(1, 'pippo', { ora_type => SQLT_BIN }); $sth->bind_pa

Re: file manipulation

2011-02-14 Thread marcos rebelo
2 > 2010-12-01,1,11 > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- Marcos Rebelo http://www.oleber.com/ Milan Perl Mongers leader https://sites.google.com/site/milanperlmongers/ Webmaster of http://perl5notebook.oleber.com

Re: perl training material and excercises for freshers

2011-01-03 Thread marcos rebelo
We are speaking of slideshare.net . It's hard to believe that is down. On Mon, Jan 3, 2011 at 12:23 PM, Sunita Rani Pradhan wrote: > Hi Marco > >        I am not able to access this site , seems to be down . > > Regards > Sunita > > -Original Message- >

Re: perl training material and excercises for freshers

2011-01-03 Thread marcos rebelo
I used this slides to give a Perl training 3 times. http://www.slideshare.net/oleber/perl-introduction The course is done in a week, supposing that your juniors know how to program any other language. Best luck Marcos Rebelo -- Marcos Rebelo http://www.oleber.com/ Milan Perl Mongers leader

Fwd: SSH to remote machines.. 6D7-36A

2010-10-20 Thread marcos rebelo
Can someone take of the SPAM Assin??? -- Forwarded message -- From: marcos rebelo Date: Wed, Oct 20, 2010 at 12:34 PM Subject: Re: SSH to remote machines.. To: Bob Null Cc: beginners@perl.org I usually use http://search.cpan.org/dist/Net-SSH-Perl/lib/Net/SSH/Perl.pm sample

Re: SSH to remote machines..

2010-10-20 Thread marcos rebelo
/dir") foreach $cmd (@instructions){ my($stdout, $stderr, $exit) = $ssh->cmd($cmd); ... } Best Regards Marcos Rebelo On Tue, Oct 19, 2010 at 11:43 AM, Bob Null wrote: > Hello Folks, > > I want to create a chuck of code that will take a list of instructions > (things o

Fwd: Perl Threads 6D7-36A

2010-10-10 Thread marcos rebelo
Good and threads are hardly find together. Perl has a share nothing model. I would really consider to 'use forks', the syntax is similar and usually gets the work done. http://search.cpan.org/dist/forks/lib/forks.pm Best Regards Marcos Rebelo On Sun, Oct 10, 2010 at 5:08 PM, chilli

Re: Perl Threads

2010-10-10 Thread marcos rebelo
Good and threads are hardly find together. Perl has a share nothing model. I would really consider to 'use forks', the syntax is similar and usually gets the work done. http://search.cpan.org/dist/forks/lib/forks.pm Best Regards Marcos Rebelo On Sun, Oct 10, 2010 at 5:08 PM, chilli

Re: perl or python

2010-10-10 Thread marcos rebelo
the Python code which needs a strict indentation. > > If you want to use something trendy, Python is a much better choice these > days. > > Good luck. > > Octavian > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional comm

Re: [Milan-pm] New note on page5notebook

2010-10-07 Thread marcos rebelo
+- 5 hours/week. Best Regards Marcos Rebelo On Thu, Oct 7, 2010 at 12:08 PM, Oha wrote: > On 10/07/2010 11:27 AM, marcos rebelo wrote: >> >> but for such a simple query, I would prefer >> >> eval { >>    my $ss = SmartSelect->new($dsn, $user, $password); >&g

Re: [Milan-pm] New note on page5notebook

2010-10-07 Thread marcos rebelo
“Any fool can make things bigger, more complex, and more violent. It takes a touch of genius-and a lot of courage-to move in the opposite direction.” Best Regards Marcos Rebelo 2010/10/7 Gianluca Casati : > > I would use more $DBI::errstr after a prepare, an execute or a connect. > So

New note on page5notebook

2010-10-05 Thread marcos rebelo
Hi all I did one more note at: http://perl5notebook.oleber.com/objects/smart-selects-with-dynamic-response-to-undefiend-method-calls One example of the use of AUTOLOAD, to do some SQL dinamically. Comments are well come Best Regards Marcos Rebelo -- Marcos Rebelo http

The site of Perl Recipes/Notebook is alive, just moved to a sorter address

2010-09-15 Thread marcos rebelo
Hi all I moved all the content of http://sites.google.com/site/oleberperlrecipes/ to a more more appealing address http://perl5notebook.oleber.com and I added some more recipes in there. Best Regards Marcos Rebelo -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http

Re: How to test Output when using IPC::Open3

2010-08-29 Thread marcos rebelo
""); is( $trap->stdout, "TEXT IN"); done_testing(); How do I make that test pass? or this: trap {shell_run('perl', '-E', 'print STDERR "TEXT IN"')}; is( $trap->stdout, "TEXT IN"); Thanks Mar

Re: How to test Output when using IPC::Open3

2010-08-28 Thread marcos rebelo
the idea is to process the STDOUT ad the STDERR. open don't do it Best Regards Marcos Rebelo On Sun, Aug 29, 2010 at 6:08 AM, John W. Krahn wrote: > C.DeRykus wrote: >> >> Since you mention simplifying the code, do you actually >> need IPC::Open3 ?  In your sample co

How to test Output when using IPC::Open3

2010-08-28 Thread marcos rebelo
); is( $trap->stdout, "TEXT IN"); done_testing(); I would expect to have the test 'is( $trap->stdout, "TEXT IN");' executing ok, instead of that I have the test 'is( $trap->stdout, "");'. I need to test the outp

Re: A new recipe as arrived

2010-07-24 Thread marcos rebelo
On Sun, Jul 25, 2010 at 12:33 AM, Jeff Pang wrote: > 2010/7/25 marcos rebelo : >> Hi all >> >> Trying to make exceptions handling a little more clear, or much more >> frightening. >> >> http://sites.google.com/site/oleberperlrecipes/recipes/06-error-handlin

A new recipe as arrived

2010-07-24 Thread marcos rebelo
...@googlegroups.com Best Regards Marcos Rebelo -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http://milan.pm.org Webmaster of http://sites.google.com/site/oleberperlrecipes/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail

Re: how to sort in perl where the key is the 2nd of 3 components of a string where a dash is the separator?

2010-07-22 Thread marcos rebelo
] cmp $b->[0] } map { [ $compute->(), $_ ] } @_; } schwartzian_transform { (split /-/, $_)[1] } @array; More information on: http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/02-arrays/03-sort-arrays?pli=1 Best regards Marcos Rebelo -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http://milan.pm.org Webmaster of http://sites.google.com/site/oleberperlrecipes/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: I don't wont to create more lines of code then the necessary

2010-07-09 Thread marcos rebelo
The idea is really to count the lines, This will run in a test and seems to me the most clear code. the original code is +-: is( scalar( split( /\n/, $trap->stdout ) ) ), 15); The lines have no special order. Best Regards Marcos Rebelo On Fri, Jul 9, 2010 at 3:42 PM, Chas. Owens wrote: &

I don't wont to create more lines of code then the necessary

2010-07-09 Thread marcos rebelo
his without creating more lines of code? Note: I didn't do the prototype subroutine Best Regards Marcos Rebelo -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http://milan.pm.org Webmaster of http://sites.google.com/site/oleberperlrecipes/ -- To unsubscri

Re: [Milan-pm] A recipe was rewritten

2010-07-06 Thread marcos rebelo
d the Programming Perl books. Telling the truth, even with almost exclusive 10 years Perl experience, having the Perl Cookbook at my side was always useful. Now this book is outdated and the website may help in this point. Best Regards Marcos Rebelo Of course, we may always discusse evrything i

Re: A recipe was rewritten

2010-07-06 Thread marcos rebelo
On Sat, Jul 3, 2010 at 4:00 PM, Dr.Ruud wrote: > marcos rebelo wrote: > >> There was some discussion in the recipe, so I rewrite it: >> >> >> http://sites.google.com/site/oleberperlrecipes/recipes/05-io/02-slurp-a-file >> >> Please comment this ore any

A recipe was rewritten

2010-07-03 Thread marcos rebelo
Hy all There was some discussion in the recipe, so I rewrite it: http://sites.google.com/site/oleberperlrecipes/recipes/05-io/02-slurp-a-file Please comment this ore any other recipe. Remember that you may also propose some other useful recipe. Best Regards Marcos Rebelo -- Marcos Rebelo

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread marcos rebelo
On Sun, Jun 27, 2010 at 11:55 PM, John W. Krahn wrote: > marcos rebelo wrote: >> >> Hi all > > Hello, > >> This time, it's much more a personal opinion than a recipe. >> >> >> http://sites.google.com/site/oleberperlrecipes/recipes/01-varia

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread marcos rebelo
ed both at some time. Note: 90% of the times, in this cases, I use shift and I don't create the @data variable, I use the @_ directly. @_ has a clear meaning. Best Regards Marcos Rebelo On Mon, Jun 28, 2010 at 6:12 PM, Randal L. Schwartz wrote: >>>>>> "marcos" ==

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread marcos rebelo
makes the intentions more clear. Now setting shift inside logic, I clearly say: please add the @_ and make clear that you know the array that you are using, make clear your intentions. Best regards Marcos Rebelo On Mon, Jun 28, 2010 at 4:15 PM, Shlomi Fish wrote: > Hi Shawn, > > On

One new Recipe has arrived: When shall we use default variables?

2010-06-27 Thread marcos rebelo
Hi all This time, it's much more a personal opinion than a recipe. http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/04---misc/01-when-shall-we-use-default-variables Opinions are always welcome in perl-reci...@googlegroups.com Best Regards Marcos Rebelo -- Marcos R

Re: Is this a feature or a bug?

2010-04-29 Thread marcos rebelo
With all this solutions, seems that I may use: 'our $_' or '$::_' But it is really crazy in designers of perl to make this. If this isn't a major bug, Damian needs to write some new rule in is book. Best Regards Marcos Rebelo On Thu, Apr 29, 2010 at 5:56 PM, marcos

Is this a feature or a bug?

2010-04-29 Thread marcos rebelo
ints: 1 false , , , , , , , 1, , , the second 'any' should have returned a true value or not, and why??? Best Regards Marcos Rebelo -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http://milan.pm.org -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org Fo

busy_handler in sqlite

2009-03-19 Thread marcos rebelo
Hi all I'm a Perl programmer (not a complete beginer) using SQLite. I want to retry to execute every command automatically, until the DB is not locked. In C seems that I need to set the busy_handler. How do I do this with DBD in Perl? Thanks for any help Best Regards Marcos Rebelo -- M

Re: Can't install CDB_File

2008-01-25 Thread marcos rebelo
Hy all I'm using the last Ubuntu. What shell I ask to the apt? Thanks for the help Marcos On Jan 25, 2008 1:38 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Jan 25, 2008 1:39 AM, marcos rebelo <[EMAIL PROTECTED]> wrote: > > Hi all > > > > I'm ha

Can't install CDB_File

2008-01-24 Thread marcos rebelo
:869: error: invalid type argument of 'unary *' CDB_File.c:869: error: invalid type argument of 'unary *' CDB_File.c:872: error: invalid type argument of 'unary *' CDB_File.c:872: error: invalid type argument of 'unary *' CDB_File.c:872: error: invalid type argum

Collect the output of a shell command and set it in a file

2007-04-03 Thread marcos rebelo
r getting the output we can use IPC::open3 but the order of the output, how can I do that part??? Please post the script if it is simple Thanks for the help. Marcos -- Marcos Rebelo http://oleber.freehostia.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E

Re: writing a file in IIS

2007-01-26 Thread marcos rebelo
Windows XP Pro and IIS 5.1 (the one comming in the Windows XP CD). Please help, I really need this on monday. Note: I'll just contact you toorow Thanks Marcos On 1/26/07, Bill Jones <[EMAIL PROTECTED]> wrote: [off list] On 1/26/07, marcos rebelo <[EMAIL PROTECTED]> wrote

writing a file in IIS

2007-01-26 Thread marcos rebelo
em(join(", ",param('words'))),p, "Your favorite color is ",em(param('color')), hr; } #open(my $file, ">E:\\Projects\\gwt\\condominios\\bin\\com\\mycompany\\public\\pl.txt"); open(my $file, ">pl.txt") or print "Can

Re: Java 1.6 support to Perl

2007-01-15 Thread marcos rebelo
all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. -- Marcos Rebelo http://oleber.awardspace.com/ -- To unsubscribe, e-mail: [E

Java 1.6 support to Perl

2007-01-12 Thread marcos rebelo
Hy all It seems that Java 1.6 isn't supporting Perl, :'( bad sun. When will this be fix? Thanks Marcos -- Marcos Rebelo http://oleber.awardspace.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Jobs in Rome/Italy

2006-08-14 Thread marcos rebelo
Hy Perl's This is a little out of the scope of this place but I really need help I'm moving to Rome and I'm trying to find some contacts of enterprises using Perl (I need a job) in there. Can I've your support? thanks -- Marcos Rebelo http://oleber.awardspace.com/ -- To

Re: Next

2006-07-06 Thread marcos rebelo
. Can u please explain what it means? !defined($rt_nearest) or $dh<$dist or next; Kind regards, Geetha -- Marcos Rebelo http://oleber.awardspace.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <h

Re: substring

2005-08-17 Thread marcos rebelo
On 8/17/05, Paul Johnson <[EMAIL PROTECTED]> wrote: > On Wed, Aug 17, 2005 at 06:26:16PM +0100, marcos rebelo wrote: > > > If I'm not wrong, Changing this lines: > > > > my @col = grep(!/\t/, split(/(\t)/, $line)); > >

substring

2005-08-17 Thread marcos rebelo
If I'm not wrong, Changing this lines: my @col = grep(!/\t/, split(/(\t)/, $line)); push(@col, "") if $line =~ /\t$/; by $line .= "\t"; my @col; my $lastIndex = 0; foreach my $actualIndex (0..length

Re: Backup of a subroutine

2005-08-03 Thread marcos rebelo
e = $backup; } myPrint; test; myPrint; On 8/3/05, marcos rebelo <[EMAIL PROTECTED]> wrote: > I need to redefine localy one subroutine and have it correctlly after. > Who do I do it? > > sub myPrint () { >print "Teste 1\n"; > } > > sub test { >

Backup of a subroutine

2005-08-03 Thread marcos rebelo
I need to redefine localy one subroutine and have it correctlly after. Who do I do it? sub myPrint () { print "Teste 1\n"; } sub test { no strict "refs"; no warnings; my $str = "::myPrint"; #my $backup = $main::{myPrint}; my $backup = *$str; *$str = sub() {

Re: Read output from script line by line

2005-06-09 Thread marcos rebelo
This way works open(my $FH, 'script.sh |') or die ...; while (my $line = <$FH>) { ... } close($FH); On 6/9/05, Tielman Koekemoer (TNE) <[EMAIL PROTECTED]> wrote: > > Hello all, > > Is there a way you read input from a script line by line. I'd rather > parse output line by line than do: @out

Re: XML::LibXSLT on Cygwin

2005-05-23 Thread marcos rebelo
This email has already sent but is about the XML::XSLT It is possible to install this Perl module in the Cygwin. When I do 'perl Makefile.pl' the script blows up and creats the file 'perl.exe.stackdump' I changed the code of the Makefile.pl inside the 'sub backtick' from open(STDOUT, ">$

XML::LibXML on Cygwin

2005-05-22 Thread marcos rebelo
It is possible to install this Perl module in the Cygwin. When I do 'perl Makefile.pl' the script blows up and creats the file 'perl.exe.stackdump' I changed the code of the Makefile.pl inside the 'sub backtick' from open(STDOUT, ">$DEVNULL"); open(STDERR, ">$DEVNULL"); my $result

installing XML::Xerces in Perl

2005-05-01 Thread marcos rebelo
I'm getting crazy I have the Xerces (I think) installed on Cygwin. Now I have to set some variables but I dont know to what, can someone help me XERCES_LIB XERCES_INCLUDE XERCESCROOT XERCES_CONFIG Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

I canot install xml::libxml

2005-04-24 Thread marcos rebelo
When I try to do perl Makefile.PL I have this output ### enable native perl UTF8 running xml2-config...untested WARNING! The installed version of libxml2 was not tested with this version of XML::LibXML. XML::LibXML may fail building or so

PERL and XML

2005-04-18 Thread marcos rebelo
For the Universaty Project, I dicided to make a study about the use of Perl and XML. I have already found somethings to read in google but they seem to be desactualized (2002, 2003). So I would like to have your help to find new articles about the Perl support to the XML and all the tecnologis aro

Re: Create unexistent directories by FTP

2005-03-28 Thread marcos rebelo
te: > On 28 Mar, marcos rebelo wrote: > > > I have a program that is supposed to send files throw FTP. And I'm > > using the Net::FTP. I have a destiny path and I need to create the > > directories if they don't exist. > > Locally or remotely? > >

Create unexistent directories by FTP

2005-03-28 Thread marcos rebelo
I have a program that is supposed to send files throw FTP. And I'm using the Net::FTP. I have a destiny path and I need to create the directories if they don't exist. How do I check if a Directory exist? Actual code +-: sub fput($$$) { my ($ftp, $orig, $dest) = @_; return if $orig =~ /

RE: Regex against a scalar

2005-03-28 Thread Marcos Rebelo
I'm lost with this question, but try to run: print("abcd" =~ /(b.)/) Is this what you need? Marcos -Original Message- From: Perl [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 24 de Março de 2005 1:42 To: Beginner Perl Subject: Regex against a scalar Hi. I would like to search a sca

Re: Simplify perl -e '$a = [1,2,3,4,7]; print $a->[$#{@$a}]'

2005-03-14 Thread marcos rebelo
TED]> wrote: > > -Original Message- > > From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] > > Sent: Thursday, March 10, 2005 8:55 AM > > To: Marcos Rebelo > > Cc: Perl Beginners > > Subject: Re: Simplify perl -e '$a = [1,2,3,4,7]; print $a->

RE: Simplify perl -e '$a = [1,2,3,4,7]; print $a->[$#{@$a}]'

2005-03-10 Thread Marcos Rebelo
This really works, I didn't now that. Thanks Marcos Rebelo -Original Message- From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 10 de Março de 2005 14:55 To: Marcos Rebelo Cc: Perl Beginners Subject: Re: Simplify perl -e '$a = [1,2,3,4,7]; print $a-&g

Simplify perl -e '$a = [1,2,3,4,7]; print $a->[$#{@$a}]'

2005-03-10 Thread Marcos Rebelo
This is correctly printing '7' but '$a->[EMAIL PROTECTED]' seems to be encripted code. Can I write this in a cleaner way? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Reading and writing to a program

2005-02-25 Thread marcos rebelo
Feb 2005, Marcos Rebelo wrote: > > > My $pid = open2(my $RDRFH, my $WTRFH, "perl", "-e", "while (<>) > > {print}"); > > Using 'use warnings' should have told you that 'My' is broken here. > > What messages do you

Reading and writing to a program

2005-02-25 Thread Marcos Rebelo
I need to do some commands in another machine, I will try something like 'rlogin machine'. I'm not allowed to install new packages in the machine :'( To simplifey I tried to run a simple command in perl to simulate a 'more' command. use IPC::Open2; use IO::Handle '_IOLBF'; My $pid = open2(my $

Circular References, Self Referenced memory ang Garbage Collection

2005-01-04 Thread Marcos Rebelo
Some time ago I read one article about this Consider that you have: { # make $a point to itself my $a; $a = \$a; } Or { # make $a and $b point to each other my ($a, $b); $a = \$b; $b = \$a; } This memory will be free just at the end of the proce

Perl Presentation Slides

2004-12-14 Thread Marcos Rebelo
Hy all My next assignement is to do a presentation of Perl begginers (from zero) in 4 days :'( Actually I have already 71 slides and I would like to see other persons work in this matter. Someone know where to find or can give some Slides similar to the ones I'm doing. Thanks Marcos -- To uns

RE: assign operator as variable

2004-10-25 Thread Marcos Rebelo
to replace the conventional symbol "&&" with other variable eg $AND_operator so that the following statement is valid if ($cond1 $AND_operator $cond2) Thanks On Mon, 25 Oct 2004 10:44:19 +0100, Marcos Rebelo <[EMAIL PROTECTED]> wrote: > Maybe this can h

Receve and forward email

2004-10-10 Thread marcos . rebelo
Hi all This is my first question. One part of my job is to read one e-mail from Pop3 and do a forward of that e-mail with SMTP to +- 1000 users, just changing the from and the to. There is something that can eseally do this? How to do this? Probably there is some modules that can do this work e

RE: Data comparision analysis

2004-08-18 Thread Marcos . Rebelo
> Gunnar Hjalmarsson wrote: > > David Greenberg wrote: > > #!/usr/bin/perl > > use strict; > > open (GROUPFH, " > my @groups = (); > > while (my $line = ) { > > chomp ($line); > > push (@groups, $line); > > } > > close (GROUPFH); > > open (USERFH, "File2"); > > my %group_to_users = (); >

RE: Trying To write a script

2004-08-09 Thread Marcos . Rebelo
> -Original Message- > From: Singh, Harjit [mailto:[EMAIL PROTECTED] > Sent: Monday, August 09, 2004 4:05 PM > To: [EMAIL PROTECTED] > Subject: Trying To write a script > > > I am trying to write a script that would be able to read a file. The > file is broken into number of segments a

E-mail Parsing

2004-08-04 Thread Marcos . Rebelo
I'm have a email in a text file. From this file I would like to get the sender information, the attached files and the body of the e-mail. Is there something simple to do this? Marcos -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Help on output formatting

2004-08-02 Thread Marcos . Rebelo
maybe you can do something like: ($text) = ($text =~ /([0-9]+)/); Before printing the text. > -Original Message- > From: sudhindra k s [mailto:[EMAIL PROTECTED] > Sent: Monday, August 02, 2004 10:52 AM > To: [EMAIL PROTECTED] > Subject: Help on output formatting > > >   > Hi > > I ha

RE: CGI script just stops...

2004-07-21 Thread Marcos . Rebelo
Some time ago I had a similar error because I has not in the suposed directory. 1º try whith the full path. 2º see which is the directory where you really are. For getting the script directory you can use the use File::Spec; use FindBin; open(LISTFILE, ">>".File::Spec->join($FindBin::Bin, $list

RE: Pattern matching line by line

2004-06-16 Thread Marcos . Rebelo
why not to split the String first something like foreach my $line (split(/\n/, $a)) { if ($line =~ /whatever/) { print $line; } } shall do the trick Marcos > -Original Message- > From: bzzt [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 16, 2004 1:33 PM > To: [EMAIL PROT

RE: Any wrong?

2004-06-01 Thread Marcos . Rebelo
> -Original Message- > From: Jame Brooke [mailto:[EMAIL PROTECTED] > Sent: Sunday, May 30, 2004 6:10 PM > To: [EMAIL PROTECTED] > Subject: Any wrong? > > > > Friend, anybody have idea regarding this problem. Assume I > want know where the word call "fish" locate in which line > number

RE: Question of memory management in Perl

2004-05-26 Thread Marcos . Rebelo
> -Original Message- > From: Jenda Krynicky [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 25, 2004 8:08 PM > To: [EMAIL PROTECTED] > Subject: RE: Question of memory management in Perl > > > From: [EMAIL PROTECTED] > > I don't know for sure the effect of: > > > > @out_a

RE: Question of memory management in Perl

2004-05-25 Thread Marcos . Rebelo
Probably you notice that you have +- 1kb for each hexa values. This seems that you have some global variables that are not necessary. Usually the solution is having the variables scoped to the minimum code area possible. Module 'strict' can help. for instance if you have something like. my @arr

RE: get hash from array

2004-05-24 Thread Marcos . Rebelo
> -Original Message- > From: James Edward Gray II [mailto:[EMAIL PROTECTED] > Sent: Monday, May 24, 2004 3:00 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: get hash from array > > > On May 24, 2004, at 7:46 AM, [EMAIL PROTECTED] wrote: > > > sub xpto { > >my %a =

get hash from array

2004-05-24 Thread Marcos . Rebelo
sub xpto { my %a = map {$_ => undef} (@_); return \%a; } or sub xpto { return {map {$_ => undef} (@_)}; } I'm using this code but shall exist someting clearner without map. Can you help me? Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: array output

2004-05-23 Thread Marcos . Rebelo
Doing a fork shall help. Child runs the system command and exit. Pather creats a new child for the rest. foreach my $cmd (@cmds) { if (fork() == 0) { # child system($cmd); exit(0); } } Is this what you need? Marcos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Install epic plugin in the eclips

2004-05-19 Thread Marcos . Rebelo
I don't have access to the internet from my computer. How do I set the epic working for me? Thanks MArcos -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Perl Coding Standarts

2004-05-18 Thread Marcos . Rebelo
I'm looking for Perl coding standards. I found some in the net but seems they are just web pages not really in use. I was looking for really in use perl coding standards and some opinions about them. I would also like to know if there is tools checking for this standards. For know I'm using 'per

RE: Project Advice Wanted

2004-03-30 Thread Marcos . Rebelo
1) Now the problem is to chose. ASP, PHP, Pyton, ... 2) If you consider to be free from OS use the DBD/DBI for DB. There is already installed module in Win32 package for ODBC if you just need Windows. 3) In the Template area I use HTML::Template. Marcos -Original Message- From: Steve Gr

bug in XML::Simple ?

2004-03-24 Thread Marcos . Rebelo
I did this shell command perl -e 'use XML::Simple qw(:strict); use Data::Dumper; print Dumper(XMLin("<_a>b", 'ForceArray' => 1, KeyAttr => []))' > delete.txt And the output was $VAR1 = { '__a' => [ 'b' ] }; I was aspecting $VAR1 = {

RE: Overriding 'die' Functions

2004-03-22 Thread Marcos . Rebelo
I'm working in a project that shall have +- the time of the Internet has we now it today. Sometimes my script throw a die and I just know the line where was throw. What I want is to have the all stack, something like java. Since changing the code would be a very expancive work, I would prefer to

Overriding 'die' Functions

2004-03-19 Thread Marcos . Rebelo
I would like to add some text each time someone calls die. in my books says this shoud work *CORE::GLOBAL::die = sub { ... } can someone give me a example? MArcos -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Some java some perl

2004-03-11 Thread Marcos . Rebelo
I did this question in here because I was aspecting that I was not the first crazy man doing something like this. I'm a perl programmer not a java programmer. I know that I'll have problems calling one from the other like this. Probabli the final release will be a Server/Client application to avo

Some java some perl

2004-03-11 Thread Marcos . Rebelo
I'm doing one interface in java that will call some perl scripts. I need to catch the output and I don't know how to do it. If I execute the 'ls' command my java program finnish if I call the perl my program don't finnish. What am I missing? import java.io.DataInputStream; import java.io.IOExcept

  1   2   >