#!/usr/bin/perl # # use strict; use warnings; my $teststring = '"user={hhhfj}jshdfjhdfjh\="'; my $own_value = "newvalue"; if ( $teststring =~ /\"user=.*/ ) { $teststring =~ s /\"user=.*/\"user=$own_value\"/; my $filename = $teststring; print $teststring, "\n"; $filename =~ s/\"//g; #you don't want " in an filename open my $outfile, ">", $filename; print $outfile $teststring; close $outfile; }
In reply to Re: Replace a string after a word
by walto
in thread Replace a string after a word
by nithins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |