Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Deletes All Records not just one

by Athanasius (Monsignor)
on Feb 16, 2013 at 04:59 UTC ( #1019009=note: print w/ replies, xml ) Need Help??


in reply to Deletes All Records not just one

The code as shown is not deleting any records. Also, the filehandle DAT is opened for writing, but never closed: close $output; should be close DAT;. But I suspect the real problem is in the line:

next if ($field[1], $field[2]) = ($delroadName, $delroadNumber);

Perhaps you meant:

next if $field[1] eq $delroadName && $field[2] == $delroadNumber;

Note that = is for assignment. To test for equality, == is used for numbers, and eq for strings.

Also note that $field[1] is the second field, as arrays start from element zero. (Your code may be correct here — I only mention this as a point to double-check.)

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


Comment on Re: Deletes All Records not just one
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-12-26 13:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls