Perl Script Execution

Is there a way to execute a Perl/Cgi scripts in Cold fusion Built in Server. Actually I have tested my scripts in Apache Server by putting my cgi scripts in cgi-bin but in the Coldfusion built in Server we are having does not contain a cgi-bin. So what is the alternate way that can be used to execute a cgi script in the cold fusion built in Server.

What do you want to execute the Perl?  The web server or the application server?
I don't know if the built in web server can execute Perl|CGI, I have never heard of it.  I would not be surprised if it did NOT do this.  The built-in server is intended for development and testing of ColdFusion application code.  Thus it is not a full featured web server and not intended to be used in a production enviornment.
But if you want to execute Perl code as part of a ColdFusion application, the <cfexecute....> command is perfectly capable of doing this from the applciation server.  That means the resulst of the Perl code, if there are any, are returned to the ColdFusion application domain rather then the user domain that would happend if the CGI code was been executed by the web server.

Similar Messages

  • Perl Script execution causes system panic

    Hi All,
    I'm using a Perl script of my own for work purpose.The script was running fine yesterday,until today morning I have updated the XCode to 4.6.2.
    Everytime I execute the script,my computer turns off and resatarts with system panic.
    Here are the error report content.
    Interval Since Last Panic Report:  974 sec
    Panics Since Last Report:          3
    Anonymous UUID:                    AE85B099-0AAA-B563-0607-3EFA733CAEDF
    Thu Apr 18 15:08:18 2013
    panic(cpu 0 caller 0xffffff8018d1edba): "negative open count (c, 16, 2)"@/SourceCache/xnu/xnu-2050.22.13/bsd/miscfs/specfs/spec_vnops.c:1813
    Backtrace (CPU 0), Frame : Return Address
    0xffffff80b3db3c20 : 0xffffff8018c1d626
    0xffffff80b3db3c90 : 0xffffff8018d1edba
    0xffffff80b3db3cd0 : 0xffffff8018d23c46
    0xffffff80b3db3d20 : 0xffffff8018d10cb6
    0xffffff80b3db3d60 : 0xffffff8018cf08a1
    0xffffff80b3db3db0 : 0xffffff8018cf0021
    0xffffff80b3db3df0 : 0xffffff8018cf0b9e
    0xffffff80b3db3e20 : 0xffffff8018d1100f
    0xffffff80b3db3e50 : 0xffffff8018f55b8d
    0xffffff80b3db3ec0 : 0xffffff8018c39ce9
    0xffffff80b3db3ef0 : 0xffffff8018c3c7e8
    0xffffff80b3db3f20 : 0xffffff8018c3c65e
    0xffffff80b3db3f50 : 0xffffff8018c1b70d
    0xffffff80b3db3f90 : 0xffffff8018cb84a3
    0xffffff80b3db3fb0 : 0xffffff8018ccd4ac
    BSD process name corresponding to current thread: ssh
    Mac OS version:
    12D78
    Kernel version:
    Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64
    Kernel UUID: 3EB7D8A7-C2D3-32EC-80F4-AB37D61492C6
    Kernel slide:     0x0000000018a00000
    Kernel text base: 0xffffff8018c00000
    System model name: MacBookPro4,1 (Mac-F42C89C8)
    System uptime in nanoseconds: 1213636802424
    last loaded kext at 70392580239: com.apple.filesystems.smbfs          1.8 (addr 0xffffff7f9ae0b000, size 229376)
    last unloaded kext at 168892078080: com.apple.iokit.IOSCSIBlockCommandsDevice          3.5.5 (addr 0xffffff7f992ca000, size 90112)
    loaded kexts:
    foo.tun          1.0
    foo.tap          1.0
    com.apple.filesystems.smbfs          1.8
    com.apple.driver.AppleBluetoothMultitouch          75.19
    com.apple.driver.AppleHWSensor          1.9.5d0
    com.apple.filesystems.autofs          3.0
    com.apple.driver.DiskImages.ReadWriteDiskImage          345
    com.apple.driver.DiskImages.RAMBackingStore          345
    com.apple.driver.AudioAUUC          1.60
    com.apple.driver.IOBluetoothSCOAudioDriver          4.1.3f3
    com.apple.iokit.IOBluetoothSerialManager          4.1.3f3
    com.apple.driver.AppleHDA          2.3.7fc4
    com.apple.iokit.BroadcomBluetoothHCIControllerUSBTransport          4.1.3f3
    com.apple.iokit.IOUserEthernet          1.0.0d1
    com.apple.Dont_Steal_Mac_OS_X          7.0.0
    com.apple.driver.ApplePolicyControl          3.3.0
    com.apple.driver.AppleLPC          1.6.0
    com.apple.driver.AppleUpstreamUserClient          3.5.10
    com.apple.driver.AppleSMCPDRC          1.0.0
    com.apple.driver.AppleSMCLMU          2.0.3d0
    com.apple.GeForce          8.1.0
    com.apple.driver.AppleBacklight          170.2.5
    com.apple.driver.AppleMCCSControl          1.1.11
    com.apple.driver.ACPI_SMC_PlatformPlugin          1.0.0
    com.apple.driver.SMCMotionSensor          3.0.3d1
    com.apple.driver.AppleUSBTCButtons          237.1
    com.apple.driver.AppleUSBTCKeyboard          237.1
    com.apple.driver.AppleIRController          320.15
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless          1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib          1.0.0d1
    com.apple.BootCache          34
    com.apple.driver.XsanFilter          404
    com.apple.iokit.IOAHCIBlockStorage          2.3.1
    com.apple.driver.AppleIntelPIIXATA          2.5.1
    com.apple.driver.AppleAHCIPort          2.5.1
    com.apple.driver.AppleSmartBatteryManager          161.0.0
    com.apple.driver.AppleUSBHub          5.5.5
    com.apple.driver.AirPortBrcm43224          600.36.17
    com.apple.driver.AppleFWOHCI          4.9.6
    com.apple.iokit.AppleYukon2          3.2.3b1
    com.apple.driver.AppleUSBEHCI          5.5.0
    com.apple.driver.AppleUSBUHCI          5.2.5
    com.apple.driver.AppleEFINVRAM          1.7
    com.apple.driver.AppleRTC          1.5
    com.apple.driver.AppleHPET          1.8
    com.apple.driver.AppleACPIButtons          1.7
    com.apple.driver.AppleSMBIOS          1.9
    com.apple.driver.AppleACPIEC          1.7
    com.apple.driver.AppleAPIC          1.6
    com.apple.driver.AppleIntelCPUPowerManagementClient          196.0.0
    com.apple.nke.applicationfirewall          4.0.39
    com.apple.security.quarantine          2
    com.apple.driver.AppleIntelCPUPowerManagement          196.0.0
    com.apple.driver.IOBluetoothHIDDriver          4.1.3f3
    com.apple.driver.AppleMultitouchDriver          235.29
    com.apple.kext.triggers          1.0
    com.apple.driver.DiskImages.KernelBacked          345
    com.apple.iokit.IOSerialFamily          10.0.6
    com.apple.driver.DspFuncLib          2.3.7fc4
    com.apple.iokit.IOAudioFamily          1.8.9fc11
    com.apple.kext.OSvKernDSPLib          1.6
    com.apple.iokit.AppleBluetoothHCIControllerUSBTransport          4.1.3f3
    com.apple.driver.AppleHDAController          2.3.7fc4
    com.apple.iokit.IOHDAFamily          2.3.7fc4
    com.apple.iokit.IOSurface          86.0.4
    com.apple.iokit.IOBluetoothFamily          4.1.3f3
    com.apple.iokit.IOFireWireIP          2.2.5
    com.apple.driver.AppleGraphicsControl          3.3.0
    com.apple.driver.AppleBacklightExpert          1.0.4
    com.apple.driver.AppleSMBusController          1.0.11d0
    com.apple.driver.IOPlatformPluginLegacy          1.0.0
    com.apple.driver.IOPlatformPluginFamily          5.3.0d51
    com.apple.nvidia.nv50hal          8.1.0
    com.apple.NVDAResman          8.1.0
    com.apple.iokit.IONDRVSupport          2.3.7
    com.apple.iokit.IOGraphicsFamily          2.3.7
    com.apple.driver.AppleSMC          3.1.4d2
    com.apple.driver.AppleUSBMultitouch          237.3
    com.apple.iokit.IOUSBHIDDriver          5.2.5
    com.apple.driver.AppleUSBMergeNub          5.5.5
    com.apple.driver.AppleUSBComposite          5.2.5
    com.apple.iokit.IOSCSIArchitectureModelFamily          3.5.5
    com.apple.iokit.IOATABlockStorage          3.0.2
    com.apple.iokit.IOATAFamily          2.5.1
    com.apple.iokit.IOAHCIFamily          2.3.1
    com.apple.iokit.IOUSBUserClient          5.5.5
    com.apple.iokit.IO80211Family          522.4
    com.apple.iokit.IOFireWireFamily          4.5.5
    com.apple.iokit.IONetworkingFamily          3.0
    com.apple.iokit.IOUSBFamily          5.5.5
    com.apple.driver.AppleEFIRuntime          1.7
    com.apple.iokit.IOHIDFamily          1.8.1
    com.apple.iokit.IOSMBusFamily          1.1
    com.apple.security.sandbox          220.2
    com.apple.kext.AppleMatch          1.0.0d1
    com.apple.security.TMSafetyNet          7
    com.apple.driver.DiskImages          345
    com.apple.iokit.IOStorageFamily          1.8
    com.apple.driver.AppleKeyStore          28.21
    com.apple.driver.AppleACPIPlatform          1.7
    com.apple.iokit.IOPCIFamily          2.7.3
    com.apple.iokit.IOACPIFamily          1.4
    com.apple.kec.corecrypto          1.0
    Model: MacBookPro4,1, BootROM MBP41.00C1.B03, 2 processors, Intel Core 2 Duo, 2.4 GHz, 5 GB, SMC 1.27f3
    Graphics: NVIDIA GeForce 8600M GT, GeForce 8600M GT, PCIe, 256 MB
    Memory Module: BANK 0/DIMM0, 1 GB, DDR2 SDRAM, 667 MHz, 0xCE00000000000000, 0x4D342037305432393533455A332D43453620
    Memory Module: BANK 1/DIMM1, 4 GB, DDR2 SDRAM, 667 MHz, 0x2C00000000000000, 0x3136485453353132363448592D3636374131
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8C), Broadcom BCM43xx 1.0 (5.10.131.36.16)
    Bluetooth: Version 4.1.3f3 11349, 2 service, 18 devices, 1 incoming serial ports
    Network Service: Ethernet, Ethernet, en0
    Serial ATA Device: KINGSTON SV300S37A120G, 120.03 GB
    Parallel ATA Device: ST9500420AS, 500.11 GB
    USB Device: Built-in iSight, apple_vendor_id, 0x8502, 0xfd400000 / 2
    USB Device: USB Receiver, 0x046d  (Logitech Inc.), 0xc52b, 0x1a200000 / 3
    USB Device: BRCM2046 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x1a100000 / 2
    USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x820f, 0x1a110000 / 4
    USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0230, 0x5d200000 / 3
    USB Device: IR Receiver, apple_vendor_id, 0x8242, 0x5d100000 / 2
    I can't currently use my script because of this and it is very crucial for me.
    Anyone has any idea why this is happening?
    Thanks in advance!

    rsonnens wrote:
    Etresoft, Yes you are correct I did post the same link. Sorry that I did not notice it. However, as Gajillion also noted in his post, it is a kernel timing/race condition bug and NOT a 3rd party extension bug and can only be fixed by Apple. There is nothing someone can practically do to workaround the issue.
    My suggestion for everyone having this issue is to entering a case into Apple's bug tracking system, and every time you get the error also be sure that you allow the reporter app to send the info to Apple.
    No one is having this issue. The only people who have reported it have extensive 3rd party software installations. I have never seen a Perl-induced kernel panic on my Mac and I do some really crazy things with Perl - SOAP servers routed through launcd with my own transport protocols. No panics.
    You are free to send in any panic or bug reports to Apple, should they arise. But I am quite confident that anyone encoutering such a problem really can't be said to be running OS X anymore. Once you make that many modifications, it is some hybrid Linux-style monster. And yes, such things panic if you look at them the wrong way - just like Linux.

  • Gui freezes during execution of a perl script which is never completed

    Dear Java programmers,
    I'm running a perl script which takes a few minutes to finish from a GUI. But when the execution reaches a point, it suddenly seems to stop and the GUI becomes irresponsive. Submitting the perl script to run as a separate thread to release the button doesn't make any different either. Is there any restriction in the time that swing allows external programs to run?
    thanks in advance,
    Tom

    tevang2 wrote:
    I'm running a perl script which takes a few minutes to finish from a GUI. But when the execution reaches a point, it suddenly seems to stop and the GUI becomes irresponsive. Then you're tying up the Swing EDT, the event dispatch thread, which is the single thread responsible for drawing the Swing app and responding to user input.
    Submitting the perl script to run as a separate thread to release the button doesn't make any different either. Is there any restriction in the time that swing allows external programs to run?None that I know of. I still have to wonder if you are creating a background thread properly because even if your perl script gets locked, if you are running it on a background thread, the Swing app shouldn't lock up.

  • Execution of Perl Script from HTML DB page.

    Hi All,
    I have a Perl script which takes 5 parameters and fetches data from one database and insert that data into my database table which is a master table for my project.
    Is there any way to execute the perl script from a HTMLDB page by passing parameters.
    Pls. provide me inputs if any.
    Thanks & Regds.
    Kumaraswamy RJ.

    Check out MOS note 1515609.1.
    Regards,
    - Loc

  • In Web Server 6.0 during the execution of a Perl Script, the software send the error "Cannot execute CGI script......unable to sewt group".

     

    Hi Pablo,
    Its bcos Your web server has been misconfigured. It doesn't know that it should execute your Perl program, so it's just returning the error to the browser.
    Assuming that u use solaris 2.8. Generally the path for the perl in solaris is #!/usr/bin/perl .make sure u have included this in ur first line of the perl programs.[if not enter the exact location of the perl interpretor]
    Now follow these steps:
    *First Part
    First create a cgi folder mycgi-bin( follow this example please) say u create mycgi in /usr folder (solaris). so the path becomes '/usr/mycgi-bin'. set
    appropriate permissions say set chmod to 755. to make it executable. Then
    (1)Goto Programs tab in IWS (iplanet web server) .
    (2)choose cgi-directory drom left frame.
    (3)CGI Directory Add another CGI Directory
    URL prefix: mycgi-bin
    CGI directory: /usr/mycgi-bin
    (4) click 'OK' and click 'apply' to save changes and restart the server.
    * Second Part:
    1.In the Server Administrator, click Server preferences, then select 'MIME Types' from the frame on the left.
    2.If you want to use .pl as the extension for Perl scripts, find and remove the application/x-perl MIME type (this is mapped to .pl by default). (remove it).
    3.Add a new MIME Type with 'magnus-internal/mycgi-bin' (type this exactly ie magnus-internal/cgidirectory url prefix) as the Content Type, and pl as the File Suffix.
    4.Save and apply these changes, then re-start the server.
    5 .Put a sample perl file in mycgi-bin directory say sample.pl and access http://yourserver:port/mycgi-bin/sample. pl
    *If you are having trouble running Perl scripts on your iPlanet server, check the following:
    * Ensure that the script is readable by the account used by the iPlanet service.Generally, this means you should make the script readable by the Everyonegroup.
    * Ensure that all supporting files, like the perl binary files, the perl library files, and the modules that you use, are all readable by the account used by the iPlanet service (i.e., the Everyone group).
    It should work now,
    Regards,
    T.Raghulan

  • Best method for timestamping? (for later use with perl script)

    What is the best method that I can use to timestamp events in Linux for later use with perl script?
    I am performing some energy measurements.. where I am running several tasks separated by 20 secs in between. Before I start any execution of tasks, I always place initial delay for me to start the script and start the measurement device.
    My problem is that I don't know how long is that first delay exactly. So to solve this, I thought I could use date commands to time stamp all tasks.. or at least to timestamp first dela.
    Here is example of what I am doing:
    1st delay
    task 1
    20s
    task 2
    20s
    task 3..... etc
    What would be the best to use?

    logger.
    It posts messages straight to the system log.  You can see the message, in all its glory using tools like journalctl.  You will see the message, the date, time, host name, user name, and the PID of logger when it ran.

  • PERL script on Solaris

    My ISP is running on solaris. I have place a PERL (.pl) script which will fire a mail. He says 'Sendmail' is configured and I can create any folder and place my script and system will recognize is automatically. As we know, all the web servers will have 'cgi-bin' directory where the .pl or .cgi files will be placed for execution. My ISP tells me that he has configured the server in such a way that I can create a 'cgi' directory anywhere and can run it from the browser. I am unable to do it. Tell me how I can do it.

    Unfortunately this stupid perl script isn't that
    easy. It uses Rational cqperl, then some libraries
    and modules I don't understand. I can't even find
    the actual code it uses that uses flexlm.
    That's why I was asking what is different with java
    1.2 and java 1.4. Is there some way that Runtime
    acts differently?Not in any fundamental way that I am aware of.
    The fact that the script is running at all though tells me that the problem is on the PERL side of things. I suspect that some of those modules and libraries are not being loaded correctly or the same way on both systems.
    I fear the answer is that you need to figure out what components the script needs to run and make sure that it has them under all circumstances. This is like a classpath problem except it is with your PERL script so you need to solve it as a PERL problem.
    Again if it wasn't running at all that would be one concern but it is running just not finding all it's bits.. a problem of that nature strongly indicates that the issue is happening once the process has already been spawned (correctly) and so is out of the realm of the Java part of your program.

  • Calling the DTExec from Perl Script and need to get the Return Value (Sucess or Failure)

    I am able to execute the SSIS Package from Perl Script using DTExec. But i need to get the return code of the SSIS Execution. Is their any option available to get the Success or Failure information from Perl ?

    Exit codes returned from dtexec utility             
    When a package runs, dtexec can return an exit code. The exit code is used to populate the ERRORLEVEL variable, the value of which can then be tested in conditional statements or branching logic within a batch file. The following table lists
    the values that the dtexec utility can set when exiting.
    http://technet.microsoft.com/en-us/library/hh231187.aspx
    There's a wrinkle if the package is running in the SSIS Catalog:
    http://www.mattmasson.com/2012/02/exit-codes-dtexec-and-ssis-catalog/
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Execute a shell or perl script

    Is it possible to execute a unix(solaris) shell script or perl script from a stored procedure. If so, a short example would be great.
    Thanks,
    John

    External Procedure Source Code
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    void sh(char *);
    void sh( char *cmd )
    int num;
    num = system(cmd);
    Issue the following commands to compile the code and generate the shared
    object in Solaris:
    cc -G -c shell.c
    ld -r -o shell.so shell.o
    You can also use the demo_rdbms.mk makefile to build shared libraries for use in external procedures. Using this method insulates you from any Operating System specific dependencies (e.g., which flags to use
    for ld).
    For example:
    In 8.0.X,
    $ make -f demo_rdbms.mk extproc_nocallback \
    SHARED_LIBNAME=shell.so OBJS=shell.o
    In 8.1.X,
    $ make -f demo_rdbms.mk extproc_no_context \
    SHARED_LIBNAME=shell.so OBJS=shell.o
    Library Definition
    CREATE LIBRARY shell_lib is '/u11/home/lsupport/proc/shell.so';
    Note: The directory in quotes is the current of location of the library that
    was created in the steps above.
    PL/SQL Wrapper Procedure
    create or replace procedure shell(cmd IN char)
    as external
    name "sh"
    library shell_lib
    language C
    parameters (cmd string);
    Execution
    SQL> exec shell('ls');
    cli.trc exe_prba.sql prueba.mk shell.c.old
    core listener.old prueba.o shell.o
    dec2bin.c listener.ora prueba.so shell.so
    dec2bin.c.old nena.lst prueba.sql shell.sql
    dec2bin.o p.sql sal.1 shell.sql.old
    dec2bin.so pepito.lst sal.2 sqlnet.log
    dec2bin.sql prb sal.3 tnsnames.ora
    dec2bin.sql.old prb.c salida.lst tnsnames.ora.old
    envoltorio.sql prueba.c shell.c uno.sql
    PL/SQL procedure successfully completed.

  • Folder Action to Launch Perl Script

    Hello.
    I wrote a perl script which I wanted to execute when a file was dropped into a folder. I added a folder action with a very simple applescript:
    on adding folder items to this_folder after receiving added_items
    do shell script ¬
    ("perl /Users/Alexander/Library/Scripts/gte2.pl")
    end adding folder items to
    The folder action didn't do anything, any thoughts on what I'm doing wrong? Note, the perl script works fine when I run it from the terminal.
    thanks.

    Thanks Camelot, I appreciate the help. My script below is trying to read data from a file in folder in my system. So I will try your suggestion, I didn't realize the environment and path my be different.
    Regards Alex
    #!/usr/bin/perl -w
    #This program is to convert files from gamin running GPS watch to text file which can be loaded into excel.
    # To make executable, remember to set: chmod u+x <file>
    #set all the flags. Note the flags are used to stop the matching
    $i = 1; $k = 0; $start = "no";
    #Open data file and find values
    open(DATA,"/Users/Alexander/Alex's Misc/Health/Garmin_Conversion/run.tcx") || die "Couldn't open file*\n";
    #read in the data line by line until "end of file"
    while (<DATA>){
    #start parsing for information to keep
    if (/.<Id>./) {
    @Idline=split(/>/);
    @Idbeat=split(/T/,$Idline[1]);
    $Id=$Idbeat[0];
    if (/.<Track>./){
    $start = "yes";
    if ($start eq "yes"){
    if (/.<Time>./) {
    @timeline=split(/T/);
    @timebeat=split(/Z/,$timeline[2]);
    $Time[$i]=$timebeat[0];
    elsif (/.<LatitudeDegrees>./) {
    @HRline=split(/>/);
    @HRbeat=split(/</,$HRline[1]);
    $Latitude[$i]=$latbeat[0];
    elsif (/.<LongitudeDegrees>./) {
    @longline=split(/>/);
    @longbeat=split(/</,$longline[1]);
    $Longitude[$i]=$longbeat[0];
    elsif (/.<AltitudeMeters>./) {
    @altline=split(/>/);
    @altbeat=split(/</,$altline[1]);
    $Altitude[$i]=$altbeat[0];
    elsif (/.<DistanceMeters>./) {
    @distline=split(/>/);
    @distbeat=split(/</,$distline[1]);
    $Distance[$i]=$distbeat[0];
    elsif (/.<Value>./) {
    @HRline=split(/>/);
    @HRbeat=split(/</,$HRline[1]);
    $HR[$i]=$HRbeat[0];
    $i++;
    } #string matching
    } #if start flag is yes
    } #while data loop
    close (DATA) || die "couldn't close file.\n";
    #write all data to file in space delimited format
    open (NEWFILE, ">/Users/Alexander/Alex's Misc/Health/Garmin_Converted/$Id run") || die "can't create file.\n";
    $Time[0]="Time"; $Latitude[0]="Latitude"; $Longitude[0]="Longitude"; $Altitude[0]="Altitude"; $Distance[0]="Distance"; $HR[0]="HR";
    print NEWFILE "0 $Time[0] $Latitude[0] $Longitude[0] $Altitude[0] $Distance[0] $HR[0]\n";
    for ($j = 1; $j <= $i; $j++) {
    $k=$j+1;
    print NEWFILE "$j $Time[$j] $Latitude[$j] $Longitude[$j] $Altitude[$j] $Distance[$j] $HR[$j]\n";
    } #for j loop
    close (NEWFILE) || die "couldn't close newfile.\n";
    #This is the end of the program

  • How to launching a perl script by the "begin" script of a jumpstart

    Hi all,
    i have an urgent pb with my solaris jumpstart, let me explain to you :
    i want that the begin script launch some perl script, but i have a problem
    here is my "begin" script:
    echo "Begining ISO FLAR based jumpstart."
    echo ""
    echo "Starting Ullink Configuration"
    env > /tmp/env
    /bin/sh << EOF
    /usr/bin/perl /cdrom/.archives/admin-scripts/sethostname.pl
    EOFmy perl script use a STDIN
    with this configuration, the perl script is launching but it runs in a loop indefinitely with an error "use of uninitialized value", because (i think) a value is return to the begin scritp and not to the perl script.
    well, on a pre-installed solaris, if a launch the begin script, it happens the same thing, it runs in a loop, BUT if i comment the line "/bin/sh <<EOF" and "EOF", it works.
    at this step, i say "ok it's cool my script is working", but when i use it during the jumpstart instalaltion, the perl script does not start, without any particular error.
    here is my perl script, if you want to test :
    #!/usr/bin/perl -w^M
    # Set Hostname for Ullink Jumpstart^M
    ^M
    use strict;^M
    ^M
    sub hit_enter {^M
        print "Hit enter to continue\n";^M
        <STDIN>;^M
        print "\033[2J";^M
    }^M
    ^M
    sub get_hostname {^M
        my %towns_list = (^M
            'Paris' => 'PA',^M
            'New-York' => 'NY',^M
        );^M
    ^M
        my %sites_list = (^M
            'Office' => 'OFC',^M
            'Redbus' => 'RED',^M
            'Telehouse' => 'TLH',^M
            'DTC' => 'DTC',^M
            'iAdvantage' => 'IAD',^M
            'Nutley' => 'NUT',^M
            'Level3' => 'LV3',^M
            'Equinix' => 'EQX',^M
            'Tata' => 'TAT',^M
            'Switch-data' => 'SWI',^M
            );^M
    ^M
        my %usage_list = (^M
            'Production' => 'PRD',^M
            'UAT' => 'UAT',^M
            'DMZ' => 'DMZ',^M
        );^M
    ^M
        sub select_list {^M
            my $counter=-1;^M
            my %hash_list = @_;^M
            my @keys = keys %hash_list;^M
    ^M
            # Clear screen^M
            print "\033[2J";^M
            print "In which country this machine is hosted or will be host and will be used ?\n\n";^M
    ^M
            # Get all keys from hash^M
            my $key;
            while ($key = each %hash_list ) {^M
                $counter++;^M
                print "$counter - $key\n";^M
            }^M
    ^M
            print "\nChoose the number corresponding to your choice :\n";^M
            my $choice_number;
            chomp ($choice_number = <STDIN>);^M
    ^M
            # Verify answer^M
            if (($choice_number =~ /\d+/) and ($choice_number <= $counter)) {^M
                # Add choice to chosen hostname^M
                my $chosen=$hash_list{$keys[$choice_number]};^M
                return $chosen;^M
            } else {^M
                print "\nYour answer is not correct, you need to enter a number between 0 and $counter\n";^M
                &hit_enter;^M
                &select_list;^M
            }^M
        }^M
    ^M
        sub srv_number {^M
            print "\033[2J";^M
            print "What is the server number ?\n";^M
            my $server_number;
            chomp ($server_number = <STDIN>);^M
            if ($server_number =~ /\d+/) {^M
                return $server_number;^M
            } else {^M
                print "\nYour answer is not correct, you need to enter a number\n";^M
                &hit_enter;^M
                &srv_number;^M
            }^M
        }^M
    ^M
        my $full_hostname = &select_list(%towns_list).'-';^M
        $full_hostname = $full_hostname.&select_list(%sites_list).'-';^M
        $full_hostname = $full_hostname.'SRV-';^M
        $full_hostname = $full_hostname.&select_list(%usage_list).'-';^M
        $full_hostname = $full_hostname.&srv_number;^M
    ^M
        sub write_hostname2tmp {^M
            open (HOSTNAME, ">/tmp/set_hostname") or warn "Couldn't write $_[0] to temp file : $!\n";^M
                print HOSTNAME "$_[0]\n";^M
            close (HOSTNAME);^M
        }^M
    ^M
        print "\033[2J";^M
        print "Is $full_hostname the correct name for this server ? (y/n)\n";^M
        if (<STDIN> =~ /y|yes/i) {^M
            &write_hostname2tmp($full_hostname);^M
        } else {^M
            print "Would you like to retry (r) or set manually the hostname (s) ? (r/s)\n";^M
            if (<STDIN> =~ /s/i) {^M
                print "Type the full required name and hit enter when finished :\n";^M
                chomp ($full_hostname = <STDIN>);^M
                &write_hostname2tmp;^M
            } else {^M
                &get_hostname;^M
            }^M
        }^M
    }^M
    ^M
    # Start configuration^M
    print "\033[2J";^M
    print "\n########################################################\n";^M
    print "#\t\t\t\t\t\t       #\n";^M
    print "#\t\t\tULLINK\t\t\t       #\n";^M
    print '#  Solaris Environnement Installation for Datacenters  #';^M
    print "\n#\t\t\t\t\t\t       #";^M
    print "\n########################################################\n\n";^M
    print "Before starting installation, you need to enter a set of informations.\n(answer to all questions, you can Ctrl+C to stop now)\n\n";^M
    &hit_enter;^M
    ^M
    &get_hostname;^Mthank for your help
    Edited by: ullink on Jun 25, 2009 6:05 AM

    Hi Manju,
    You can try the following command and check if any helps:
    Get-Exchangeserver |where-object{$_.AdminDisplayVersion -like "Version 15*"} |Get-MailboxStatistics | Ft -auto -wrap DisplayName,database,servername,*size*,*time*
    Best regards,
    Niko Cheng
    TechNet Community Support

  • Runtime.exec("Perl Script writing and reading on I/O"), handling Streams

    Hi all !!
    In a first place : sorry for my english if it's not really understandable but I try to do as good as possible !
    I'm writing a GUI with Swing that will allow (in one of my multiple tables) the user to run a Perl Script.
    This Perl Script ask the user to choose a Folder ... then read all the files in this folder and for each file (xml File), extract the datas and put them in a database. But when a file that has to be inserted in the database contains this line : <Template_Used name="ST1.mtt"> and if the Template table in my database doesn't have the "ST1.mtt" stored ... the Perl Script ask to the user to give him the path of the file "ST1.mtt" so that the script can put the "ST1.mtt template" datas in the database.
    This script runs well when it is from a windows console.
    But I need a graphic interface !!!
    So I created a JButton "Process a folder".
    When the button is pressed, a JFileChooser appears and ask the user which Folder has to be processed.
    Then a Process is created with the command : ("cmd.exe /C \"C:\\Program Files\\Fluke\\Ansur\\ProcessFolder.bat\").
    The BatFile :
    {code}cd C:\Documents and Settings\tsd\Desktop\Gael-Project\Project_Files
    perl Process.pl
    exit{code}
    At this moment everything is working well.
    But my Process.pl (which is 300 lines long ... and that you don't even want to hear about), ask in a first time the Path of the folder to process and sometimes ask the path to a file (a template file).
    So I need to read and wirte on the STDIN/STDOUT during the exec of the Process.
    In order to handle this I created two different threads : one reading the Process.getInputStream with a BufferedReader and one other writing on the Process.getOutputStream with a PrintWrinter.
    What I need to do is :
    When I read a line from the InputStream saying "I need the path of the ST1.mtt file", I should run a JFileChooser ... the user find the file in the computer ... and I write in the OutputStream the path of the file, so that my Perl Script doesn't have un Unitialised value on <STDIN> and can continue to process !!
    I'm pretty sure it's possible ... because at the moment I just used a trick :
    When the user push the "process a folder" button, I write the paths in the OutputStream before than the script needs it and it works !
    But I need to write in the OutputStream only when it is time !!!
    Any idea ??
    Here are some parts of my code :
    {code}
    String filename = File.separator+"tmp";
              JFileChooser fc = new JFileChooser(new File(filename));
              fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY );
              // Show open dialog; this method does not return until the dialog is closed
         fc.showOpenDialog(null);
         Folder = fc.getSelectedFile();
              new GoodExec(cmd);
    {code}
    {code}
    public class GoodExec {
         public static Process proc;
         public static StreamGobbler errorGobbler;
         public static StreamGobbler inputGobbler;
         public static StreamGobbler outputGobbler;
         public GoodExec(String cmd)
         try
                   Runtime rt = Runtime.getRuntime();
              proc = rt.exec(cmd);
         // any error message?
         errorGobbler = new
         StreamGobbler(proc.getErrorStream(), "ERROR");
         // any input?
         inputGobbler = new
         StreamGobbler(proc.getInputStream(), "INPUT");
         // any output?
              outputGobbler = new
              StreamGobbler(proc.getOutputStream(), "OUTPUT");
         // kick them off
         errorGobbler.start();
         inputGobbler.start();
         outputGobbler.start();
         // any error???
         int exitVal = proc.waitFor();
         System.out.println("ExitValue: " + exitVal);
         } catch (Throwable t)
         t.printStackTrace();
    {code}
    {code}
    public class StreamGobbler implements Runnable
    InputStream is;
    OutputStream os;
    String type;
    Thread thread;
    public static String chaine;
    StreamGobbler(InputStream is, String type)
    this.is = is;
    this.os=null;
    this.type = type;
    StreamGobbler(OutputStream os, String type)
    this.os = os;
    this.is=null;
    this.type = type;
    public void start () {
         thread = new Thread(this);
         thread.start ();
    public void run()
    try
    if (is == null){
         PrintWriter toProgram = new PrintWriter(os);
         File FolderToProcess = ProcessFolder.Folder;
    String Folder = FolderToProcess.getPath();
    toProgram.write(Folder);
    toProgram.close();
    else {
         if (os == null){
         InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    String comp = "Please enter the exact path of the directory that contains the files you want to process.";
    while ( (line = br.readLine()) != null){
         if (type.equals("INPUT")){
              chaine+=line+"\n";
         if (line.equals(comp)) {
              System.out.println("give directory");RUN A JFILECHOOSER AND GIVE THE DIRECTORY TO THE OUTPUTSTREAM
    System.out.println(type + ">" + line);
    is.close ();
    catch (IOException ioe){
         ioe.printStackTrace();
    {code}
    And here is an example of a simple perl script that could be used (it s a simple one !!) :
    {code}
    #!/usr/bin/perl -w
    use strict;
    print "Please enter the exact path of the directory that contains the files you want to process.\n";
    my $dir= <STDIN>;
    chomp ($dir);
    print "titallala $dir";
    if (the template of the file is not in the database){
    print "Please give me the template so that I can put it in the database";
    $dir= <STDIN>;
    chomp ($dir);
    {code}
    Thank you for your help ... if it's possible to help me !!
    Gael

    BalusC -- The line that gives me my NullPointerException is when I call the "DisplayProduct()" method. Its a dumb question, but with NetBeans how do I find out which reference could be null? I'm not very familiar with how NetBeans works with finding out how to debug. Any help you can give me would be greatly appreciated.The IDE is com-plete-ly irrelevant. It's all about the source code.
    Do you understand anyway when and why a NullPointerException is been thrown? It is a subclass of RuntimeException and those kind of exceptions are very trival and generally indicate an design/logic/thinking fault in your code.
    SomeObject someObject = null; // The someObject reference is null.
    someObject.doSomething(); // Invoking a reference which is null would throw NPE.

  • How to call a perl script from an apple script

    Hi All,
    How to Call a perl Script from an apple script.
    Pls Give Your comments.
    Thanx & Regards,
    Esther

    Applescript to call a perl script named "/tmp/x.pl" passing an argument "world"
    do shell script "/usr/bin/perl /tmp/x.pl world"
    or if the script is given the executable atttribute (chmod +x /tmp/x.pl),
    do shell script "/tmp/x.pl world"
    Perl script "/tmp/x.pl" that prints a string using a passed argument
    #!/usr/bin/perl
    print "Hello $ARGV[$1]\n";

  • Getting the output from a Perl script using Runtime.exec

    I cannot get the output from a perl script using Java. Can someone PLEASE help?
    I used the following code:
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    InputSream in = p.getInputStream();
    b...
    do
    System.out.println(b);
    while ((b = in.read()) > 0)
    But there is no way that I get the output in the inputstream. If I use the command "cmd script.pl", the output is displayed in the Dos box, but also not in the inputstream.
    I will appreciate any help.

    Try this
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    BufferedReader rd = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String str;
    while((str=rd.readLine())!=null){
    System.out.println(str);
    Manu

  • Error with dbms_scheduler and shell script execution

    Hi,guys.
    I have an issue with a dbms_scheduler and a shell script execution. So, the shell script as it self works fine, when i'm executing ./test.sh all process is running, but when i'm executing the script from dbms_scheduler it just simply doesn't work. Actually it works, but some of executable information in sh doesn't work, seems it just jump over of the part of the script. Sendmail part is running, maybe there is problem with rman script as it self?
    DB version: 10g
    And my scripts:
    Shell scripts (permisons 755):
    #!/bin/ksh
    export PATH=/home/oracle/product/asm_home/bin:/home/oracle/product/db_home/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/oracle/bin:/usr/bin/X11:/sbin:.
    export ORACLE_BASE=/home/oracle/product
    export ORACLE_SID=zabbix
    export ORACLE_HOME=/home/oracle/product/db_home
    ${ORACLE_HOME}/bin/rman<<EOF
    connect target /
    run {backup recovery area delete all input;}
    EOF
    {       echo "From:[email protected]"
            echo "To: [email protected]"
            echo "Subject: Recovery area"
            echo 'Content-Type: text/html'
            echo
            echo '<html><body><table border="1" cellspacing="1">'
            echo '<tr><td><b>Process</b></td><td><b>Statuss</b></td></tr>'
            echo "<tr><td>RMAN</td><td><b>Works</b></td></tr>"
            echo "</table></body></html>"
    } | sendmail -tIn the first part i'm exporting all of the important stuff for oracle, then I call RMAN with specific atributes. And then there is just simply sendmail functionality inside script to represent if script works (for now).
    And below pl/sql script:
    begin
      DBMS_SCHEDULER.CREATE_JOB
      job_name => 'FLASH_RECOVERY',
      job_type => 'EXECUTABLE',
      job_action => '/home/oracle/backup/test.sh',
      start_date => sysdate,
      job_class => 'DEFAULT_JOB_CLASS',
      enabled => TRUE,
      auto_drop => FALSE,
      comments => 'FLASH RECOVERY USAGE AREA backup and delete'
      END;
      /And this job execution:
           begin
               DBMS_SCHEDULER.run_job (job_name =>'FLASH_RECOVERY',use_current_session => TRUE);
           end;What can be wrong? For me, I think it's something with permisions.
    I hope you got my idea and could help me.
    Tom
    Edited by: safazaurs on 2013.18.2 22:16

    There is no error, i just receive all the time e-mail, seems it jumps over rman. I tried almost everything and still couldn't get result as i want. And, if i'm running script from command line - it works. Rman calls, and starts to recover archivelogs.

Maybe you are looking for

  • Problem with iChat over wireless network

    iChat with AIM account has always worked fine, but from the moment I installed a netgear router over a wireless network it enters a loop of disconnection/connection until I get the message "you have been connecting and disconneting too frequently". S

  • Bdc in table control

    hi friends, can any body plz send me one example in table contols in bdc.STEP BY STEP. thanks & regards ram

  • Field in FMRP_RFFMEP1AX adds date to field

    Ever since we upgraded to ECC6, we've got an odd change occuring in report  FMRP_RFFMEP1AX The material document field(found after drilling down a bit in the report) is now prepending the Material Document field with the date.  In other words, instea

  • How to unlock iphone 5 from lost mode

    i lost signal on my phone and when i switched it of and then back on it came up with the message that it was in lost mode

  • How to find java is installed in database and how to install it if its not there

    HI, I want to use sqlj in my work, but I m not sure that Aurora JVM is installed in the database while creating it. So how can I find abt it. if its not installed which packages should I run to install it in the current database.