Using perl with cocoa

Hi
I know some perl and have managed to make a perl/apache/mysql application. I would like to use cocoa to make a gui application that can do the same stuff.
I have looked into camelbones and perlobjbridge and am finding it a bit difficult to decide what I should try and use.
Basically the cocoa app needs to query a mysql database and then display information from that database or make inserts or updates. I can do all of that with perl using dbi and as far as I can tell cocoa doesnt have a mysql library for querying etc. I did find that there is a commercial framework that can be bought for the mysql stuff but I would prefer to not use "commercial" stuff.
My knowledge of C and Objective-C is very limited ( a newbie if ever there was one). Installing framworks and libraries is not something I know anything about.
What I would like to know is which avenue of approach is probably the best for my project. Should I delve into camelbones or perlobjbridge or is there perhaps a better way? It would be nice to be able to use my perl knowledge but since I have to learn objective-C anyway its not necessary. I would ofcourse prefer a solution that is easy to package and install on other macos-x machines.
I'm not asking for anyone to do the project for me .. but being new its hard to make the initial choices so any pointers as to which direction I should go would be appreciated.
Thanks

You can always use the standard C client library that comes with MySQL. I am sure there are some freeware Objective-C wrappers out there somewhere. Still, the API is so simple that a wrapper is hardly necessary.

Similar Messages

  • Using perl with Oracle DB

    Hi,
    I have perl scripts to import csv data to an existing 9.2 oracle database 32bit. It is using DBI to connect. I am moving the database in question to 10gR2 windows X64. I want the scripts to follow and run on the new server.
    I know there is an install of perl in the oracle home. Is it intended to be used by oracle internally only?
    So my question is: should I install perl separately or could I use the one shipped with oracle?
    Best wishes!

    Of course.
    You are right if more modules are required, then adding them to the oracle perl would have potentially bad effects.
    The only thing I need really is to read files, call sqlloader, connect to the DB and run some stored procedures... I will be ok then. I already tested connectivity and it all looks fine.
    Thank you very much for the input!

  • Using perl with the HTTP POST method to exchange XML with the Auth service

    Has anyone written a perl script to do this yet?
    I've been trying all day and keep getting "Content is not allowed in prolog.
    I've used the example xml from the docs
    <?xml version="1.0" encoding="UTF-8"?>
    <AuthContext version="1.0">
    <Request authIdentifier="0">
    <NewAuthContext orgName="dc=exampleorg,dc=com">
    </NewAuthContext>
    </Request>
    </AuthContext>
    Then I read the python post at http://swforum.sun.com/jive/thread.jspa?forumID=79&threadID=22370
    and the error changed to Premature end of file.
    this is the portion of perl that is getting the error:
    use strict;
    use LWP::UserAgent;
    use HTTP::Request::Common;
    my $browser = LWP::UserAgent->new(agent => 'xml client');
    my $greeting = <<GREETING;
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="auth" reqid="1">
         <Request>
         <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
         <AuthContext version="1.0">
              <Request authIdentifier="0">
                   <NewAuthContext orgName="dc=belo,dc=com">
                   </NewAuthContext>
              </Request>
         </AuthContext>]]></Request>
    </RequestSet>
    GREETING
    my $response = $browser->request(POST 'http://idpoc1.test.belo.com/amserver/authservice',
                        Content_Type => 'text/xml',
                        Content     => [xmlRequest => $greeting]
    print $response->error_as_HTML unless $response->is_success;

    Your problem seems to lie in the build of the request. Here you use the "sample=$data" which will invalidate the XML itself. I've tested your code changing only the build of the Request and this works fine! Given an XML like this :
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <data>
         <txnInfo sourcePartnerCode="6" txnDate="2005.09.08"/>
         <unitOfWorkInfo sourceTicketID="SourceTicket_1" diaryEntry="Diray_1" Status="Status_OK"/>
    </data>
    The Server Stub should look like this :
    #!/usr/bin/perl
    use XML::Simple;
    use Data::Dumper;
    print qq{Content-type: text/xml\n\n};
    if($ENV{'REQUEST_METHOD'} eq "GET"){
         $my_data = $ENV{'QUERY_STRING'};
         print "jfghdsfjghsdg$my_data";
    } else {
         $data_length = $ENV{'CONTENT_LENGTH'};
         $bytes_read = read(STDIN, $my_data, $data_length);
         print "$bytes_read, $my_data";
         $xml = new XML::Simple (KeyAttr=>[]);
         print "have passed XML::Simple creation\n";
         $data = $xml->XMLin("$my_data");
         print "i want to be here \n";
         $transcode=$data->{txnInfo}->{sourcePartnerCode};
         #print "$data->{txnInfo}->{sourcePartnerCode}";
         print $transcode;
         CASE: {
              ($transcode==6) && do {
                   print "i am here";
                   $lstmoddat=$data->{txnInfo}->{txnDate};
                   $srctktid=$data->{unitOfWorkInfo}->{sourceTicketID};
                   $actvtylogdesc=$data->{unitOfWorkInfo}->{diaryEntry};
                   $status=$data->{unitOfWorkInfo}->{Status};
                   $command='bop_cmd -f update1.frg "upd_stats("""Administrator""","""'.$srctktid.'""","""FIP""","""what is this???""")"';
                   print "$lstmoddat $srctktid $status \n";
                   print "$command";
                   system("$command");
                   print "i am done";
                   last CASE;
    And the client stub should look like this :
    use LWP::UserAgent;
    use HTTP::Request;
    use IO;
    #use XML::Writer;
    my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30, );
    open INPUT, "<AcceptIncident.xml";
    my @greeting = <INPUT>; #-- Read file containing XML struct to send
    print "Hello World\n";
    my $data_to_send; #-- And build a string of it
    foreach my $newItem (@greeting) {
         $data_to_send = "$data_to_send$newItem";
    print "Sending \n";
    my $head = HTTP::Headers->new(Content_Type => "text/xml", "ID" => "sample");
    my $req = HTTP::Request->new('POST', 'http://matrix/cgi-bin/test1.pl', $head, "$data_to_send");
    my $response = $ua->request($req);
    print $response->as_string; Also you should make sure you have both HTTP::Request amd XML::Simple installed, orelse this will not work.
    Hope this is of some help to you.

  • Can I use Perl with Flex?

    I would like to run several Perl scripts from Flex. Following the only example I found online, I have the files/code listed below. The problem is, when I test locally, I get nothing as the message. When I upload to my server, I also get nothing as the message. Perl seems to be installed properly on the server. Other scripts in the directory run fine. Also, the Perl script below runs fine when I run it through command line. So... I'm very confused as to if this can even be done.
    main.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:Script>
         <![CDATA[
             private function onResult():void
                 txt.htmlText = txt.htmlText + "<br/>Msg1: " + xmlService.lastResult.messages["msg1"];
                 txt.htmlText = txt.htmlText + "<br/>Msg2: " + xmlService.lastResult.messages["msg2"];
         ]]>
         </mx:Script>
         <mx:HTTPService id="xmlService" result="onResult();" resultFormat="e4x" url="test_IO.pl" />
         <mx:Panel width="350" height="280" layout="absolute" horizontalCenter="0" verticalCenter="0" color="#000000" fontSize="12" fontFamily="Verdana">
             <mx:Button x="126.5" y="10" label="Test Me" click="xmlService.send();"/>
             <mx:TextArea x="10" y="42" width="310" height="188" id="txt" verticalScrollPolicy="on"/>
         </mx:Panel>
    </mx:Application>
    test_IO.pl
    #!/usr/bin/perl
    use strict;
    use XML::Writer;
    print "Content-type: text/xml\n\n"; 
    my $xml = new XML::Writer(); 
    $xml->startTag("root"); 
      $xml->startTag("messages"); 
        $xml->dataElement(msg1=> "Hello World"); 
        $xml->dataElement(msg2=> "Goodbye World"); 
        $xml->endTag(); 
        $xml->endTag(); 
    $xml->end();

  • Perl with MaxL

    Hi:I'm looking for a few "good" samples of using Perl with MaxL ... there are not many to be had in the Tech Ref ... I just want to perform some simple MaxL calls like running calcs etc. and would like to perform runtime error trapping ...

    Hi,They don't make it easy for us newbies to perl. The documentation just skims over the subject. I found the best place to start was with the Table.pl example given in the Perlmod/Samples directory. At the bottom, just rip out their code and put in yours, leaving all the subroutines. To trap errors, I add a line in the msgs subroutine *if ($level >=2){$fault = 1};* then in your routine put if ( ! ($fault == 1)) then continue sequence, else die or do something else.

  • Automation using perl?

    Hi All,
    We have a test automation framework build using perl. We want to automate a flex application and want to integrate it with this perl based framework. We cannot recompile the source code of this flex application.
    We can automate flex application using run time loading, similar to how Flexmonkey does it. I am unable to find anything that will enable such automation using Perl similar to how Funfx enables using Ruby programming.
    Any help in this regard will be much appreciated.
    Thanks,
    -Harshad

    It is a big SDK and to learn its features requires a lot of reading. But to start with I guess I should start with "Introduction to SDK".
    Since you want to control Acrobat from another application you should consider this under "Interapplication communication". You will be using OLE/COM.

  • Using perl DBI on Solaris 10 gives core dump

    I am using perl 5.8.4 which comes along with Solaris 10.
    I have installed DBI-1.58.
    Even a test command is not working.
    perl -MDBI -e 'print "$DBI::VERSION\n";'
    Bus Error (core dumped)
    truss perl -MDBI -e 'print "$DBI::VERSION\n";'
    shows
    stat("/usr/local/lib/libc.so.1", 0xFFBFE5D0) Err#2 ENOENT
    mprotect(0xFEED0000, 104171, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
    mprotect(0xFEED0000, 104171, PROT_READ|PROT_EXEC) = 0
    munmap(0xFF370000, 8192) = 0
    brk(0x000A2470) = 0
    brk(0x000A4470) = 0
    brk(0x000A4470) = 0
    brk(0x000A6470) = 0
    brk(0x000A6470) = 0
    brk(0x000A8470) = 0
    brk(0x000A8470) = 0
    brk(0x000AA470) = 0
    brk(0x000AA470) = 0
    brk(0x000AC470) = 0
    Incurred fault #5, FLTACCESS %pc = 0xFEED44CC
    siginfo: SIGBUS BUS_ADRALN addr=0x00000001
    Received signal #10, SIGBUS [default]
    siginfo: SIGBUS BUS_ADRALN addr=0x00000001
    $perl -v
    command shows like its compiled with Intsize of 64 is this creating problem?
    Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
    Platform:
    osname=solaris, osvers=2.10, archname=sun4-solaris-64int
    uname='sunos localhost 5.10 sun4u sparc SUNW,Ultra-2'
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    Compiler:
    cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO',
    optimize='-xO3 -xspace -xildoff',
    cppflags=''
    ccversion='Sun WorkShop', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
    Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE'
    cccdlflags='-KPIC', lddlflags='-G'
    Characteristics of this binary (from libperl):
    Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
    Locally applied patches:
    22667 The optree builder was looping when constructing the ops ...
    22715 Upgrade to FileCache 1.04
    22733 Missing copyright in the README.
    22746 fix a coredump caused by rv2gv not fully converting a PV ...
    22755 Fix 29149 - another UTF8 cache bug hit by substr.
    22774 [perl #28938] split could leave an array without ...
    22775 [perl #29127] scalar delete of empty slice returned garbage
    22776 [perl #28986] perl -e "open m" crashes Perl
    22777 add test for change #22776 ("open m" crashes Perl)
    22778 add test for change #22746 ([perl #29102] Crash on assign ...
    22781 [perl #29340] Bizarre copy of ARRAY make sure a pad op's ...
    22796 [perl #29346] Double warning for int(undef) and abs(undef) ...
    22818 BOM-marked and (BOMless) UTF-16 scripts not working
    22823 [perl #29581] glob() misses a lot of matches
    22827 Smoke [5.9.2] 22818 FAIL(F) MSWin32 WinXP/.Net SP1 (x86/1 cpu)
    22830 [perl #29637] Thread creation time is hypersensitive
    22831 improve hashing algorithm for ptr tables in perl_clone: ...
    22839 [perl #29790] Optimization busted: '@a = "b", sort @a' ...
    22850 [PATCH] 'perl -v' fails if local_patches contains code snippets
    22852 TEST needs to ignore SCM files
    22886 Pod::Find should ignore SCM files and dirs
    22888 Remove redundant %SIG assignments from FileCache
    23006 [perl #30509] use encoding and "eq" cause memory leak
    23074 Segfault using HTML::Entities
    23106 Numeric comparison operators mustn't compare addresses of ...
    23320 [perl #30066] Memory leak in nested shared data structures ...
    23321 [perl #31459] Bug in read()
    Built under solaris
    Compiled at Jul 26 2005 05:26:55
    @INC:
    /usr/perl5/5.8.4/lib/sun4-solaris-64int
    /usr/perl5/5.8.4/lib
    /usr/perl5/site_perl/5.8.4/sun4-solaris-64int
    /usr/perl5/site_perl/5.8.4
    /usr/perl5/site_perl
    /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int
    /usr/perl5/vendor_perl/5.8.4
    /usr/perl5/vendor_perl
    Other details:
    file /usr/bin/perl
    /usr/bin/perl: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
    I tried installing DBI module using perlgcc also.
    perlgcc Makefile.PL
    make
    make test
    make install.
    $uname -a
    SunOS twirl 5.10 Generic_118822-25 sun4u sparc SUNW,Ultra-80
    Please help me out.

    Try this guy's list, he maintain an archive of Solaris package.
    http://www.ibiblio.org/pub/packages/solaris/sparc/html/creating.solaris.packages.html
    Of course, if you can get directly from Sun will be better.

  • Can I use PERL in APEX

    Hi All
    can i use PERL language in APEX? is it gud practice to use PERL in APEX?
    Thanxs

    You can use PERL, in so much that you can forward on the user to a PERL application and have that PERL application take in the session + cookie and check it for validity in Oracle, but as far as interactivity between PERL and APEX, it would be either on the level of Web Services style access (one calling the other through web services type Http calls) or possibly running PERL code at system level with something like dbms_scheduler, were it to be for a background database task of some sort.
    My question would be what exactly do you need to do in PERL w/ APEX?
    -Richard

  • Building perl with suid enabled

    I am installing qmail and I want to use the qmail-scanner, but I need perl with suid.  What's the easiest way to do this?  To my knowledge, perl currently doesn't have this enabled in Arch.

    Here's the writeup from qmailrocks.org regarding perl and setuid...
    How you go about configuring and installing qmail-scanner from this point on depends on how you server's installation of Perl is configured. For the purposes of this installation, there are 2 Perl setups.
    1. Perl is configured to allow for setuid functions.
    2. Perl is not configured for setuid functionality and, in fact, does not permit it.
    I've tried both and they both fail, saying that I don't have setuid enabled.

  • How do you pass shell scripts with cocoa?

    How do you pass shell scripts with cocoa?

    You asked for more detail -- I don't know if this is what you were referring to or not, but here's a little more detail on how to use the system() function if that's what you wanted to know.
    As etresoft mentioned, the system() function can be useful for the kind of thing you are talking about. You will need to write the following statement at the top of your code if you want to use it:
    #include <stdlib.h>
    To use the system() function, simply put the command as you would write it in the Terminal between double quotes between the parenthesis. For example, something as simple as:
    system("ls");
    I don't what the practical use of the above statement would be, but it will run, and that's the general format for the system() function. So just put between the quotes whatever command you want to send.
    Hope there was something helpful here.

  • HT202667 Hi - My daughter was using her Apple TV until recently when she got a Smart TV.  Now the Apple TV is not needed so she passed it on to me.  How do I get it transferred over from her Home Sharing account to mine so that I can use it with my PC?

    Hi - My daughter was using her Apple TV until recently when she got a Smart TV.  Now the Apple TV is not needed so she passed it on to me.  How do I get her Home Sharing account transferred over to mine so that I can use it with my PC? Thanks!

    As  Winston Churchill wrote, however you might want to do a factory reset on the Apple TV.
    This way all information pertaining to your daughter will be removed from the device. Specifically if see was sign into any of the streaming service, Netflix, Hulu, etc. her credentials will still be associated with this Apple TV, doing  a factory reset will remove all that and make it as if you purchased the device and just plugged it in.
    regards

  • OPEN CURSOR using a WITH clause in the select query

    Hi,
    I am using Oracle 9i. I have a requirement where I have a REFCURSOR as an OUT parameter for my procedure. I have declared the TYPE and created the procedure.
    In the procedure, I am using OPEN <cursor_name> FOR <query>;
    Ideally this works in most of the cases that I have tried earlier. However, in the current case I am using a WITH clause in my query to get the results.
    I need help in understanding if the above mentioned syntax would not allow me to use the WITH clause in the query.

    What error do you get , seems to work ok for me on 10g
    SQL> begin
      2  open :cv for 'with x as (select * from emp)  select * from x';
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL> print :cv
         EMPNO
    ENAME
    JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7521
    WARD
    SALESMAN        7698 22-FEB-81       1250        500         30
          7566
    JONES
    MANAGER         7839 02-APR-81       2975                    20
         EMPNO

  • My iPhone 4 will not sync my new voice memos from the "Voice Memos" app to my computer. This is frustrating, should not be so hard, can someone please help. I use PC with windows 7 with iPhone version 6.1.3 and iTunes most recent. Thanks.

    My iPhone 4 will not sync my new voice memos from the "Voice Memos" app to my computer. This is frustrating, should not be so hard, can someone please help. I use PC with windows 7 with iPhone version 6.1.3 and iTunes most recent. Thanks.

    In the Music tab of iTunes, do you have 'Include Voice Memos' checked?

  • I ordered my Macbook Air with Aperture two years ago. I now have an iMac - can I use that with Aperture in any way?

    I ordered my Macbook Air with Aperture two years ago. I now have an iMac - can I use that with Aperture in any way? I appreciate that it is a different computer but I am now the end user of both devices and I was just wondering if it was possible.
    Thanks,
    Sean

    The answer would be in your software license agreement for Aperture. However if you cannot locate it you can ask in the Aperture forum, the link for that is:
    https://discussions.apple.com/community/professional_applications/aperture
    However I believe you can have Aperture installed on two machines however only one may be using it at a time.
    On the new iMac launch the Mac App Store - Purchased - look for Aperture and download to your new machine.

  • How do I use LDAP with iMQ 2.0?

    I am looking for an example to see how to use LDAP with iMQ 2.0.
    I was able to set up the config settings to access a local LDAP,
    but iMQ authentication still rejects valid logins.
    Let me know if I can find more info someplace.

    You can also find an example I put togther in the Sun One knowledge base.
    If you go here:
    http://knowledgebase.iplanet.com/NASApp/ikb/index.jsp
    Search for article 7772
    Alternatively here is the direct link
    http://knowledgebase.iplanet.com/ikb/kb/articles/7772.html

Maybe you are looking for

  • Exchange Rate Type M in MIRO

    Hi We have some issue  in exchange rate . When i am doing MIRO this time i have geeting error enter rate  / USD rate type M for 04.12.2009 in system setting.we have process different types Invoices with different currency in Miro to get this error me

  • How can I insert a link to an image file into numbers

    I wish to include access to images in a numbers spreadsheet without actually inserting the images. Doing this where the image is a web page is not difficult but these images are on my local drive. I tried dropping an image file onto Safari ( the imag

  • Screen sharing to OS X Lion Server with non-admin account

    I have set up a Lion Server with one admin (in addition to the root user) and several non-admin normal accounts. In Server.app, I have enabled remote login with ssh, and remote management via screen sharing.  I am unable to use Screen Sharing to conn

  • Text cannot be displayed right

    Helly Guys, I am a new mac user and I have transfered all my mails from MS Outlook 2007 for windwos to Mac Mail program successfully. However, some of the messages appeared as shown: "Ð&#151;дÑ&#128;авейÑ&#130;е, Ð&#152;зпÑ&#128;аÑ&#137;ам

  • How to convert data when transferring from one table to another

    I have two tables and these are the structure of the tables create table E1( ID NUMBER ,NAME VARCHAR2(30) , DESIGNATION VARCHAR2(30) ,GENDER VARCHAR2(10)); create table E2( ID NUMBER ,NAME VARCHAR2(30) , DESIGNATION VARCHAR2(3) ,GENDER NUMBER); Now I