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

Re: grep and find file weirdness

by japhy (Canon)
on Jun 20, 2007 at 15:58 UTC ( #622293=note: print w/ replies, xml ) Need Help??


in reply to grep and find file weirdness

Yes, the is_dos_format() is smashing $_ in your grep block. The easy fix is to either local()ize $_ in the function or use a different variable in your while loop:

sub is_dos_format { local $_; ... } # or sub is_dos_format { ... while (my $line = <RJA>) { ... }

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart


Comment on Re: grep and find file weirdness
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-07-28 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls