Jul 30, 2002 #1 zaza230 Technical User Feb 14, 2002 8 FR this is the content of $error : $error="error on SnmpMgrRequest 10065" I would like to remoove all word, except "error" my goal is to make $error=error how can I do it thank very much in advance
this is the content of $error : $error="error on SnmpMgrRequest 10065" I would like to remoove all word, except "error" my goal is to make $error=error how can I do it thank very much in advance
Jul 30, 2002 #2 raider2001 Technical User Apr 27, 2001 488 US So you just want the first word in the string? $error = "error on SnmpMgrRequest 10065"; $error =~ s/^(\w+).+/$1/; Upvote 0 Downvote
So you just want the first word in the string? $error = "error on SnmpMgrRequest 10065"; $error =~ s/^(\w+).+/$1/;
Jul 30, 2002 #3 BenRussell Programmer Mar 12, 2001 243 US Or this might work: $error =~ s/error(.*?)/error/ig; - Ben Russell - President of Intracor Technologies (http://intracor.hypermart.net) Upvote 0 Downvote
Or this might work: $error =~ s/error(.*?)/error/ig; - Ben Russell - President of Intracor Technologies (http://intracor.hypermart.net)
Jul 30, 2002 #4 sampsonr Programmer May 22, 2002 75 US You can use split to force the string into two strings, one having the first word and the other having what is to be discarded. Upvote 0 Downvote
You can use split to force the string into two strings, one having the first word and the other having what is to be discarded.