Whoops, the first time I sent this it still had a part in it that needs a subdir called dnb. i took that outof this and tested it again.
I have spent too long struggling with a case of my computer seems to give semi random results printing a string combination value to test that it is right. One thing may be that perl is not compiled in a compatible way on my computer. First, could someone try runing this script to see if the print statements make different presentations of a string variable that all are consistent? I made substrings of 30 and 40 chars long and printed them consecutively so they should look like the longer line above, but as if word wrapped shorter and shorter. thanks John perl script ============ #!/usr/local/bin/perl -Tw use strict; $|++; # Program to GET via HTTP from traviscad.org free taxed company listings # and generate a list of interesting co's (getlist), by name. # and sbs.dnb.com site free company listings # from getlist file used along with knowing the form details to GET in advance # (used opera and copied url GET going out real quick before answer arrived) # and maybe later parse html to text and update .csv # job search data files at the same time. # Created by John Griessen 8/26/2001 # post a db query using Get, since all on the one url line. # if title is Company Info{getCompanyRecord} or else, # if title is Search Results # then extract links like: (http://sbs.dnb.com/compInfo.asp?callback=yes&compName=* ) # even if they are in html as: <A href="compInfo.asp?callback=yes&compName=* use LWP::UserAgent; # send an HTTP GET request to the specified url use HTTP::Cookies; my ($search_city, $search_state, $co_list); my @co_name; if (defined($ARGV[0])) {$search_city = shift @ARGV; } else {die "Usage: \$search_city, \$search_state, \$co_list co_list defaults to dnb/co_list.txt: $!\nStopped"; } if (defined($ARGV[0])) {$search_state = shift @ARGV; } else {die "Usage \$search_city, \$search_state, \$co_list co_list defaults to dnb/co_list.txt: $!\nStopped"; } push @co_name, "S I Diamond"; # By default LWP ignores cookies provided by the servers it visits. # LWP can be forced to collect cookies and respond to cookie # requests if you set up a cookie jar. my $cookies = "/home/john/.kde/share/apps/kcookiejar/cibolo.cookie.jar"; print "cookie jar is: " , $cookies, "\n"; my ($ua, $res, $chunk); $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => $cookies, autosave => 1)); $ua->agent('Mozilla 8.0/0.1 '); # pretend we are browser my ($n, $search_company_name, $result); my $formfill = ""; my $formfill1 = "";my $formfill2 = "";my $formfill3 = ""; print STDOUT "formfill int value = ", $formfill, "\n"; NAMES: while ($co_name[0]) { $n = shift @co_name; chomp $n; $search_company_name = $n; $search_company_name =~ s/ /\%20/g ; # example url. http://sbs.dnb.com/lookup.asp?country=US&name=cygnal%20integrated%20products&st=TX&city=austin # cat together a url from command line args for a specific company GET. $formfill3 = join "", "http://sbs.dnb.com/lookup.asp?country=US&name=", "$search_company_name"; $formfill2 = join "", "&st=", "$search_state", "&city=", "$search_city"; $formfill1 = join "XX", $formfill3, $formfill2; print STDOUT "co name = ", $search_company_name, "\n"; print STDOUT "formfill3 = ", $formfill3, "\n"; print STDOUT "formfill2 3x = ", $formfill2, $formfill2, $formfill2, "\n"; print STDOUT "formfill1 follows ", "\n"; print STDOUT $formfill1, "\n"; print STDOUT "formfill1 by 40 chars follows ", "\n"; $n = substr($formfill1, 0, 40), "\n"; print STDOUT $n, "\n"; $n = substr($formfill1, 40, 40), "\n"; print STDOUT $n, "\n"; $n = substr($formfill1, 80, 40), "\n"; print STDOUT $n, "\n"; print "formfill1 by 30 chars follows ", "\n"; $n = substr($formfill1, 0, 30), "\n"; print STDOUT $n, "\n"; $n = substr($formfill1, 30, 30), "\n"; print STDOUT $n, "\n"; $n = substr($formfill1, 60, 30), "\n"; print STDOUT $n, "\n"; #print substr($formfill1, 90), "\n"; # $chunk = SendHTTPGETRequest ($formfill); # put ways to use response here! #print HTMTXT "co_list chunk =", $chunk, "\n"; print "while block last line", "\n"; } ========================================== end of perl program the output I get: =================== ./dnb2texdebug.pl Austin TX Useless use of a constant in void context at ./dnb2texdebug.pl line 69. Useless use of a constant in void context at ./dnb2texdebug.pl line 71. Useless use of a constant in void context at ./dnb2texdebug.pl line 73. Useless use of a constant in void context at ./dnb2texdebug.pl line 76. Useless use of a constant in void context at ./dnb2texdebug.pl line 78. Useless use of a constant in void context at ./dnb2texdebug.pl line 80. cookie jar is: /home/john/.kde/share/apps/kcookiejar/cibolo.cookie.jar formfill int value = co name = S%20I%20Diamond formfill3 = http://sbs.dnb.com/lookup.asp?country=US&name=S%20I%20Diamond formfill2 3x = &st=TX&city=Austin&st=TX&city=Austin&st=TX&city=Austin formfill1 follows http://sbs.dnb.com/lookup.asp?country=US&name=S%20I%20DiamondXX&st=TX&city=Austin formfill1 by 40 chars follows http://sbs.dnb.com/lookup.asp?country=US &name=S%20I%20DiamondXX&st=TX&city=Austi n formfill1 by 30 chars follows http://sbs.dnb.com/lookup.asp? country=US&name=S%20I%20Diamon dXX&st=TX&city=Austin while block last line =================== end of my output my perl and gcc compiler: [john@carbide perl]$ perl -v This is perl, v5.6.1 built for i686-linux I compiled it, and that used a 2.4.9 kernel required version of gcc: [root@carbide /]# find -name gcc* ../usr/local/rpm-pkg/gcc-2.96-85.i386.rpm ../usr/share/doc/gcc-2.96 [root@carbide /]# gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) Could I have a i386 i686 difference in the way some -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]