Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Nov 7, 2024
1 parent bb25ba5 commit 0501239
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
24 changes: 22 additions & 2 deletions sites/en/pages/self-testing-with-modulino.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books testing
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -72,6 +72,26 @@ Despite this advantage of course the need to compile this extra code on every in

<h2>More about self testing Modulinos</h2>

Read more about self testing Modulinos in
Read more about self testing Modulinos in
<a href="https://www.amazon.com/gp/product/144939311X/?tag=szabgab-20">Mastering Perl</a> by brian d foy who coined the term.

<h2>Comments</h2>

Wow! It's a neat concept :) What really surprised me is the "import Test::More;". If I understand correctly, It's indirect method calling, right?


Some odd little corners of Perl. I hope this helps clear things up.

It's just doing what `use` does at compile time at run time. That way you only get the Test::More overhead if you are actually using it. See https://perldoc.perl.org/functions/use

Indirect method calls are when you use the `my_method MyClass arg1, arg2, ...` syntax. You don't see it much because we have learned to avoid it due to the fact that it is ambiguous. See https://perldoc.perl.org/perlobj#Indirect-Object-Syntax

It's all in TFM, assuming you can find it. I've been rereading the darn things for nearly 20 years and sometimes things still surprise me.


<hr>

the need to compile this extra code on every invocation

Compromise might be to move tests to t/xxx.t once you have finished development. And add a "require" in the self_test sub.

2 changes: 1 addition & 1 deletion sites/en/pages/separating-test-data-from-test-code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=status show
=books testing
=author szabgab
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down
7 changes: 6 additions & 1 deletion sites/en/pages/serving-static-site-using-plack-psgi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books psgi
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand All @@ -26,3 +26,8 @@ middleware that handles the files in the given directory.

Check out the other <a href="/psgi">articles on Plack/PSGI</a>.


<h2>Comments</h2>

There is handy oneliner as well: plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root => ".")->to_app'

10 changes: 9 additions & 1 deletion sites/en/pages/simple-cgi-script-to-send-form-by-email.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
=status show
=books cgi
=author szabgab
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -222,4 +222,12 @@ This can create an <a href="http://en.wikipedia.org/wiki/Open_mail_relay">open m
that can be used to send spam.


<h2>Comments</h2>

Thanks Gabor. You have no idea how many of your articles I have read to help me with my perl projects. Regards.

<hr>

Hi, I want to do something similar to your article. I want to display "Thanks for your submission" after submitting input by the user and simultaneously execute the cgi script. How can I do that?


Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
=status show
=books beginner
=author szabgab
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -187,3 +187,15 @@ say strftime '%B', @time; # November
See also <a href="http://strftime.org/">strftime in Python</a> that I used as the source of some of
the explanations.

<h2>Comments</h2>

%z is useful. +0100 is often handy.

<hr>

It's POSIX -- the placeholder values are supplies by your operating system. I agree that the perldoc could be useful and echo these, but on at least FreeBSD, "man strftime" lists all the supported values for that platform.

<hr>

In Python's strftime, if you want a decimal hour (e.g. "2" instead of "02") you can use "%-I" instead of "%I" ... Is there any equivalent approach in this Perl strftime function?

0 comments on commit 0501239

Please sign in to comment.