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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: martinasv
  • Order by date
  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'...
  16. martinasv

    CGI submit form and mysql

    Hi! I have a problem (again). :-( This script I wrote is supposed to update mysql table with new data. When I write in mysql: update table set nameMAC='something' where MAC='something else', everything works just fine. But my script just won't do it! Here's my code, so if anyone can figure...
  17. martinasv

    malformed header from script

    Thanks for the advice, PaulTEG! It was very helpful - it got me started. But I had to print the whole form using the CGI module, as well. Now it's working. [thumbsup2]
  18. martinasv

    malformed header from script

    Hello! I have a strange thing going on. This is my perl code: ______________________________________ #! /usr/bin/perl use CGI; use DBI; print "Content-type: text/html\n\n"; print "<HTML><HEAD><meta http-equiv=Content-Type content=text/html; charset=iso-8859-2><TITLE> Adding a NIC card...
  19. martinasv

    perl and nbtscan

    Hi. I'm supposed to scan the network, find out NETbios computer names and store them in a database. I know there are tools like nmap and nbtscan. I tried nmap from command line and it shows everything BUT computer names. Nbtscan works perfectly from command line, but I don't know how to start...
  20. martinasv

    perl, mysql and html links

    This works beautifully! :)

Part and Inventory Search

Back
Top