Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by martinasv

  1. martinasv

    avoiding MySQL error messages being printed out

    Hi! I wrote this little peace of code, which is supposed to check if a certain database exists, and if not, create one. (Maybe there's a much better way to do it, but I don't know it) Anyway, here's the code: use DBI; $username = 'root';$password = '';$database = 'tina'; $hostname = ''; if...
  2. martinasv

    creating mysql database from perl

    I've managed to do it this way: use DBI; $username = 'root';$password = '';$database = 'tina'; $hostname = ''; $dbh = DBI->connect("dbi:mysql:database=$database;" . "host=$hostname;port=3306", $username, ) or $result=`mysqladmin -u root create tina`; Basically, it's doing what I wanted, but...
  3. martinasv

    creating mysql database from perl

    Hi, everyone! Is there a way to create a database using Perl? I've been searching the Net, and all examples I came across were for connecting to an existing database. I tried using: $result=$dbh->createdb("dbname"), but it returns an error: Can't call method createdb on an undefined value...
  4. martinasv

    yum installer and DBI

    Hi, everyone! I was wondering... If I write: # yum install mysql ... # yum install mysql-server ... Is DBI installed together with those, or do I have to install it separately? Tnx.
  5. martinasv

    stopping script execution

    OK, I'll try that.
  6. martinasv

    stopping script execution

    Hello guys and gals! I have a perl script which captures ARP packets on the network. Right now I'm starting it from command-line and stopping it with Ctrl-C. But, I'd like to start it and stop it from perl/CGI stript (HTML page, Start and Stop buttons). I know I could start it using...
  7. martinasv

    regexp

    Wow, that's great! You helped a lot. (I had to change this just a little bit: instead of capital "S+", it has to be "s+"). But, I couldn't have done it without you! [sunshine]
  8. martinasv

    regexp

    Hi! This is one of the lines I get when I use nbtscan to detect computers' NetBIOS name: 192.153.1.5 STARI <server> STARI 00-c0-df-13-66-49 I'd like to parse that line in such way that I store IP address to variable $ip and NetBIOS name "STARI" to variable $nbt...
  9. martinasv

    two submit buttons in one form

    Tnx! :-)
  10. martinasv

    two submit buttons in one form

    I know eq and ne operators are for comparing strings. But what I can't figure out is how to extract the value (or name) and put it in a variable so I can do something with it. Something tells me I should maybe use "param()", but I don't know how.
  11. martinasv

    two submit buttons in one form

    How do I check their value? [ponder]
  12. martinasv

    two submit buttons in one form

    Hi! If I have two submit buttons in one form (like shown below), how do I get the "name" part in a variable to be able to use it with "if" statement? print "<br>"; print "<form>"; print "<input type=submit name=update value=\"Write NIC name\" >"; print "<font align=middle>OR</font>"; print...
  13. martinasv

    html form, action pointing to a subroutine?

    Tnx! The first option is what I wanted. :-) But I'm new to all these stuff, so I'm constantly posting questions on this forum.
  14. martinasv

    html form, action pointing to a subroutine?

    Is it possible to write HTML form in perl so that the action points to a subroutine in the same script? E.g. print "<form action=\"do_something()\">"; where do_something is a subroutine?
  15. martinasv

    CGI submit form and mysql

    After adding those lines and trying it out, a thought came to me... There is no action specified in my form, so Submit calls upon this same script, but it loses information about MAC along the way. That's why mysql statement in the end looks like this: update table set nameMAC='something'...

Part and Inventory Search

Back
Top