brian d foy | 3 Jan 20:00 2006
Picon

Re: Changes to perlfaq.pod intro

In article <m3mzigg9nt.wl_rs <at> pobox.com>, Robert Spier
<rspier <at> pobox.com> wrote:

> > I've updated the script that creates perlfaq.pod so it has a completely
> > different introduction. It's the same information edited, corrected, 
> > and much nicer sounding (I hope).

> Minor comments:
> 
>   - Lets take $Date: $ out of the DESCRIPTION.  That often gets used
>     for TITLEs and stuff in HTML transitions, and will look ugly.

Fine. I never really liked that. I can move it down to the bottom near
the AUTHORS section.

>   - Do we really need to put list email gaddresses and contribution
>     information directly in the page?  Seems that 95% of users won't
>     really be interested.  (And I've still got this half-hearted thing
>     about munging addresses.)

I think we should keep them, but I can munge them. Any suggestions
on what works best?

>   - Put L<>'s in the TOC to make it easier for people to find links.

Good idea.

Robert Spier | 4 Jan 07:50 2006
Picon

Re: Changes to perlfaq.pod intro

> > Minor comments:
> > 
> >   - Lets take $Date: $ out of the DESCRIPTION.  That often gets used
> >     for TITLEs and stuff in HTML transitions, and will look ugly.
> 
> Fine. I never really liked that. I can move it down to the bottom near
> the AUTHORS section.

Cool.

> >   - Do we really need to put list email gaddresses and contribution
> >     information directly in the page?  Seems that 95% of users won't
> >     really be interested.  (And I've still got this half-hearted thing
> >     about munging addresses.)
> 
> I think we should keep them, but I can munge them. Any suggestions
> on what works best?

Probably something simple like "email-address at host.dom".  We also
sometimes use delimiters like "email-address[at]host.dom".

-R

Steffen Mueller | 4 Jan 10:00 2006
Picon

Re: Changes to perlfaq.pod intro

brian d foy wrote:
>>  - Do we really need to put list email gaddresses and contribution
>>    information directly in the page?  Seems that 95% of users won't
>>    really be interested.  (And I've still got this half-hearted thing
>>    about munging addresses.)
> 
> I think we should keep them, but I can munge them. Any suggestions
> on what works best?

address at domain dot tld

worked fine for me. To make it clearer that "at" and "dot" are 
characters, one could use delimiters as Robert suggested.

Steffen

Nicholas Clark | 6 Jan 17:15 2006

Re: Changes to perlfaq.pod intro

On Wed, Jan 04, 2006 at 10:00:53AM +0100, Steffen Mueller wrote:
> brian d foy wrote:
> >> - Do we really need to put list email gaddresses and contribution
> >>   information directly in the page?  Seems that 95% of users won't
> >>   really be interested.  (And I've still got this half-hearted thing
> >>   about munging addresses.)
> >
> >I think we should keep them, but I can munge them. Any suggestions
> >on what works best?
> 
> address at domain dot tld
> 
> worked fine for me. To make it clearer that "at" and "dot" are 
> characters, one could use delimiters as Robert suggested.

=head2 I am a spammer; how do I send mail to all the addresses in these documents?

The first task is to remove the obfuscation. For this, Perl's regexps are
ideally suited. If the obfuscated address is in C<$addr>

   s/\s*\[at\]\s*/\ <at> /g;
   s/\s*\[dot\]\s*/./g;

will convert them to the correct format. You can de-duplicate the addresses
with code such as this:

   my %seen = ();
   my  <at> unique = grep { ! $seen{ $_ }++ }  <at> array;

Then pass the list to your favourite spamming software. If instead you wish to
(Continue reading)

Dave Cross | 6 Jan 20:01 2006
Picon

Re: Changes to perlfaq.pod intro

Nicholas Clark wrote:
>
> =head2 I am a spammer; how do I send mail to all the addresses in these documents?
> 
> The first task is to remove the obfuscation. For this, Perl's regexps are
> ideally suited. If the obfuscated address is in C<$addr>
> 
>    s/\s*\[at\]\s*/\ <at> /g;
>    s/\s*\[dot\]\s*/./g;

[ snip ]

> =cut
> 
> Maybe we don't add that A to the FAQ. :-)

Maybe we do. You code appears to do nothing useful to $addr :)

Dave...

brian d foy | 29 Jan 06:00 2006
Picon

perlfaq5: How can I make a filehandle local to a subroutine?


* This is a partial diff. I cleaned up a lot of whitespace issues.

* In this answer, I show an example of storing a filehandle reference
in a container and then using that with print.

-=head2 How can I make a filehandle local to a subroutine?  How do I
pass filehandles between subroutines?  How do I make an array of
filehandles?
+=head2 How can I make a filehandle local to a subroutine?  How do I
pass filehandles between subroutines?  How do I make an array of
filehandles? 
 X<filehandle, local> X<filehandle, passing> X<filehandle, reference>

 As of perl5.6, open() autovivifies file and directory handles
 <at>  <at>  -228,6 +231,19  <at>  <at> 

   process_file( $fh );

+If you like, you can store these filehandles in an array or a hash.
+If you access them directly, they aren't simple scalars and you
+need to give C<print> a little help by placing the filehandle 
+reference in braces. Perl can only figure it out on its own when
+the filehandle reference is a simple scalar.
+
+  my  <at> fhs = ( $fh1, $fh2, $fh3 );
+  
+  for( $i = 0; $i <= $#fhs; $i++ ) {
+     print {$fhs[$i]} "just another Perl answer, \n";
+     }
(Continue reading)

brian d foy | 29 Jan 05:41 2006
Picon

perlfaq3: How do I debug my Perl programs?


* I completely rewrote the answer to have a friendly tone and actually
answer the question. :)

Index: perlfaq3.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq3.pod,v
retrieving revision 1.56
diff -d -u -r1.56 perlfaq3.pod
--- perlfaq3.pod  31 Dec 2005 00:54:37 -0000 1.56
+++ perlfaq3.pod  29 Jan 2006 04:39:47 -0000
 <at>  <at>  -110,28 +110,36  <at>  <at> 

 =head2 How do I debug my Perl programs?

-Have you tried C<use warnings> or used C<-w>?  They enable warnings
-to detect dubious practices.
+(contributed by brian d foy)

-Have you tried C<use strict>?  It prevents you from using symbolic
-references, makes you predeclare any subroutines that you call as bare
-words, and (probably most importantly) forces you to predeclare your
-variables with C<my>, C<our>, or C<use vars>.
+Before you do anything else, you can help yourself by ensuring that
+you let Perl tell you about problem areas in your code. By turning
+on warnings and strictures, you can head off many problems before 
+they get too big. You can find out more about these in L<strict>
+and L<warnings>.

-Did you check the return values of each and every system call?  The
(Continue reading)

Sébastien Aperghis-Tramoni | 29 Jan 22:01 2006
Picon

Re: perlfaq3: How do I debug my Perl programs?

brian d foy wrote:

> * I completely rewrote the answer to have a friendly tone and actually
> answer the question. :)
[...]
> +Perl comes with an interactive debugger, which you can start with the
> +C<-d> switch. It's fully explained in L<perldebug>.
> +
> +If you'd like a graphical user interface and you have Tk, you can use
> +C<ptkdb>. It's on CPAN and available for free.
> +
> +You can also use a commercial debugger such as Affrus (Mac OS X),
> Komodo
> +from Activestate (Windows and Mac OS X), or EPIC (most platforms).

Did I miss something or is Leon Brocard's very good Devel::ebug
not mentionned?

--
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.

brian d foy | 30 Jan 20:31 2006
Picon

Re: perlfaq3: How do I debug my Perl programs?

In article <1138568500.43dd2d3495cb9 <at> imp6-g19.free.fr>, Sébastien
Aperghis-Tramoni <maddingue <at> free.fr> wrote:

> brian d foy wrote:
> 
> > * I completely rewrote the answer to have a friendly tone and actually
> > answer the question. :)

> Did I miss something or is Leon Brocard's very good Devel::ebug
> not mentionned?

No, I missed something. I should add that to the answer.  Thanks,


Gmane