Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 imbibing at the Monastery: (16)
As of 2014-09-30 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (378 votes), past polls