Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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 (Saint)
on Jul 18, 2019 at 00:53 UTC ( [id://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.
    zxcv
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found