in reply to How to use shared/global emory kind of feature in perl

Granted my experience with polymorphic code is non-existent, but could you do something like the following particularly useless piece of code:

#!/usr/bin/perl use strict; my $var = 1; print "$var\n"; open (IN, "test.pl"); my @lines = <IN>; close (IN); open (OUT, ">temp.pl"); foreach (@lines) { if ($_ =~ /^my \$var = /) { my @parts = split (/\s+/, $_); printf OUT "my \$var = %i;\n", ++$parts[@parts - 1] } else { print OUT $_; } } close (OUT); system ("mv temp.pl test.pl");

Basically, I was just going to say "write the variable to a file and read it", but since you say from "machine to machine", I'm not even sure shared memory would be the answer.