in reply to Variable Data Lost

Also, what on earth is this doing:
if (index ($sline, "pattern") > "-1")
the minus one shouldn't be in quotes, and you don't need that clunky JavaScript sytax, just use a regex like you do a couple of lines later.
--
($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;

Replies are listed 'Best First'.
Re: Re: Variable Data Lost
by elusion (Curate) on Aug 26, 2002 at 02:54 UTC
    As far as the minus one being in quotes...

    It doesn't really matter, because in perl, strings and numbers and numbers are strings. So while no quotes would be preferred, with quotes certainly works.

    I would have to agree with your suggestion to use a regex, though.

    elusion : http://matt.diephouse.com

      I think I was getting confused with JavaScript syntax myself there. Quotes will force a number to be a string in JS. But the day it's a variable, not just a constant, in those quotes, it will cause huge problems, won't it?
      --
      ($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;