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 strongm 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 MacTommy

  1. MacTommy

    Python 2.7 bz2 support (on rhel)

    As always, I tried something right after posting this, and that worked... ;-) Just in case somebody stumbles upon this...: I was under the impression that it would only work when I did ./configure with --enable-shared. But it turned out that things were a lot less problematic when I didn't use...
  2. MacTommy

    Python 2.7 bz2 support (on rhel)

    Hi all, I am completely new to Python and I am trying to get some software to run, which crashes because 'module bz2' is missing. Indeed, if I say "import bz2" it says: "No module named bz2". So I tried recompiling Python, but somehow it won't include the bz2 module. Something goes wrong at...
  3. MacTommy

    Installing DBD::mysql on Mac OS X 10.6

    And also it says: Error: Can't load '/Users/mactommy/.cpan/build/DBD-mysql-4.020-NaxWTi/blib/arch/auto/DBD/mysql/mysql.bundle' Even though: $ ls -l /Users/mactommy/.cpan/build/DBD-mysql-4.020-NaxWTi/blib/arch/auto/DBD/mysql/mysql.bundle -rwxr-xr-x 1 root staff 428852 Sep 13 12:10...
  4. MacTommy

    Installing DBD::mysql on Mac OS X 10.6

    Yes, it does: $ ls -l /usr/local/mysql/lib/libmysqlclient.16.dylib -rwxr-xr-x 1 root wheel 4142080 Mar 14 2011 /usr/local/mysql/lib/libmysqlclient.16.dylib
  5. MacTommy

    Installing DBD::mysql on Mac OS X 10.6

    I seem to run into the same problems as others. I read the other threads on this forum but I can't seem to solve my problems. I am sorry if I overlooked something and double-posted. What I am trying to do is install DBD::mysql with cpan on Mac OS X 10.6.8 (64 bits). First, by the way, I...
  6. MacTommy

    Which Perl module for parsing ambiguous grammars?

    I am looking for a module that can parse ambiguous grammars and that gives me all the possible parse trees. Also, it should have 'actions'. I looked at Parse::Yapp and Parse::RedDescent which both look great, they have actions, but neither will give multiple solutions in case of ambiguity (or...
  7. MacTommy

    Issues Importing CSV file into MySQL database

    Something else you might want to look into is the MySQL documentation on loading data from a (possibly comma separated) file. That is way faster than using a script to do it line by line. http://dev.mysql.com/doc/refman/5.1/en/load-data.html And if you want to do it with a Perl script anyway...
  8. MacTommy

    String concatenation in replacement of preg_replace()

    Feherke you are an absolute king! This would never have occured to me anywhere in the (near) future. Thanks a lot! That still keeps me wondering though why ${1} doesn't work (nor ${01} for that matter). I thought that actually was meant for things like this (which was why I couldn't come up...
  9. MacTommy

    String concatenation in replacement of preg_replace()

    Oh yes, and if you do ">> $1 $iNewNeedle <<" as the replacement part (with a space (or a dot, or in fact any other non-variable symbol) in between the two) it does work...?!?
  10. MacTommy

    String concatenation in replacement of preg_replace()

    This is very weird... I have this piece of code: <?php $sString = "abc abc needle=567 def def"; $iNewNeedle = 123; print preg_replace("/(needle=)[0-9]+/", ">> $1$iNewNeedle <<", $sString); ?> It produces: abc abc >> 23 << def def The $1 ('needle=') part is gone, as is the first digit of...
  11. MacTommy

    Multisorting mixed associative arrays

    Yes. Thanks guys for all the suggestions!
  12. MacTommy

    Multisorting mixed associative arrays

    No, darrellblackhawk is right. It is not a bug, it is a documented feature. Though you might doubt its advantage of course.
  13. MacTommy

    Multisorting mixed associative arrays

    Yes, exactly. That is right of course. I was just wondering whether there would be a way I could force PHP to think of these indexes as strings rather than numbers, because I would rather not mess with the data (in the solution you sketched out I would have to keep track of when the appended...
  14. MacTommy

    Multisorting mixed associative arrays

    I am not sure if it is a bug or a feature but if I try the following code$aTest = array( '3 ' => array('a' => '3a', 'b' => '3b'), 'a' => array('a' => 'aa', 'b' => 'ab'), '5 ' => array('a' => '5a', 'b' => '5b') ); printArr($aTest); array_multisort(array_keys($aTest)...
  15. MacTommy

    Uploading files

    Thanks guys! I found out about the $_FILES['myFile']['error'] already but it didn't give one (an error, that is...). Probably because everything is fine. I just have to do something with the file before the script ends as jpadie says. That might be it because I have several scripts that work...

Part and Inventory Search

Back
Top