Script that uses the module
#!/usr/bin/perl use strict; use warnings; use Cool; my $obj = Cool->new(); while (1) { print $obj->testit(), "\n"; sleep 1; $obj->soft_boot(); }
The module itself
package Cool; use strict; use warnings; require 'magic'; 'This statement is false';
The file called 'magic'
package Cool; use strict; use warnings; no warnings 'redefine'; sub new { return bless {}, $_[0]; } sub testit { return 'Change me and see what happens'; } sub soft_boot { do 'magic'; } 'This statement is false';
Given this bizarre situation, is this the sanest way you can think to do it? If not, please offer your advice (preferrably with a working code snippet).
And yes diotalevi, I know this blows my method cacheCheers - L~R
In reply to Sanely modifying running code by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |