Re: $_ in condition
From: Gunnar Hjalmarsson (noreply_at_gunnar.cc)
Date: 08/11/04
- Previous message: Gunnar Hjalmarsson: "Re: function return value in a regexpr"
- In reply to: jason_at_cyberpine.com: "$_ in condition"
- Next in thread: jason_at_cyberpine.com: "Re: $_ in condition"
- Reply: jason_at_cyberpine.com: "Re: $_ in condition"
- Reply: jason_at_cyberpine.com: "Re: $_ in condition"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Gunnar Hjalmarsson: "Re: function return value in a regexpr"
- In reply to: jason_at_cyberpine.com: "$_ in condition"
- Next in thread: jason_at_cyberpine.com: "Re: $_ in condition"
- Reply: jason_at_cyberpine.com: "Re: $_ in condition"
- Reply: jason_at_cyberpine.com: "Re: $_ in condition"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|