in reply to Re^2: Extract the variable
in thread Extract the variable
However, you could also try split. I don't think there would be a noticeable performance difference either way, but splitting would also give you the value if you need it:$raw = ".declare book_num a13"; $var = substr $raw, 9; print $var; # prints "book_num a13"
(undef, $var, $val) = split /\s+/, $raw, 3; printf '%s=%s', $var, $val; # prints book_num=a13
__________
Systems development is like banging your head against a wall...
It's usually very painful, but if you're persistent, you'll get through it.
|
|---|