Re: $_ in condition

From: Gunnar Hjalmarsson (noreply_at_gunnar.cc)
Date: 08/11/04

  • Next message: Jim Gibson: "Re: Need some hints on speeding up"
    Date: Wed, 11 Aug 2004 21:40:02 GMT
    
    

    jason@cyberpine.com wrote:
    > why doesn't $_ substitute with the data
    > when the program is passed the string as such.

    Substitute? Suppose you mean match.

    The reason is that $_ includes a trailing "\n".

    <snip>

    > while(<DATA>) {

         chomp; # this should fix the problem

    -- 
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    

  • Next message: Jim Gibson: "Re: Need some hints on speeding up"

    Relevant Pages

    • Re: Need help splitting up a fields data
      ... The easy way to parse out that kind of address is to extract what you know, and then remove it from the string, until the unknown part is left. ... So extract the zip code with RightWords, then Substitute out the string in the Zip field in the original field. ... Put that in the state field, then Substitute it out in the original field. ...
      (comp.databases.filemaker)
    • Re: isolate a number in cell with text and numbers
      ... That formula doesn't specifically extract numbers per se, ... have a string of numbers as *the last word*. ... The result of the inner TRIM function is then passed to the SUBSTITUTE ... string with other characters. ...
      (microsoft.public.excel.misc)
    • Re: User command to generate a formatted random number?
      ... substitute, and it will substitute all occurrences of 'a' with 'b'. ... empty strings for 'b'. ... The first pattern is '000$' where the zeros mean literal zeros and $ ... sed seems to replace the first instance of "se" here and not all of ...
      (comp.os.linux.misc)
    • Re: substitute a specific string
      ... >> I would like to substitute a specific string. ... frustration at your "forcing" me to either go to a newsgroup I've never read ...
      (comp.unix.shell)
    • Re: Computability and logic
      ... way to compare and substitute (i.e. to replace a substring of a string ... with another string according to a replacement rule). ... Why do you have a worry about infinite regress? ...
      (sci.logic)