how to warn?

  • Thread starter Jason L. Woodruff
  • Start date
J

Jason L. Woodruff

Hell guys:

I'm going to say it....I'm a newbie to PERL (sorta) and I'm working
around with a script that opens a database (user.db) and
adds/removes/and updates data in the database. The script will delete a
entry in the the database file but i would like to warn the user before
the actual delete is done.

Here is some code I'm looking at:

if ($input{'action'} eq 'delete'){
open (DATABASE,">$database");
@DB=<DATABASE>;
foreach $rec (@ODB){
chomp..................so on...............

I was wondering, if I slip the "{else}" "statement" in between this:


if ($input{'action'} eq 'delete'){
*the warning - user interaction - $Yes = proceed or $No = cancel *
{else}
*$Yes = go ahead and delete*



I would like to use some kind of "event handler", but If anyone has any
suggestions or experience, I would appreciate your help.

TIA
-JLW
 
A

Andres Monroy-Hernandez

Jason,

First, if you're going to use a DB based on files, I would recommend
you to use something like Berkeley DB.

Secondly, for the warning messages a simple print and STDIN would do
i,


Best regards,

-Andres Monroy-Hernandez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top