in reply to A string from a file
# set up a hash containing the values you want my %SWAPS = (); $SWAPS{printer} = $printer; $SWAPS{quota} = $quota; if($pagestate eq "duplex"){ $SWAPS{pagestate} = 'double sided'; }elsif ($pagestate eq "simplex"){ $SWAPS{pagestate} = 'single sided'; } if( 1 ){ $SWAPS{multiplier} = 'some_multiplier'; } # swap out things like __printer__ with $SWAPS{printer} $msg =~ s/__(\w+?)__/$SWAPS{$1}/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: A string from a file
by entropy (Sexton) on May 05, 2001 at 04:57 UTC | |
|
Re: Re: A string from a file
by Grand_Phallus (Novice) on May 07, 2001 at 23:33 UTC |