[Israel.pm] Talk: A natural flow for web apps

Ran Eilam eilara at cortext.co.il
Tue Mar 23 15:16:02 PST 2004


Why is it that every stupid little obfuscation gets the attention of
many a mongers, yet when a REAL, profound, software engineering problem
comes up (see below), it gets no answers at all? ;)

Maybe the silliness related posts are more gratifying? OK- I will buy a
beer (or tea if we decide to move from the Godfather) for the 1st person
who solves the problem below. Surely there is nothing I am missing here-
it could not be SO trivial, that it requires no answer?

It is a real problem, one that I have encountered, and most web
developers have as well. In the talk we will demonstrate why most web
developers are probably well aware of the problem, in one form or
another.

The truth is I just need people to understand the problem, so they can
understand the short talk about the "solution".

Ran

> Consider a command line application that gets 2 numbers and 
> prints their
> sum:
> 
>   sub flow {
>      my $a = prompt('Enter a number:');
>      my $b = prompt('Enter another number:');
>      prompt('Sum is: '. ($a + $b). '. Hit Enter to continue.');
>   }
> 
> It is easy to write a prompt() that will do what we need.
> Something like:
> 
>   sub prompt {
>      my $message = shift;
>      print "$message\n";
>      chomp(my $out = <>);
>      return $out;
>   }
> 
> How do you write a prompt() that will allow flow() to run 
> unchanged, but as a web app consisting of 3 pages?



More information about the Perl mailing list