Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Really dumb question... ('ne' not working)

by damian1301 (Curate)
on May 20, 2001 at 08:23 UTC ( #81799=note: print w/ replies, xml ) Need Help??


in reply to Really dumb question... ('ne' not working)

It might be wise to have given the error message to us, but anyway...

I have had this problem before as well. I would try to test if the expressions turned out false with the ne equality operator. The great thing about Perl is that Larry has given you options and versatility so, instead of using the if($tmp_dir ne $dir){...} stuff, you could simply just negate that with the unless loop. In the process of switching loops, you will have to switch equality operators as well. To fix this, we will just change ne to eq. What we have now is

unless($tmp_dir eq $dir){ print OUTPUTFILE "\n", $tmp_dir ,"\n"; $dir = $tmp_dir; }


This code has the exact same behavior as the loop you were using and has never caused me problems under ActivePerl (on windows 98).

Hope I helped :-)

Tiptoeing up to a Perl hacker.
Dave AKA damian


Comment on Re: Really dumb question... ('ne' not working)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-09-20 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (159 votes), past polls