http://www.perlmonks.org?node_id=930089


in reply to Use of uninitialized value in substitution (s///)

Line 192 is "$ACETmpltDir = ~s/$ACEEnvironment//g;".

That should be $ACETmpltDir =~ s/$ACEEnvironment//g;. Pay careful attention to the spacing around =~.

What you have at the moment is trying to apply the substitution to $_; then apply logical not (*) bitwise negation (~) to the numeric result of that:

$_='aaaaa'; print s[a][]g;; 5 $_='aaaaa'; print ~s[a][]g;; 18446744073709551610

and finally assign (=) that to $ACETmpltDir, but it falls at the first hurdle because $_ is undefined.

(*)Corrected. Thanks to AnomalousMonk


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Use of uninitialized value in substitution (s///)
by AvanTTix (Initiate) on Oct 07, 2011 at 00:02 UTC

    THANK YOU!

    I totally overlooked this part of the syntax, even from the examples I looked up online.

      Happened to me just a few hours ago :)

      That really ought to be a warning, I can't imagine a use case where you want the bitwise negation of the number of substitutions  $foo = ~s/// or matches  $foo = ~m//

      every time I've encountered this in the past, its always been a mistake

      warnings should issue a specific warning