It's not perfect. It's missing a close $fh and the substitution regexp probably should be s/\$([a-z]+)/ $vars{$1} || "\$$1" /gie; to give a somewhat sane behaviour for undefined variables (instead of substituting them with the empty string. Which is what *nix shells do, so I guess it's not that bad...)
In reply to Re^3: how to read perl variable from a line read from a file
by Anonymous Monk
in thread how to read perl variable from a line read from a file
by Bharath666
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |