Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

salva (841)

salva
  (email not shown publicly)
+ -

  Comment: Re:do FIRST not BEFORE (Score 1) on 2010.07.16 9:29

by salva on 2010.07.16 9:29 (#72172)
Attached to: Phasers are a blast: FIRST and LAST
It seems I have not explained my opinion clearly, let me illustrate it with some code:

for 1..3 { say "enter"; FIRST { say "first run" } LAST { say "last run" } say "leave" }

I would consider FIRST and LAST to be interesting if that code printed enter, first run, leave, enter, leave, enter, last run, leave.

Read More 13 comments
Comments: 13
+ -

  Comment: do FIRST not BEFORE (Score 1) on 2010.07.16 3:12

by salva on 2010.07.16 3:12 (#72168)
Attached to: Phasers are a blast: FIRST and LAST
Executing FIRST before anything in the loop makes it pretty uninteresting. It would be more useful if it were run conditionally but on its place.

About implementing it, how about maintaining a loop iteration counter in some internal variable as $?I.

The same applies for LAST, but how do you know you are running the last iteration until after the loop check has failed?

Read More 13 comments
Comments: 13
+ -

  Comment: I do magic (Score 1) on 2010.06.13 4:41

by salva on 2010.06.13 4:41 (#72051)
Attached to: Magic: too powerful?
I always use magic to encapsulate C/C++ objects in my modules.

Specifically I store the pointer to the C structure in a magic attachment, so that it is not easily accessible from Perl.

For an example, you can check: FANN.xs

Though, I never go further, than that.

Read More 3 comments
Comments: 3
+ -

  Madrid Perl Mongers Social Meeting[->] on 2009.10.20 15:53 salva

Submitted by salva on 2009.10.20 15:53
Events
The Madrid Perl Mongers are having a social meeting on Wednesday October 21 from 19:30 (localtime) at El Rincon Guay, Embajadores 62, Lavapies, Madrid.

Everybody is invited!

Just come and enjoy some "cañas y pinchos" with us while we talk about Perl!
Link To Original Source
Read More 0 comments

+ -

  Comment: mobile version was also broken last week (Score 1) on 2009.09.19 14:05

by salva on 2009.09.19 14:05 (#70637)
Attached to: Dear Yahoo! Mail
So far, I have not found any problem with the new version of Yahoo mail when accesing it from a computer (actually, I like the new look) but I had been unable to use it from my Android phone for a couple of weeks until someday this week when, unexpectedly, it came back to life!
Read More 5 comments
Comments: 5
+ -

  Comment: Don't forget Expect, please! (Score 1) on 2009.09.01 2:41

Perl continues to be sys-admin best friend, and he needs Expect!

I know it is scary because Windows knows nothing about ttys and alike, but cygwin perl supports it, so it is doable.

Read More 22 comments
Comments: 22
+ -

  Comment: what a coincidence! (Score 1) on 2009.08.28 11:56

by salva on 2009.08.28 11:56 (#70296)
Attached to: Spreadsheet::ParseExcel on github
At work we use Trac for our projects and at some point this week I decided that it would be nice to be able to write Trac pages using POD instead of the Trac Wiki markup (mostly MoinMoin).

It took me some time to get familiar with Trac internals and relearning how to do the most simple things in Python (as I have not used that language for a very long time), but in the end I was able to write a plugin to support POD.

Behind the scenes, it just fed the POD text to pod2wiki and retrofitted the output into the Trac wiki engine. Unfortunately, the result was not too good, some things (i.e. lists) did not render as expected and the document structure went broken.

As I couldn't commit a lot of time to this task at the moment, I went for a different approach, calling pod2html and inserting the generated HTML into the Trac envelop. This respects the document structure but is uglier as the generated HTML doesn't follow Trac style.

I hope I would be able to put some more time in the pod2wiki approach at some point in the near future... until then, the plugin version using pod2html is here.

Read More 2 comments
Comments: 2
+ -

  Comment: Re:how to fix ithreads (Score 1) on 2009.07.06 2:11

by salva on 2009.07.06 2:11 (#69302)
Attached to: In defense of Perl ithreads

1. When you spawn a thread, it copies the whole environment from the parent thread, variables and code. This results in poor performance when a lot of libraries are loaded.

The worst part of this is not just the poor performance but its unpredictability and that the effect is not local but global.

For instance, to implement a CPAN module doing something specific (as downloading a bunch of files from the Internet in parallel) that you want to be usable from any script, if the module were launching, say, 10 threads, that would mean increasing x10 the memory footprint of the whole script.

So, using threads have uncontrolled side effects that would break the module encapsulation in a big way.

Read More 14 comments
Comments: 14
+ -

  Madrid.pm technical meeting on 2009.03.05 9:20 salva

Submitted by salva on 2009.03.05 9:20
User Groups
salva writes "¡Hola Mongers!,

Se acaba de confirmar la quedada técnica de la próxima semana!!!, despues de bastante $tiempo nos volvemos a ver las caras :)

Nos vemos el próximo miercoles 11 de Marzo a las 19:30 en e35:

Calle embajadores 35 (Metro: lavapies — la latina)

En el espacio funciona la libreria "Traficantes de sueños" y asi esta indicado en la entrada ;)

De momento hay dos presentaciones propuestas:
  • Salva hablara sobre un modulo que esta por subir a CPAN (30m)
  • Diego refritara la intro a Catalyst que hizo en Malaga (1h)

¡Si alguien quiere hablar sobre algun tema, o quiere proponer un tema sobre el que hablar este es el momento!

Mas info.

¡Nos vemos el miercoles!

English version:

Madrid.pm is going to meet on March 11 (next Wednesday) around 7:30pm at e35, Calle embajadores 35 (Metro: lavapies — la latina)

Everybody is invited!

The proposed talks are:

  • Salva is going to talk about some of his latest modules
  • Diego is going to repeat the Catalyst talk he did at the Open Source Conference in Malaga.

If you want to come and talk about anything Perl related just say so!

More info."

Read More 0 comments