package HostCycle; $ftp_host = undef; sub until { ; } sub then { ; } sub cycle {my $self=shift; for $ftp_host (@ftp_host) { my $retval = $self->until($ftp_host); if ($retval) { $self->then($ftp_host); } else { ++$error_count; } package SendOrder; @ISA=qw(HostCycle); sub until { # Wait for upfile to disappear } sub then { # Upload orderfile and upfile } package GetOrder @ISA=qw(HostCycle}; sub until { # Wait for downfile to disappear } sub then { # Download all files in directory }
And of course regarding runtime alteration of code blocks: when was the last time you needed that? Answer: when you are trying to create your model as metaphorical to the language as opposed to creating a model with the language. Douglas Hofstadter in "Goedel, Escher, Bach: The Eternal Golden Braid" tried to say that we needed self-modifying, self-reflective languages. But in actually we just need to ability to modify and study structures.
In reply to RE: Re: Templating and Programmatic Block Manipulation in Perl
by princepawn
in thread Templating and Programmatic Block Manipulation in Perl
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |