in reply to Matching @ in string

please always use warnings in perl oneliners. i've never understood why people use warnings in their scripts and leave it out in oneliners.
if i write a oneliner i automatically start it with -wle.
this has probably saved me lots of time.
Possible unintended interpolation of @t in string at -e line 1. Name "main::t" used only once: possible typo at -e line 1.

Replies are listed 'Best First'.
Re^2: Matching @ in string
by loris (Hermit) on Nov 23, 2007 at 07:49 UTC

    I am sure this is very good advice, but in the present case

    perl -elw 'if ("h@t" =~ /(\@)/ ) { print $1 }'

    doesn't produce any warning (I'm using 5.8.8 under Cygwin and Debian).

    How did you get the message about the unintended interpolation?

    loris


    "It took Loris ten minutes to eat a satsuma . . . twenty minutes to get from one end of his branch to the other . . . and an hour to scratch his bottom. But Slow Loris didn't care. He had a secret . . ." (from "Slow Loris" by Alexis Deacon)
      perl -elw ...
      i said -wle not -elw =)
      -elw doesn't produce any output.