User Profile

Collapse

Profile Sidebar

Collapse
rickumali
rickumali
Last Activity: Apr 21 '16, 10:37 PM
Joined: Dec 6 '06
Location: Arlington, MA, USA
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • The short answer is yes, you can create a subdirectory using Perl's mkdir command. Below is a small program that reads the STDIN for a string, and then appends that string to an existing directory. This new directory is passed to the mkdir() command.

    Code:
    $dest = "C:\\cygwin";
    while (<STDIN>) {
       print "Making $dest\\$_\n";
       chop;
       mkdir "$dest\\$_";
    }
    Two...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to Extracting sit file..
    in Perl
    I perused search.cpan.org , to see if any modules were available to open/manipulate SIT files. (Note, I googled this, and assume you're talking about Mac StuffIt files, compressed files native for the Mac.)

    I found Archive::Tar, which produces files readable by the StuffIt Expander program, and I found Mac::AppleSingl e, which can seemingly read files in AppleSingle/AppleDouble formats. Note that AppleSingle/AppleDouble are older formats....
    See more | Go to post

    Leave a comment:


  • The code looks OK, but I suspect that there's probably one more dereference that needs to made. For issues like these, I typically break out the Perl Debugger, or drop in some Dumpvalue code.

    For you, add this:

    use Dumpvalue;
    $dumper = new Dumpvalue;

    Then right before the bad for loop, do this:

    $dumper->dumpValue(\@ne w_keys);

    You might have to play with this syntax,...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to dereferencing complex XML data structure
    in Perl
    After a very (very) quick glance, the data structure looks like has hash of arrays. And the arrays are anonymous. Look at perldsc, and grok the "Access and Printing of a HASH OF ARRAYS" examples....
    See more | Go to post

    Leave a comment:


  • It sounds like your Windows/IIS Server isn't properly configured to run the Perl script. Check into your configuration some more.

    When IIS is configured to run the Perl script, the Perl program will run in IIS, and it won't pop up asking the user to download it....
    See more | Go to post

    Leave a comment:


  • I keyed in your program, and observed that the likely culprit is your file name escaping. On Windows, I had to use something like this:

    $dirname = "C:\\cygwin\\ho me\\rick\\perl\ \test";

    and:

    unless(open (POSFILE,"+< $dirname\\$file ")){

    Notice the use of the "\\" to escape the "backslash" . You might want to sprinkle some printfs or use the Perl debugger...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to Need Help (Hospital Database in Java)
    in Java
    Boy, that question sounds pretty "heavy". Check out this post about the type of question you have. Perhaps if you focused on a smaller part of this problem, and a specific issue you have it, thescripts could help out.
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to Win32 ODBC Connect - Bad File Descriptor
    in Perl
    I was "trying this out" for myself, looking up resources on the web, when I encountered this:

    I Can Access DSN from Command Line, Not Web/CGI

    Give this a try! Good luck!
    See more | Go to post

    Leave a comment:


  • I ran your program through the Perl debugger, and confirmed that $response->content() definitely contains HTML. When I put the output into an editor, I found that the content does NOT contain "Headlines. " Try another keyword, like "Weather."

    If you want to examine variables without the debugger, use this code (provided your Perl has the Dumpvalue module):
    Code:
    use HTTP::Request::Common;
    use LWP::UserAgent;
    ...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to Returning an array of elements
    in C
    You can definitely return the array (or at least a pointer to the array), but since this C/C++, I'm sure you'll have to allocate some space for it. (Sorry, but my C/C++ is hazy.) Good luck with this!...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to halp plz
    You've already received some good replies. I want to note that if you are on Linux, tar does have a -z switch to uncompress GZIP'd files. You'd do something like this:

    % tar zxf file.tar.gz...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to converting html to xml
    in XML
    I've not used Adobe Dreamweaver, but you should look at HTML Tidy. Visit:

    http://tidy.sourceforge.net/

    The man page for Tidy says "A common use of Tidy is to convert plain HTML to XHTML." (And yes, XHTML would be XML .)...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to Threads
    Think of a thread as a "process within a process." It's a separate branch of your program doing other things while your main program is doing its work. For the Wiki's take on "threads", visit:

    http://en.wikipedia.or g/wiki/Thread_(compute r_science)

    It's a big topic, as you may have guessed. I'm sure others will chime in.
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to error occured while compiling jsp
    The JDK is the directory that contains your Java Development Kit. Specifically, it contains the Java compiler (javac). The top level of your JDK should look similar to this (from Windows):

    Code:
    C:\> [B]echo %JAVA_HOME%[/B]
    C:\j2sdk1.5.0_04
    
    C:\> [B]dir %JAVA_HOME%[/B]
     Volume in drive C has no label.
     Volume Serial Number is 9023-0CA4
    
     Directory of C:\j2sdk1.5.0_04
    
    11/13/2006  11:36
    ...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to Help on pl script!!! (Beginner!!)
    in Perl
    When you write Abyss Web Server, do you mean this:

    http://www.aprelium.com/

    Because if you do, and you can run "CGI" no problem, but not ".pl", then I suspect you need to associate the suffix .pl with the Perl interpreter, per this:

    http://www.aprelium.com/abyssws/perl.html

    Another place to look is the log files produced by your Abyss Web Server. Locate those log files,...
    See more | Go to post

    Leave a comment:


  • rickumali
    replied to Ordering of Elements in XML using Perl
    in Perl
    When you say "some of the attributes in XML require to be renamed", do you mean that you want to go from this:

    <ELEMENT ATTRIB="Foo">Da ta</ELEMENT>

    to this:

    <ELEMENT RENAMED="Foo">D ata</ELEMENT>

    If the above is the kind of transformation you want, you could just use the classic Perl search and replace one-liner:

    perl -p...
    See more | Go to post

    Leave a comment:


  • I recommend pack/unpack, Perl's answer to "packed data streams" like the one you just described. Here's a little program to get the first part:

    Code:
    #!/bin/perl
    
    $sample_line = "D30002115964000080000200US";
    
    @ary = unpack "A4A8A*", $sample_line;
    
    print "$ary[0]\n";
    print "$ary[1]\n";
    print "$ary[2]\n";
    ...
    See more | Go to post

    Leave a comment:


  • Hello! I'm only going to tackle this first "requiremen t." I'd approach this without loading the entire file contents into an array, and using splice. Instead, I'd do something like this:

    Code:
    $line_count = 0;
    while (<>) {
    	$line_count++;
    
    	if ($line_count == 1) {
    		# First line. Check if header row exists using fancy Perl RE
    
    		if (!/^HEADER$/) {
    			print "HEADER\n";
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...