I'm guessing you're trying to use $var. You could either not use s///:
$var =~ /^\.\w+\s+(\w+)\s+./; $var = $1;
or finish off what you had there:
$var =~ s/^(\.\w+\s+)(\w+)(\s+.+)/$2/;
(note the + near the end, which allows more than one character to match; the result of the substitution in $var is what's left over after you did the substituting)
In reply to Re: Extract the variable
by ForgotPasswordAgain
in thread Extract the variable
by denzil_cactus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |