#!/usr/bin/perl use strict; use warnings; for my $file ( @ARGV ) { if ( ! open(INPUT, '<', $file) ) { warn "Unable to open $file - skipping!\n"; next; } while ( <INPUT> ) { print and next if ! /\$\w+/; $_ =~ s/\$(\w+)/$ENV{$1}/g; print; } }
Cheers - L~R
In reply to Re: printing enviroment vars from regex
by Limbic~Region
in thread printing enviroment vars from regex
by RnC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |