in reply to Changing -> to work within a string

It ain't pretty but this should work
my $directory = "${\$machine->work_dir}/subdir/${\$machine->software_version}/";
But as it stands perl sees your string as
my $directory = $machine."->work_dir/subdir/".$machine."->software_version}/";
So you might need to either change the users' interface or force a style on them and definitely not use a source filter.
HTH

_________
broquaint