RE: Oracle SQL Statement help
You can do this in Oracle or in Perl. If you do it in Perl with the date_of_birth value being passed in then I would recommend using the date:calc module. If you are doing it in Oracle then something akin to: select name, date_of_birth from data where sysdate - date_of_birth > 21 * 365; This is rough as I'm not feeling too well at the moment, but it should put you on the right track for your final answer. I'd personally recommend using date:calc to get today's date and then subtract 21 years and then do a delta_days against the birthday. -Original Message- From: steve silvers [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 2:31 PM To: [EMAIL PROTECTED] Subject: Oracle SQL Statement help Im using DBI to connect to a Oracle database and i'm having trouble with this: In a nut shell. I have a table called DATA, and a column called DATE_OF_BIRTH. I need to see if the person is under 21 years old. So I need to compare the "DATE_OF_BIRTH" with whatever the current date is. I have tried something like. SELECT DATEDIFF(DATE_OF_BIRTH,SYSDATE) ... But no luck. Does anyone know how to do this against Oracle? Thanks in advance. Steve. _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com ___ 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: Disregarding Folders In A Directory
On Wed, 28 Aug 2002, Andre Warnier wrote: > Message text written by "T&C Winquist" > > > Here's how I get all the files of a directory. I'm sure there are a > hundred > ways of doing it: > > ... > > > yeah (TMTOWTDI), here's another : > > opendir(DIR,"mydir") or die "$!"; > my @DirGlob = readdir(TMPDIR); # get all entries at once > closedir(DIR); > @DirGlob = grep(-f, @DirGlob); # keep only files ? > OK, then here's a small revision of yours: opendir(DIR,"mydir") or die "$!"; @DirGlob = grep {-f} readdir(TMPDIR); # keep only files ? closedir(DIR); [EMAIL PROTECTED] All opinions are my own and not necessarily those of my employer ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Oracle SQL Statement help
Im using DBI to connect to a Oracle database and i'm having trouble with this: In a nut shell. I have a table called DATA, and a column called DATE_OF_BIRTH. I need to see if the person is under 21 years old. So I need to compare the "DATE_OF_BIRTH" with whatever the current date is. I have tried something like. SELECT DATEDIFF(DATE_OF_BIRTH,SYSDATE) ... But no luck. Does anyone know how to do this against Oracle? Thanks in advance. Steve. _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Remotely adding a machine to a domain
Hi all, Is there a way to remotely add a machine into a domain? I have all the necessary id's and passwords (admin on the domain, and admin on the remote machine). I'm just trying to save my self a trip to a whole bunch of machines. I've already looked at Win32:NetAdmin and Win32:Lanman, but nothing jumped out at me. Any hints would be greatly appreciated. Thanks. -Henry Þ®U¢}±ê쨥x%ËOz¹V}öRÇ«²X¬¶Ç«¼-÷µ«^r¢éì¹»®&ÞÛiÿùb²Û®ð¶+ÞJÖyÊ&þf¢f§þl¬¹»
Re: PerlApp
>I would like to use PerlApp to create a freestanding web-based >application. So far, when the app is started, it uses Win32::OLE to >open a browser window (MSIE), and pass it the first page, a frames >page named main.html. > >Now, MSIE serves as my application window. I would like to be able to >click links in the browser window, which would make a call to >my_app.exe, and the my_app.exe would send back the corresponding >information to the browser window. Right now, though, I can't seem to >get it to work, since the web browser window wants to save/open the >.exe from the hyperlink. > >I worried that this would happen in certain cases, like those people who >have auto-downloaders installed, but I did not expect it not to work at >this primary point. > >So, in the browser window, the hyperlink URL would read: > where 'my_App.exe' is >the application I created using PerlApp, and 'coomand=do_this' is the >argument I am passing. > >Is it just a syntax in the way I am passing the arguments? No, this has nothing to do with PerlApp. This is the correct behavior of a web browser. You can try hyperlink to any EXE application and get the same result. To get it work, you need to install a webserver on your PC and make your Perl application as a CGI (make sure it outputs the HTTP header) so that the webserver would launch your application and send the output back to the web browser. Jing Wee >Thanks in advance for your help. > >Brad Smith >___ >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: PerlApp
What you really want is to embed the Win32:InternetExplorer. module in your perlApp app. Or something like that. It's a way to embed an IE in your App, and I think you can define processes. the problem you are experiencing I belive is that your browser sessions don't know how to handle the .exe conent type. Or if they do they are configured to not allow it to run. justa a few ideas. Marty p.s. (IMHO) it does sound a little like you might be trying to use the wrong tool for the job though. Maybe you could explain the spec a bit more. - Original Message - From: "Brad Smith" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 29, 2002 7:05 PM Subject: PerlApp > I would like to use PerlApp to create a freestanding web-based > application. So far, when the app is started, it uses Win32::OLE to > open a browser window (MSIE), and pass it the first page, a frames > page named main.html. > > Now, MSIE serves as my application window. I would like to be able to > click links in the browser window, which would make a call to > my_app.exe, and the my_app.exe would send back the corresponding > information to the browser window. Right now, though, I can't seem to > get it to work, since the web browser window wants to save/open the > .exe from the hyperlink. > > I worried that this would happen in certain cases, like those people who > have auto-downloaders installed, but I did not expect it not to work at > this primary point. > > So, in the browser window, the hyperlink URL would read: > where 'my_App.exe' is > the application I created using PerlApp, and 'coomand=do_this' is the > argument I am passing. > > Is it just a syntax in the way I am passing the arguments? > > Thanks in advance for your help. > > Brad Smith > ___ > 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: PerlApp
I think what you want to do is create an application that accepts html input and does something with it. In this case, you'd first have to add that functionality to your program (and tell it to listen to a particular IP address and port...say 127.0.0.1:65123). Then you could create some kind of page that accepts the commands you pass it (say 'command.xxx')write your link as http://127.0.0.1:65123/command.xxx?command=do_this";>. Another approach to this would be to use Perl::Tk or Win32::GUI to create the front-end for your application, and skip the html interface. Either way is going to require a fair amount of adjustment. -Original Message- From: Brad Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:06 PM To: [EMAIL PROTECTED] Subject: PerlApp I would like to use PerlApp to create a freestanding web-based application. So far, when the app is started, it uses Win32::OLE to open a browser window (MSIE), and pass it the first page, a frames page named main.html. Now, MSIE serves as my application window. I would like to be able to click links in the browser window, which would make a call to my_app.exe, and the my_app.exe would send back the corresponding information to the browser window. Right now, though, I can't seem to get it to work, since the web browser window wants to save/open the .exe from the hyperlink. I worried that this would happen in certain cases, like those people who have auto-downloaders installed, but I did not expect it not to work at this primary point. So, in the browser window, the hyperlink URL would read: where 'my_App.exe' is the application I created using PerlApp, and 'coomand=do_this' is the argument I am passing. Is it just a syntax in the way I am passing the arguments? Thanks in advance for your help. Brad Smith ___ 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
PerlApp
I would like to use PerlApp to create a freestanding web-based application. So far, when the app is started, it uses Win32::OLE to open a browser window (MSIE), and pass it the first page, a frames page named main.html. Now, MSIE serves as my application window. I would like to be able to click links in the browser window, which would make a call to my_app.exe, and the my_app.exe would send back the corresponding information to the browser window. Right now, though, I can't seem to get it to work, since the web browser window wants to save/open the .exe from the hyperlink. I worried that this would happen in certain cases, like those people who have auto-downloaders installed, but I did not expect it not to work at this primary point. So, in the browser window, the hyperlink URL would read: where 'my_App.exe' is the application I created using PerlApp, and 'coomand=do_this' is the argument I am passing. Is it just a syntax in the way I am passing the arguments? Thanks in advance for your help. Brad Smith ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Can't call method "ExecNotificationQuery" on an undefined value a t ...
FYI, I started wondering if this had to do with the difference in OS's, and it turns out that WMI (Windows Management Instrumentation) is included with 2000 but not with NT. (WMI is required for certain basic win32 modules to work correctly). After installing WMI on our NT environment, the script worked as expected... -Original Message- From: Lewis, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 9:55 AM To: [EMAIL PROTECTED] Subject: Can't call method "ExecNotificationQuery" on an undefined value a t ... I don't think this went through the first time around, so here goes again... I've gotten the code below to work successfully on my development machine, however after attempting to run it on another of our environments I get the following error during compilation: Can't call method "ExecNotificationQuery" on an undefined value at nteventlogwatch.pl line 22. Any ideas what could be causing this? An incompatible version of Win32::OLE perhaps? Thanks, Chris 12 #! c:\perl\bin\perl.exe -w 13 14 use strict; 15 use Win32; 16 use Win32::OLE qw(in); 17 use Net::SMTP; 18 19 my $Computer = Win32::NodeName; 20 my $evtQuery = "SELECT * FROM __instancecreationevent WHERE targetinstance ISA 'Win32_NTLogEvent AND (targetinstance.Type='Error' OR targetinstance.Type='Warning')"; 21 22 my $Events = Win32::OLE->GetObject("WinMgmts:{impersonationLevel=impersonate,(security)}" ) ->ExecNotificationQuery($evtQuery) || die Win32::OLE->LastError; ___ 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: number crunching in Perl ...
Since so many people have asked, I was referring to a small part of the textbook: "The Practice of Programming" Brian Kernighan and Rob Pike [I think it was 1999, Addison-Wesley, but I'm not sure] You should be able to find this at any decent university library, or at the good bookstore of your choice. They are also the authors of the classic "The Unix Programming Environment" which (I think) came out in 1984. I will note that, after their book came out, there was some discussion on the comp.lang.perl.misc newsgroup about improvements that could be made on K & P's Perl code. If I remember correctly, their C program was about 90 lines, their C++ program was about 120 lines, their Java program was even longer, and their Perl program was about 20 lines. The feeling of some on comp.lang.perl.misc at the time was that the Perl program could be made shorter while increasing its (time) efficiency simultaneously. And, IIRC, K & P hypothesized that Perl beat out C++ in the win32 environment because of possible flaws in the Microsoft Foundation Classes. And since those flaws may always be there... :-) David -- David Cassell, CSC [EMAIL PROTECTED] Senior computing specialist mathematical statistician ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: creating links (*.lnk files)
ecki [mailto:[EMAIL PROTECTED]] wrote: > is there a perl module to create *.lnk files (e.g. used in > the 'Sent to' > folder in order to send txt files to the notepad)? Yup, Win32::Shortcut. An example would be: #--- start of create_link.pl use strict; use Win32::Shortcut; my $LINK = new Win32::Shortcut(); $LINK->Path("D:/Perl/bin/perl.exe"); $LINK->Arguments("U:/Perl/License_Tool/License_Tool.pl"); $LINK->WorkingDirectory("U:/Perl/License_Tool"); $LINK->Description("License Tool Manager"); # ShowCmd types: # 1 Normal Window SW_SHOWNORMAL # 3 Maximized SW_SHOWMAXIMIZED # 7 Minimized SW_SHOWMINNOACTIVE $LINK->ShowCmd(7); # How to define hotkeys & icons # $LINK->Hotkey(hex('0x0337')); # $LINK->IconLocation("C:\WINDOWS\system\cool.ddl"); # $LINK->IconNumber(1); $LINK->Save("License_Tool.lnk"); print join("\n", $LINK->Path, $LINK->ShortPath, $LINK->Arguments, $LINK->WorkingDirectory, $LINK->Description, $LINK->ShowCmd, $LINK->Hotkey, $LINK->IconLocation, $LINK->IconNumber); $LINK->Close(); #--- end of create_link.pl cheers, bj > -Original Message- > From: ecki [mailto:[EMAIL PROTECTED]] > Sent: 28-Aug-02 16:27 > To: [EMAIL PROTECTED] > Subject: creating links (*.lnk files) > > > Hi all, > > is there a perl module to create *.lnk files (e.g. used in > the 'Sent to' > folder in order to send txt files to the notepad)? Or does > anybody know the > structure of these files? > > Thanks > Eckart > > ___ > 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: creating links (*.lnk files)
Eckart - Aldo Calpini's Win32::Shortcut will both create and manipulate shortcuts. It comes with ActivePerl, but unfortunately, the documentation apparantly gets lost somewhere between him and ActiveState's distribution. You can get it by downloading the current Win32::Shortcut from http://dada.perl.it/. The docs are in the zip file, in HTML. Tom Wyant "ecki" <[EMAIL PROTECTED]>@listserv.ActiveState.com on 08/28/2002 04:27:24 PM Sent by:[EMAIL PROTECTED] To:<[EMAIL PROTECTED]> cc: Subject:creating links (*.lnk files) Hi all, is there a perl module to create *.lnk files (e.g. used in the 'Sent to' folder in order to send txt files to the notepad)? Or does anybody know the structure of these files? Thanks Eckart ___ 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: select on Win NT
Anyway, in most cases, the proper execution of piping requires that you explicitly call your .EXE file. You can't rely on extension/application association. Thus your command line should be out.exe | perl.exe in.pl or at best out.exe | perl in.pl _ Bruno Bellenger Sr. Network/Systems Administrator -Original Message- From: $Bill Luebkert [SMTP:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 2:21 PM To: Dr.-Ing. Torsten Finke Cc: [EMAIL PROTECTED] Subject:Re: select on Win NT Dr.-Ing. Torsten Finke wrote: > Hi there > > has anybody tried to check the readability of a pipe via the select > command running ActivePerl under Windows NT? > > The following code is running fine in Linux, but select seems not to > do what it should in Win NT. > > I ran that program in a pipeline with an executable out.exe that > writes (and flushes) to stdout: > > out.exe | in.pl > > > Regards > > > Torsten > > > > $rin = $win = $ein = ''; > vec($rin,fileno(STDIN),1) = 1; > vec($win,fileno(STDOUT),1) = 1; > $ein = $rin | $win; > > while ( 1 ) { > $nfound = select($rout=$rin, undef, undef, 0.2); > if ( $nfound ) { > $c = sysread STDIN, $l, 1000; > } > } > select only works on sockets in Win32. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___ 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: select on Win NT
Dr.-Ing. Torsten Finke wrote: > Hi there > > has anybody tried to check the readability of a pipe via the select > command running ActivePerl under Windows NT? > > The following code is running fine in Linux, but select seems not to > do what it should in Win NT. > > I ran that program in a pipeline with an executable out.exe that > writes (and flushes) to stdout: > > out.exe | in.pl > > > Regards > > > Torsten > > > > $rin = $win = $ein = ''; > vec($rin,fileno(STDIN),1) = 1; > vec($win,fileno(STDOUT),1) = 1; > $ein = $rin | $win; > > while ( 1 ) { > $nfound = select($rout=$rin, undef, undef, 0.2); > if ( $nfound ) { > $c = sysread STDIN, $l, 1000; > } > } > select only works on sockets in Win32. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32: multi-process application?
Although the ActivePerl doc state: WARNING: As of the 5.6.1 release, the fork() emulation continues to be an experimental feature. Use in production applications is not recommended. See the "BUGS" and "CAVEATS AND LIMITATIONS" sections below. I am thinking that the fork() will give me the performance gains I am looking for without the need to have interprocess communication except maybe for a semaphore or mutex so that the child processes don't have any logging issues. I am still reading up on all of these subjects. Has anyone used Win32 fork() in a production application? What are your experiences? Are there any other suggestions? I have read the part about the Regex engine not playing nicely in forked threads. What problems have been seen? If I avoid paren groups or variables interpolation in my regex expressions, do you think I might be safe? > > I have a socket application that is currently a single thread > process that > spends half of its time logging. I would like to restructure > the application > into a multi-process application where the parent spawns two > processes. One > process would listen to the port and reply to the client and > the second > would perform the logging of process #1's activity. > > I would think that ithreads in Perl 5.8 is the solution that > probably would > be best. > > What suggestions, recommendations, or other commentary is > available from the > list? What methods could be used to communicate the text > to be logged > to process #2? > ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: NT Service Password
According to the documentation, Win32::Lanman can do all of these things remotely. ChangeServiceConfig($server, $servicedb, $service, \%param) Scott Campbell Senior Software Developer Somix Technologies (207) 324-8805 http://www.somix.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Conor Lillis Sent: Thursday, August 29, 2002 6:58 AM To: [EMAIL PROTECTED] Subject: NT Service Password Hi, I am curious to know has anyone found a way to update the password that an NT service uses, via PERL ? I would like to be able to a. programatically stop services on remote servers (can do, works) b. Change the NT account and/or password the service uses fior security context (cannot do !) c. Restart the service (can do) under the new NT credentials (can do, works). If anyone has done it, or knows how, that'd be great thanks, Conor The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised.if you are not the intended recipient, any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. Please note that any views, opinions or advice contained in this email are those of the sending individual and not necessarily those of the firm. It is possible for data transmitted by e-mail to be deliberately or accidentally corrupted or intercepted. For this reason, where the communication is by e-mail, J&E Davy does not accept any responsibility for any breach of confidence which may arise from the use of this medium. If you have received this e-mail in error please notify us immediately at mailto:[EMAIL PROTECTED] and delete this e-mail from your system. ___ 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: NT Service Password
Hi, I believe the answer lies in Win32::Lanman::ChangeServiceConfig, please ignore previous message. thanks, Conor -Original Message- From: Conor Lillis Sent: 29 August 2002 11:58 To: [EMAIL PROTECTED] Subject: NT Service Password Hi, I am curious to know has anyone found a way to update the password that an NT service uses, via PERL ? I would like to be able to a. programatically stop services on remote servers (can do, works) b. Change the NT account and/or password the service uses fior security context (cannot do !) c. Restart the service (can do) under the new NT credentials (can do, works). If anyone has done it, or knows how, that'd be great thanks, Conor The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised.if you are not the intended recipient, any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. Please note that any views, opinions or advice contained in this email are those of the sending individual and not necessarily those of the firm. It is possible for data transmitted by e-mail to be deliberately or accidentally corrupted or intercepted. For this reason, where the communication is by e-mail, J&E Davy does not accept any responsibility for any breach of confidence which may arise from the use of this medium. If you have received this e-mail in error please notify us immediately at mailto:[EMAIL PROTECTED] and delete this e-mail from your system. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised.if you are not the intended recipient, any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. Please note that any views, opinions or advice contained in this email are those of the sending individual and not necessarily those of the firm. It is possible for data transmitted by e-mail to be deliberately or accidentally corrupted or intercepted. For this reason, where the communication is by e-mail, J&E Davy does not accept any responsibility for any breach of confidence which may arise from the use of this medium. If you have received this e-mail in error please notify us immediately at mailto:[EMAIL PROTECTED] and delete this e-mail from your system. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
NT Service Password
Hi, I am curious to know has anyone found a way to update the password that an NT service uses, via PERL ? I would like to be able to a. programatically stop services on remote servers (can do, works) b. Change the NT account and/or password the service uses fior security context (cannot do !) c. Restart the service (can do) under the new NT credentials (can do, works). If anyone has done it, or knows how, that'd be great thanks, Conor The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised.if you are not the intended recipient, any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. Please note that any views, opinions or advice contained in this email are those of the sending individual and not necessarily those of the firm. It is possible for data transmitted by e-mail to be deliberately or accidentally corrupted or intercepted. For this reason, where the communication is by e-mail, J&E Davy does not accept any responsibility for any breach of confidence which may arise from the use of this medium. If you have received this e-mail in error please notify us immediately at mailto:[EMAIL PROTECTED] and delete this e-mail from your system. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
select on Win NT
Hi there has anybody tried to check the readability of a pipe via the select command running ActivePerl under Windows NT? The following code is running fine in Linux, but select seems not to do what it should in Win NT. I ran that program in a pipeline with an executable out.exe that writes (and flushes) to stdout: out.exe | in.pl Regards Torsten $rin = $win = $ein = ''; vec($rin,fileno(STDIN),1) = 1; vec($win,fileno(STDOUT),1) = 1; $ein = $rin | $win; while ( 1 ) { $nfound = select($rout=$rin, undef, undef, 0.2); if ( $nfound ) { $c = sysread STDIN, $l, 1000; } } -- Dr.-Ing. Torsten Finke Ingenieurgemeinschaft IgH Heinz-Baecker-Str. 34 D-45356 Essen Tel.: +49 201 / 61 99 31 Fax.: +49 201 / 61 98 36 E-mail: [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: binmode question
Andre Warnier wrote: > Message text written by "$Bill Luebkert" > > Andre Warnier wrote: > >>Purely for intellectual curiosity, if anyone feels like takeing the time > > : > >>Is there any point in saying "binmode FH;" if FH is an output file handle > > ? > > Of course - if you're writing binary data (like a GIF, JPEG, etc). > I even use it on text files since I want my local files to have UNIX > line endings instead of Windoze. > < > > But, I don't understand. > > If one is writing binary data, one would use something like > > print FH $buffer; > > To myknowledge, Perl then writes whatever bytes are in $buffer, and does > not add anything at the end of it > (printing "$buffer\n" would be another story). > > So, if one is writing only the bytes present in $buffer, what difference > does it make wether one says "binmode FH" or not ? What about the 0x0A'a (LF's or \n's) that are embedded in the binary data ? Do you think that binary data does not contain linefeeds (not intended as linfeeds, but linefeeds none-the-less) ? A binary byte containing the value 10 would appear as a LF/\n. > My understanding of the difference between Unix and Windows line endings is > as follows : > > 1) > - For text files, Unix programs (libraries ?), by convention, understand a > line ending as being composed of a single "LF" character. > - Windows (libraries) on the other hand, by convention, expect a "CR/LF" > pair as a line ending. True, but Win32 will mostly work fine without the CR. > 2) > - When writing a text file in Perl under Unix, if one writes "xyz\n", Perl > tries to do "the right thing" under that platform, and converts the "\n" in > a single LF. > - When writing a text file in Perl under Windows, if one writes "xyz\n", > Perl tries to do "the right thing" under that platform, and converts the > "\n" in a CRLF pair. True. > This last, it would also do under Windows, if one beforehand said "binmode > FH" for the output filehandle. The difference is in writing "\n" or not, > not in the "binmode". > > Not so ? I didn't follow that last paragraph. On Win32 \n(LF) is converted to \r\n(CRLF) unless binmode is in effect - in which case \n will generate just a LF. > When I , under Perl under Unix, write a text file which I want to be > readable without conversion by a Windows program, I write it as : > > print FH "$Line\r\n"; > > without specifying binmode FH, and it works fine. binmode is a no-op on UNIX, so that would make sense to add the CR. > If I said the following : > > binmode FH; > print FH "$Line\n"; > > would it then automatically translate the "\n" into CRLF ? No - you have binmode set, so on Win32, the \n would not be converted to CRLF. ON UNIX binmode means nothing - so same result. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: 'required' problem
line 12 of the script looks like this: require 'fluffysearch.config'; and it works fine on the distant server. but on my local server i need the full path (c:inetpub/cgi-local/etc) can different ENV paths be set depending on the account that executes the script? because in this case a simple work around could be found. Thanks for your time Tim -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Carl Jolley Envoyé : jeudi 29 août 2002 06:41 À : Richard Latshaw Cc : [EMAIL PROTECTED] Objet : RE: 'required' problem On Wed, 28 Aug 2002, Richard Latshaw wrote: > >Can't locate fluffysearch.config in @INC (@INC contains: C:/Perl/lib > >C:/Perl/site/lib .) at > >c:\inetpub\wwwroot\gabarie\cgi-local\fluffymkindex.pl line 12. > > >why is the script not looking in the same directory that its in? > But it is looking at the directory that it's in. Notice the '.' character just before the ')' of course that depends on what you mean by the "directory its in". The . means the current directory. OTOH the program appears to be in the c:\inetpub\wwwroot\gabarie\cgi-local directory. Where is the fluffysearch.config file? Library includes don't care where the program itself is located but they do care what the current directory is set at. You can always set the current directory before trying the require. [EMAIL PROTECTED] All opinions are my own and not necessarily those of my employer ___ 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: binmode question
Message text written by "$Bill Luebkert" > Andre Warnier wrote: > Purely for intellectual curiosity, if anyone feels like takeing the time : > > Is there any point in saying "binmode FH;" if FH is an output file handle ? Of course - if you're writing binary data (like a GIF, JPEG, etc). I even use it on text files since I want my local files to have UNIX line endings instead of Windoze. < But, I don't understand. If one is writing binary data, one would use something like print FH $buffer; To myknowledge, Perl then writes whatever bytes are in $buffer, and does not add anything at the end of it (printing "$buffer\n" would be another story). So, if one is writing only the bytes present in $buffer, what difference does it make wether one says "binmode FH" or not ? My understanding of the difference between Unix and Windows line endings is as follows : 1) - For text files, Unix programs (libraries ?), by convention, understand a line ending as being composed of a single "LF" character. - Windows (libraries) on the other hand, by convention, expect a "CR/LF" pair as a line ending. 2) - When writing a text file in Perl under Unix, if one writes "xyz\n", Perl tries to do "the right thing" under that platform, and converts the "\n" in a single LF. - When writing a text file in Perl under Windows, if one writes "xyz\n", Perl tries to do "the right thing" under that platform, and converts the "\n" in a CRLF pair. This last, it would also do under Windows, if one beforehand said "binmode FH" for the output filehandle. The difference is in writing "\n" or not, not in the "binmode". Not so ? When I , under Perl under Unix, write a text file which I want to be readable without conversion by a Windows program, I write it as : print FH "$Line\r\n"; without specifying binmode FH, and it works fine. If I said the following : binmode FH; print FH "$Line\n"; would it then automatically translate the "\n" into CRLF ? André Warnier EIS LP [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs