Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Off by one key... or yet another example of why strict and warnings are always a good idea (even for "one-liners")

by LanX (Sage)
on Jul 18, 2019 at 00:53 UTC ( #11102961=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    C:\>set PERL5OPT=-w -Mstrict
    Global symbol "$x" requires explicit package name (did you forget to d
    +eclare "my $x"?) at -e line 1.
    Execution of -e aborted due to compilation errors.
  2. or download this
    C:\>set PERL5OPT=-w -Mstrict=refs,subs
    C:\>perl -e"print $x"
    Name "main::x" used only once: possible typo at -e line 1.
    Use of uninitialized value $x in print at -e line 1.
  3. or download this
    C:\>perl -le "my $str = q{zxcv}; if ( $str -~ m/some pattern/i ) { pri
    +nt $str; }"
    Use of uninitialized value $_ in pattern match (m//) at -e line 1.
    Argument "zxcv" isn't numeric in subtraction (-) at -e line 1.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11102961]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2021-12-02 15:00 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (22 votes). Check out past polls.