Re: proxy error and using LWP getstore
lorid wrote: > I am still having trouble using the proxy, I thought I'd send my new code in which > I hopefully used your code suggestions correctly. I can ping proxy-web.dri.edu , > and I have added this debug line (use LWP::Debug qw(+ -conns);) > so I can see that it is really proxied to proxy-web.dri.edu > any clues ?? > > New error: > 500 (Internal Server Error) Can't connect to proxy-web.dri.edu:80 (Bad hostname > 'proxy-web.dri.edu') > Client-Date: Fri, 14 Nov 2003 19:44:18 GMT > > heres my new code: This works (commented out the $ua->proxy lines to test): use strict; use URI::URL; use LWP; use LWP::Debug qw(+ -conns); my $errors_page = "proxy_errors.txt"; my $url = url ('http://earthquake.usgs.gov/recenteqsUS/Quakes/quakes_all.html'); my $PROXY_URL = 'http://proxy-web.dri.edu/'; ### Proxy URL or Address + Port my $PROXY_FTP = 'http://proxy-ftp.dri.edu/'; my $ua = new LWP::UserAgent; $ua->proxy(http => $PROXY_URL); $ua->proxy(ftp => $PROXY_FTP); my $req = new HTTP::Request 'GET', $url; my $res = $ua->request($req); open OUT, ">$errors_page" or die "Create $errors_page: $!"; if ($res->is_success) { print OUT $res->as_string; print "Got URL OK\n"; } else { print OUT "Error getting $url, ", $res->status_line, "\n"; print STDERR "Error getting $url, ", $res->status_line, "\n"; die; } close OUT; # what's the purpose in reading this file ? #my $outdir = 'C:/a_perl/hw10/sols' ; #my $src = "$outdir/quakes_all.html"; # open IN, $src or die "Can't read file $src: $!\n"; print "Hi Lori\n"; # close IN; __END__ -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Fastest way to create an Access db...
Hi! What is the fastest way, from perl, to create an Access DB. Currently, I'm using DBD::ODBC to connect to a "blank" db file (which I've uuencoded and create whenever I need to create a db). However, this seems to be very slow. It's still faster than DBD::ADO, which was about 5 times slower in my last comparison test. But these are the only two options that I know about -- are there faster ways to create Access DBs? I really only need the equivalents of SQL's "create table", "insert into table", and "update table" commands. And the "update table" won't change any data that has already been set -- it's strictly to fill in already created rows. Any suggestions? Thanks muchly, Ricky Morse ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: PERL Authentication!!
Win32::AdminMisc::LogonAsUser might be what you need. ChangePassword isn't going to work in all cases. If your domain policy disallows re-using recent passwords, it will fail. Additionally, if there is any sort of account lockout policy defined chances are you will be causing yourself a lot of headaches. Peter Guzis Web Administrator, Sr. ENCAD, Inc. - A Kodak Company email: [EMAIL PROTECTED] www.encad.com -Original Message- From: Krishna, Hari [mailto:[EMAIL PROTECTED] Sent: Friday, November 14, 2003 11:21 AM To: [EMAIL PROTECTED] Subject: PERL Authentication!! Hi guys, I have been working on simulation NT login suing PERL. I used Win32::AdminMisc and I used ChangePassword function. But I needed to "Really" login as we do with windows login. When we "Windows" login, and I use net user loginname /DOMAIN than I get to see Last Login: date/time But when I use it with my script, it doesnot chance the login date/time and I understand that part. Is there is way in PERL that I can use some module or function that I can do what I wanted to do? I am using PERL in one of my web based programs. I needed to go with this type because of "Reasons". Now with all security rules coming with passwords, we create NT accounts for performance evalutaion which is basically a web based application. the users (som of them) will use their login for this reason only. They login not on their PC but when a manager is doing their evaluation, they need to login to network to finish. But this doesnot give us the idea when user last logged in. and we need to purge the unused accounts and for password aging. Hope its not too complicated. All I need is a PERL module or program help, that can "Really" simulate domain login. Thanks a bunch, Hari CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. You may NOT use, disclose, copy or disseminate this information. If you are not the intended recipient, please contact the sender by reply e-mail immediately. Please destroy all copies of the original message and all attachments. Your cooperation is greatly appreciated. Columbus Regional Hospital 2400 East 17th Street Columbus, Indiana 47201 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: proxy error and using LWP getstore
I am still having trouble using the proxy, I thought I'd send my new code in which I hopefully used your code suggestions correctly. I can ping proxy-web.dri.edu , and I have added this debug line (use LWP::Debug qw(+ -conns);) so I can see that it is really proxied to proxy-web.dri.edu any clues ?? New error: 500 (Internal Server Error) Can't connect to proxy-web.dri.edu:80 (Bad hostname 'proxy-web.dri.edu') Client-Date: Fri, 14 Nov 2003 19:44:18 GMT heres my new code: #!/usr/bin/perl -w use strict; use URI::URL; use LWP; # LWP => Library for World Wide Web access in Perl use LWP::Debug qw(+ -conns); require LWP::UserAgent; #proxy-web.dri.edu my $PROXY_URL = 'http://proxy-web.dri.edu/'; ### Proxy URL or Address + Port my $PROXY_FTP = 'http://proxy-ftp.dri.edu/'; my $ua = ""; $ua = new LWP::UserAgent; $ua->proxy(['http', 'ftp'], $PROXY_URL,$PROXY_FTP); my $n = ""; my $data = ""; my $response = ""; my $errors_page = "proxy_errors.txt"; open (OUT2, "> $errors_page") or die "Can't write to file $errors_page: $!\n"; my $outdir = 'C:a_perl\\hw10\\sols\\' ; my $url = url('http://earthquake.usgs.gov/recenteqsUS/Quakes/quakes_all.html/'); my $src = $outdir .'quakes_all.html'; my $req = new HTTP::Request 'GET', $url; my $res = $ua->request($req); print OUT2 $res->as_string; $response = $ua->get($url); die "Error while getting ", $response->request->uri, " -- ", $response->status_line, "\nAborting" unless $response->is_success; open (OUT, "< $src") or die "Can't read file $src: $!\n"; print "Hi Lori\n"; close OUT; close OUT2; "$Bill Luebkert" wrote: > lorid wrote: > > > Any docs or examples on how to use a proxy when using getstore will be > > greatly appreciated.! > > > > I am having trouble getting a html file from the web due to a proxy > > issue: > > > > I found a debugging tool that helps, and I may just need to ask my boss > > for the right proxy name but I think I have it... > > anyway here is my simple test case , but first the error msg's I > > received: > > > > 1st error I got that let me know it really is a proxy problem : > > LWP::UserAgent:: _need_proxy: Not proxid . > > > > > > So I am guessing I can use the same proxy I use for FTP and tried > > using this line I got from the UserAgent manpage under LWP > > :$ua->proxy(['http', 'ftp'], 'http://proxy.sn.no:8001/'); > > replacing the line in bold with my ftp proxy from work (which is how > > I'm connected to the web) > > > > Which didnt quite work cuz the error I get now is: > > Cant call methond proxy on an undefined value at line 30 (the line > > entails: my$ua->proxy(['http','ftp'],'http://proxy-ftp.dri.edu/'); > > > > my test program: > > #!/usr/bin/perl -w > > > > use strict; > > use LWP::Simple; # LWP => Library for World Wide Web access in Perl > > #use LWP::DebugFile; > > > > use LWP::Debug qw(+ -conns); > > > > my $n = ""; > > my $data = ""; > > my $response = ""; > > print LWP::Debug::conns("read $n bytes: $data"); > > > > use URI::URL; > > > > > > my $outdir = "C:\\a_perl\\test\\getwebfiles\\" ; > > my $url = > > url('http://earthquake.usgs.gov/recenteqsUS/Quakes/quakes_all.html'); > > my $src = $outdir .'quakes_all.html'; > > open (OUT, "< $src") or die "Can't read file $src: $!\n"; > > > > require LWP::UserAgent; > > #$ua->proxy(['http', 'ftp'], 'http://proxy.sn.no:8001/'); > > > > my $ua->proxy(['http', 'ftp'],'http://proxy-ftp.dri.edu/'); > > Either use Simple or use an agent. If you are going to use $ua, > you need to define it: > > use LWP; > my $ua = new LWP::UserAgent; > my $ua->proxy(['http', 'ftp'], 'http://proxy-ftp.dri.edu/'); > my $req = new HTTP::Request 'GET', $url; > my $res = $ua->request($req); > print $res->as_string; > > > $response = $ua->get($url); > > die "Error while getting ", $response->request->uri, > >" -- ", $response->status_line, "\nAborting" > > unless $response->is_success; > > > > > > close OUT; > > -- > ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] > (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] > / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ > -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
PERL Authentication!!
Hi guys, I have been working on simulation NT login suing PERL. I used Win32::AdminMisc and I used ChangePassword function. But I needed to "Really" login as we do with windows login. When we "Windows" login, and I use net user loginname /DOMAIN than I get to see Last Login: date/time But when I use it with my script, it doesnot chance the login date/time and I understand that part. Is there is way in PERL that I can use some module or function that I can do what I wanted to do? I am using PERL in one of my web based programs. I needed to go with this type because of "Reasons". Now with all security rules coming with passwords, we create NT accounts for performance evalutaion which is basically a web based application. the users (som of them) will use their login for this reason only. They login not on their PC but when a manager is doing their evaluation, they need to login to network to finish. But this doesnot give us the idea when user last logged in. and we need to purge the unused accounts and for password aging. Hope its not too complicated. All I need is a PERL module or program help, that can "Really" simulate domain login. Thanks a bunch, Hari CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. You may NOT use, disclose, copy or disseminate this information. If you are not the intended recipient, please contact the sender by reply e-mail immediately. Please destroy all copies of the original message and all attachments. Your cooperation is greatly appreciated. Columbus Regional Hospital 2400 East 17th Street Columbus, Indiana 47201 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Spreadsheet-WriteExcel format problem
> Guys, > > This has me well and truly confused. I have even copied and pasted the lines > from the documentation, and it still won't work! > > Can anyone tell me what I'm doing wrong here? > > use strict; > use warnings; > use Spreadsheet::WriteExcel; > my $workbook = Spreadsheet::WriteExcel->new("cheese.xls"); > my $worksheet = $workbook ->addworksheet("Cheese page"); > my $format = $workbook->add_format(); > $format->set_properties(bold => 1, color => 'red'); > $worksheet->write_row (0, 0, ['This', 'is', 'cheese'], $format); > > I get the following error: > > Can't locate object method "add_format" via package > "Spreadsheet::WriteExcel" (perhaps you forgot to load > "Spreadsheet::WriteExcel"?) at D:\My Scripts\Learning\Excel\write.pl line 6. > > I've tried every way mentioned in the docs, but I get the same error. > > Thanks. > > R. Works for me ( Activeperl 5.8.0.806, Spreadsheet-WriteExcel 0.42 ). I might try re-installing the module, and it wouldn't hurt to check that the addworksheet() call is really returning a worksheet object before calling add_format(). Steve ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs