in reply to Prepent string a to string b if b does not start with a

How would you brute force this?

  • Comment on Re: Prepent string a to string b if b does not start with a

Replies are listed 'Best First'.
Re^2: Prepent string a to string b if b does not start with a
by Saved (Beadle) on Mar 14, 2012 at 11:46 UTC
    unless(grep(/^rte/, $ENV)) { $ENV = "rte" . $ENV; }

    This works, sorry to have distrubed anyone, and thanx

      Using grep for one-member list is strange. You can just use if ($ENV !~ /^rte/)

        Thank You, that is better