Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Worst thing you ever made with Perl

by jonadab (Parson)
on Sep 30, 2003 at 18:15 UTC ( [id://295376]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Worst thing you ever made with Perl
in thread Worst thing you ever made with Perl

=cut sub new { ... } =item C<as_string>

Ah. I think that was the thing I needed to see, really. Though in my case it may be more like this...

sub authbox { my ($input, $callback) = @_; =item C<authbox> authbox ($input, $callback); Returns two items. The first is a string containing a hunk of xhtml suitable for inclusion wherever a div can legally be put (e.g., inside a table cell or a paragraph). If the user is not logged in, the box offers login options. If the user is logged in, it offers a logout link. $input should be a hashref containing any form input with keys starting with 'AUTH_'. $callback should be a closure that, if passed a user id, returns a string containing a suitable greeting; this string will appear in the authbox. The second item in the returned list is the cookie string that should be passed to the browser, if any. =cut # Rest of code for function goes here. }

Currently I have roughly that form, pretty consistently, but with comments instead of POD. I want to convert it to POD. Unfortunately, I seem to be finding that the version of cperl-mode I have may not support POD properly. update:Yes it does; there was something wrong with my POD.


$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

Replies are listed 'Best First'.
Re: Re: Worst thing you ever made with Perl
by Juerd (Abbot) on Sep 30, 2003 at 18:39 UTC

    =item C<authbox> authbox ($input, $callback); more stuff =cut

    No. You need extra blank lines in order to form command *paragraphs*. And you shouldn't indent normal text paragraphs, because it gets rendered as code then. And consider merging the first two lines:

    =item C<authbox \%input, \&callback>;

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      Ewwww. Significant whitespace? You're kidding, right? I thought I dodged that bullet when I quit trying to learn Python and stuck with Perl.


      $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

        Significant whitespace?

        Yes.

        You're kidding, right?

        No.

        I thought I dodged that bullet when I quit trying to learn Python and stuck with Perl.

        print 3 . 5; # 35 print 3.5; # 3.5 %foo = (bar => "xyzzy") print "-$foo{bar}-"; # -xyzzy- print "-$foo {bar}-"; # - {bar}- $a = 1; print $a - -5; # 6 print $a -- 5; # error print q qhelloq; # hello print qqhelloq; # qqhelloq
        Etcetera, etcetera. Get used to it. Yes, POD has significant vertical whitespace.

        Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://295376]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2024-04-25 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found