in reply to MySQL Table adding with Perl
so please don't flame
Are you sure about that? Its cold outside, how will you keep warm?
use strict/warnings to cut your development time in half! strict and warnings have also been called "training wheels" but they're more like "sanity checks" or seatbelts , professionals use them long after they've learned to ride a bike
See ExtUtils::MakeMaker::prompt, you could write
use ExtUtils::MakeMaker qw' prompt '; ... if( prompt('Are you new?', 'n') =~ /y/ ){ my $username = prompt('Your name is?','John Smith'); $username =~ s/\s+$//; ... } else { my $username = prompt('Who are you','John Smith'); $username =~ s/\s+$//; ... }
Or even
if( prompt('Are you new?', 'n') =~ /y/ ){ CreateNewUser(); } else { ActivateOldUser(); }
where CreateNewUser and ActivateOldUser do all that prompt/DBI stuff from before
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: MySQL Table adding with Perl
by Anonymous Monk on Mar 07, 2013 at 13:48 UTC | |
by marto (Cardinal) on Mar 07, 2013 at 14:01 UTC | |
by Anonymous Monk on Mar 07, 2013 at 14:34 UTC |