in reply to delete something from a variable
In that case, you can do one of:$var = '/aasd/aacscsaa/affr4a/a55gaa/gvgaa/5h aa/fga';
Hope this helps,,,$var =~ s#/aasd##; # remove '/aasd' $var =~ s#/[^/]+##; # remove a slash followed by any number of # non-slashes substr($var,0,5,'');# replace the first 5-char substr with '' $var = substr($var, 5, length($var)-5); # get a substring $var =~ m#/[^/]+(.*)# and $var = $2; # match what follows # after the non-slashes # and set it to $var
Update: Forgot to mention that there are probably a 100 other ways to do this. And thanks jeffa for the correction.
|
|---|