loosecannon1
Programmer
I'm trying to get "admin" out of the following:
$env_var = "iw_role=admin; iw_user=2z60z1;";
$env_var =~ m/iw_role=(.*);.*/;
print $1;
Problem is the string "admin; iw_user=2z60z1" is stored in $1 not "admin". But if I take the second semicolon off like: $env_var = "iw_role=admin; iw_user=2z60z1";
it works.
Can anyone explain why this is happening?
$env_var = "iw_role=admin; iw_user=2z60z1;";
$env_var =~ m/iw_role=(.*);.*/;
print $1;
Problem is the string "admin; iw_user=2z60z1" is stored in $1 not "admin". But if I take the second semicolon off like: $env_var = "iw_role=admin; iw_user=2z60z1";
it works.
Can anyone explain why this is happening?