Re: File::Copy to preserve file modifiction time ???
Michael D. Schleif wrote: > Using File::Copy to do > copy(\\server1\path\file, \\server1\path\file); > > Documentation says, > > ``Special behaviour if syscopy is defined (OS/2, VMS and Win32) > > ``If both arguments to copy are not file handles, then copy will perform > a ``system copy'' of the input file to a new output file, in order to > preserve file attributes, indexed file structure, etc. The buffer size > parameter is ignored. If either argument to copy is a handle to an > opened file, then data is copied using Perl operators, and no effort is > made to preserve file attributes or record structure.'' > > I expected that this means the same behaviour as typical win/dos copy > and *nix cp -p behaviour, whereby file modification time remains > unchanged. It does not behave that way. > > How can I achieve that behaviour, whereby file modification time is > identical on both copies? That seems to work on non-shared files - no server to test further with. It uses } elsif ($^O eq 'MSWin32') { *syscopy = sub { return 0 unless @_ == 2; return Win32::CopyFile(@_, 1); }; Win32::CopyFile is described as: Win32::CopyFile(FROM, TO, OVERWRITE) [CORE] The Win32::CopyFile() function copies an existing file to a new file. All file information like creation time and file attributes will be copied to the new file. However it will not copy the security information. If the destination file already exists it will only be overwritten when the OVERWRITE parameter is true. But even this will not overwrite a read-only file; you have to unlink() it first yourself. -- ,-/- __ _ _ $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: File::Copy to preserve file modifiction time ???
I always use utime after the file copy (to change the last modified time to what the source file modify time was).. And then Win32::Perms to find and set the perms and owner. Steven -Original Message- From: Michael D. Schleif [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 2:16 PM To: Perl-Win32-Users List Service Subject: File::Copy to preserve file modifiction time ??? Using File::Copy to do copy(\\server1\path\file, \\server1\path\file); Documentation says, ``Special behaviour if syscopy is defined (OS/2, VMS and Win32) ``If both arguments to copy are not file handles, then copy will perform a ``system copy'' of the input file to a new output file, in order to preserve file attributes, indexed file structure, etc. The buffer size parameter is ignored. If either argument to copy is a handle to an opened file, then data is copied using Perl operators, and no effort is made to preserve file attributes or record structure.'' I expected that this means the same behaviour as typical win/dos copy and *nix cp -p behaviour, whereby file modification time remains unchanged. It does not behave that way. How can I achieve that behaviour, whereby file modification time is identical on both copies? -- Best Regards, mds mds resource 888.250.3987 Dare to fix things before they break . . . Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know . . . ___ 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
File::Copy to preserve file modifiction time ???
Using File::Copy to do copy(\\server1\path\file, \\server1\path\file); Documentation says, ``Special behaviour if syscopy is defined (OS/2, VMS and Win32) ``If both arguments to copy are not file handles, then copy will perform a ``system copy'' of the input file to a new output file, in order to preserve file attributes, indexed file structure, etc. The buffer size parameter is ignored. If either argument to copy is a handle to an opened file, then data is copied using Perl operators, and no effort is made to preserve file attributes or record structure.'' I expected that this means the same behaviour as typical win/dos copy and *nix cp -p behaviour, whereby file modification time remains unchanged. It does not behave that way. How can I achieve that behaviour, whereby file modification time is identical on both copies? -- Best Regards, mds mds resource 888.250.3987 Dare to fix things before they break . . . Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know . . . ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Dave Roth's web site
ppm install http://www.roth.net/perl/packages/win32-daemon.ppd -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 2:39 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Dave Roth's web site Does anybody know Dave's web? I want to download daemon.pm on his web. Thanks a lot in advance! Lixin ___ Perl-Win32-Admin 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
Dave Roth's web site
Does anybody know Dave's web? I want to download daemon.pm on his web. Thanks a lot in advance! Lixin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: http::daemon
Ah. it worked like a charm, thanks very much. Original Message Follows From: "$Bill Luebkert" <[EMAIL PROTECTED]> To: Mike Brentlinger <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: http::daemon Date: Wed, 18 Sep 2002 10:29:38 -0700 Mike Brentlinger wrote: >Im having some difficulties with http::daemon. I know it must be something >i just dont understand, so could someone explain why in the example below >$c->send_file_response("C:\\index.html"); >works for me and >$c->send_response("test\n"); >does not? > >Do I need to send a header? and if so how and why do i not have to with the >send_file_response. > >Thanks much in advance. > > > > >#http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/site/lib/HTTP/Daemon.html > > use HTTP::Daemon; > use HTTP::Status; > my $d = new HTTP::Daemon LocalPort => 80 || die; > print "Please contact me at: url, ">\n"; > while (my $c = $d->accept) { > while (my $r = $c->get_request) { > if ($r->method eq 'GET') { ># $c->send_file_response("C:\\index.html"); >$c->send_response("test\n"); Try more like: my $resp = HTTP::Response->new(200, 'OK', undef, "test\n") or die "HTTP::Response: $!"; $c->send_response($resp); > } else { > $c->send_error(RC_FORBIDDEN) > } > } > $c->close; > undef($c); > } > >_ >Chat with friends online, try MSN Messenger: http://messenger.msn.com > >___ >Perl-Win32-Users mailing list >[EMAIL PROTECTED] >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > -- ,-/- __ _ _ $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 _ Send and receive Hotmail on your mobile device: http://mobile.msn.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Automatically closing Excel (Ross Matt-QMR000)
Hi, Ross This should do it: ... $Book->{Saved} = 1; $Book->Close; > From: Ross Matt-QMR000 <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED], [EMAIL PROTECTED], > [EMAIL PROTECTED] > Subject: Automatically closing Excel > Date: Tue, 10 Sep 2002 13:55:49 -0500 > > To anyone that can help. > > I have written a perl script to open and check the values inside of excel > worksheets and do some other stuff to it. All works well, It is just, I get > the warning pop up asking " are you sure you want to save?". it's not to bad > when you run two or three excel sheets but when the number is 581 it is > really a pain. Is there any way to force the save (without getting the > pop-up )or getting around this. any help would be beneficial. these are the > modules that I am using; > use Win32::WinError; > use Win32::OLE qw(in with); > use Win32::OLE::Const 'Microsoft Excel'; > > > local ($File) =@_; > $Win32::OLE::Warn = 3; > $Excel = Win32::OLE->GetActiveObject('Excel.Application') || > Win32::OLE->new('Excel.Application', 'Quit'); > $Book= $Excel->Workbooks->Open("$Win32Dir\\$File"); > > ... processing stuff > > > $Book->Close; > > > Thanks, > Matt Ross ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl Tool to automate Web Testing on Windows
I have a scriptlet on http://www.netsecadmin.com/cgi-bin/getsnipsweb.pl that scans for URL exploits. Bobby -Original Message- From: Gajendra Mehta [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 3:52 PM To: [EMAIL PROTECTED] Subject: Perl Tool to automate Web Testing on Windows Hello Everybody Would like to know if there is any perl tool to automate web Testing on windows. I know about Winrunner and Silk Test. Gaju __ Do you Yahoo!? Yahoo! News - Today's headlines http://news.yahoo.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs - This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. - If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Resolve IP address
Title: RE: Resolve IP address http://search.cpan.org/search?mode=module&query=nslookup > -Original Message- > From: Kevin [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 18, 2002 13:29 > To: Perl-Win32-Users > Subject: Resolve IP address > > > Hello, > > Is there a module that anyone can recommend that will reverse > resolve an IP > address and return a domain. > > TIA. > > --Kevin > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs >
RE: Perl Tool to automate Web Testing on Windows
> -Original Message- > From: Gajendra Mehta [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 4:52 PM > To: [EMAIL PROTECTED] > Subject: Perl Tool to automate Web Testing on Windows > > > Hello Everybody > > Would like to know if there is any perl tool to > automate web Testing on windows. > > I know about Winrunner and Silk Test. > What do you mean by "web testing"? If you mean you want to have a program that will access a web server through HTTP (using GET or POST methods) and then check for certain regular expression patterns or HTML field values, then I may have an answer for you. I recently put together a utility for in-house use that uses a custom scripting language to run tests (it uses Parse::RecDescent and LWP). The output is in Test::More format. A typical script looks like this: baseuri("http://webdev.site.com/mwps/";) username("Tillman-JP") password("mypassword") include("mwps_login.spec") test( name("My Work Plans Screen") get("wp_list.asp") match("Existing work plan", "7/1/02-6/30/03") match("Correct supervisor", "(Created by: Keith J Smith)") ) test( name("Supervised Members' Work Plans Screen") get("member_list.asp") match("Existing Member Work Plan", "SYLVIA B JOHNSON") ) test( name("Reports Screen") post("reports.asp", "x=1", "val2=3663") match("Executive Access", "Agency-Wide Executive Summary") match("Admin Access", "Members with Multiple Active Work Plans") ) include("mwps_admin.spec") ## Although it's still a bit rough, it's working for me. It will keep cookies (or discard them), and can support SSL and authenticated connections (since it uses LWP::UserAgent). It also allows use of perl-ish strings using q or qq. I'm using it to unit test my ActiveServerPages (ASP) applications, believe it or not. But it would work on any CGI-based app, such as JSP, Java Servlets, PHP, or Perl CGI. Interested? I can send you the source code if you are. jpt ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Newbie question!!
Title: RE: Newbie question!! ### untested my $dir = "/your/dir/here"; opendir(DIR,$dir) || die "Can't open dir $dir : $!\n"; my @files = readdir(DIR); close(DIR); foreach my $file (@files) { my ($name,$ext) = $file =~ /^([\w|\d]+)\[\d\]\.(\w+)$/; rename("$file","$name\.$ext"); } > -Original Message- > From: Avila, Jorge [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 16, 2002 16:03 > To: [EMAIL PROTECTED] > Subject: Newbie question!! > > > Hi all, > > I have a directory with a lot of files like: > > abc[1].htm > def[1].htm > 123[1].htm > 456[1].htm > > > Can anybody please help to create a short script to > rename it like ?? > > abc.htm > def.htm > 123.htm > 456.htm > > I have already tried using the rename.pl from > > http://www.sial.org/code/perl/scripts/rename.pl > > but I cannot figure out the right regular expression > (I'm running win2k). > > Please help. > > Regards, > Jorge > > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs >
RE: DESPERATE
This is untested, but what about copying the files to the new directory first and then deleting them? I'm also not sure, but you might have to do these operations separately rather than both of them inside the same while loop. I don't know if Perl cares which one of the operations it does first inside the while statement and you certainly don't want to delete before you copy. :-) my $dir = 'D:\ftproot\edi\inbox'; my $copydir = 'D:\ftproot\edi\tmp'; opendir(INVOICES,$dir) or die "$! \n"; while (my $invoice = readdir(INVOICES)) { system('copy /Y $_ $copydir\\$_'); # suppress warnings, and this is # assuming you want to copy directories # as well as files; if not, you'll need # to use the -f switch to assure you # copy only files system('del /F/S/Q $_'); # force deletion of read-only files, # delete recursively, suppress warnings } closedir(INVOICES); - Scot Robnett inSite Internet Solutions [EMAIL PROTECTED] http://www.insiteful.tv -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, September 10, 2002 2:34 AM To: [EMAIL PROTECTED] Subject: DESPERATE I'm really desperate here. I have a list of files in: D:\ftproot\edi\inbox\ I want to move these files to : D:\ftproot\edi\tmp\ before I can start processing. So I am using the code below but it doesn't work. I know I'm not eligible, but will you please help. opendir(INVOICES,'D:\ftproot\edi\test') || die "cannot open invoice: $!"; while ($invoice = readdir(INVOICES)) {($invoice rename('D:\ftproot\edi\test\$invoice','D:\ftproot\edi\tmp\$invoice'); } closedir(INVOICES) || die "can't close INVOICES: $!"; ___ 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: DESPERATE
Title: RE: DESPERATE try either changing your \ to / or else you need to \\ > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 10, 2002 03:34 > To: [EMAIL PROTECTED] > Subject: DESPERATE > > > > I'm really desperate here. > I have a list of files in: > D:\ftproot\edi\inbox\ > > I want to move these files to : > D:\ftproot\edi\tmp\ > before I can start processing. > > > So I am using the code below but it doesn't work. > I know I'm not eligible, but will you please help. > > > opendir(INVOICES,'D:\ftproot\edi\test') || die "cannot open > invoice: $!"; > > while ($invoice = readdir(INVOICES)) > {($invoice > > rename('D:\ftproot\edi\test\$invoice','D:\ftproot\edi\tmp\$invoice'); > } > closedir(INVOICES) || die "can't close INVOICES: $!"; > > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs >
Re: Newbie question!!
Avila, Jorge wrote: > Hi all, > > I have a directory with a lot of files like: > > abc[1].htm > def[1].htm > 123[1].htm > 456[1].htm > > > Can anybody please help to create a short script to rename it like ?? > > abc.htm > def.htm > 123.htm > 456.htm > > I have already tried using the rename.pl from > > http://www.sial.org/code/perl/scripts/rename.pl > > but I cannot figure out the right regular expression (I'm running win2k). > > Please help. use strict; my $dir1 = './html'; my $dir2 = '.'; opendir DIR, $dir1; while (my $file = readdir DIR) { if ($file =~ /^(.*)\[\d+\](\.html?)$/) { print "rename '$dir1/$file', '$dir2/$1$2'\n"; rename "$dir1/$file", "$dir2/$1$2" or die "rename '$dir1/$file', '$dir2/$1$2': $!"; } } closedir DIR; __END__ -- ,-/- __ _ _ $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: DESPERATE
You have all kinds of options. I would recommend using the Win32::FileOp module unless of course you want the code to be portable to UNIX then you are going about it the right way but you need to change your code a bit: Try: opendir(INVOICES,'D:\ftproot\edi\test') || die "cannot open invoice: $!"; while ($invoice = readdir(INVOICES)) { rename("'D:\ftproot\edi\test\$invoice","D:\ftproot\edi\tmp\$invoice"); } closedir(INVOICES) || die "can't close INVOICES: $!"; Basically in your code the "$invoice" variable before the "rename" function was not expected and because you need variable interpolation of the file name "$invoice" in your source and target paths you must use double quotes instead of single quotes. I didn't test this code but it should work. Hope this helps. Kind regards, Trevor J. Joerges $_=q;rrUSFWPSZK.ZKPFSHFT,rkvtuZbopuifsZQZibdl rrqpxfsfeZcyZQ,,riuuq://xxx.%.dpn,ru~@%.dpn ,rrr8-) ;;s;\~;kpfshft;g;s;\%;tfoenjnf;g;y;B-x;A-w;; s;P;perl;g;s;,;\n;g;s;Y; ;g;s;q;\t;g;print; - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 10, 2002 3:34 AM Subject: DESPERATE | | I'm really desperate here. | I have a list of files in: | D:\ftproot\edi\inbox\ | | I want to move these files to : | D:\ftproot\edi\tmp\ | before I can start processing. | | | So I am using the code below but it doesn't work. | I know I'm not eligible, but will you please help. | | | opendir(INVOICES,'D:\ftproot\edi\test') || die "cannot open invoice: $!"; | | while ($invoice = readdir(INVOICES)) | {($invoice | rename('D:\ftproot\edi\test\$invoice','D:\ftproot\edi\tmp\$invoice'); | } | closedir(INVOICES) || die "can't close INVOICES: $!"; | | | ___ | 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: Regexp with 0
Muñoz O, Normann (Valparaíso) wrote: > Hi, I have a question: > > I get from STNDIN a string, for each caracter I check if it belong to a > predifined group, the problem is that the caracter '0' is in that > group'. As 0 es false, the match doesn't consider it. > > ¿How can I do that so the match take it as a caracter an not as false? > > CARACTER[$i] =~/^(a|b|1|0)/g; If I understand your Q: use strict; my @char = split //, 'ab1cdef0'; for (my $ii = 0; $ii < @char; $ii++) { if ($char[$ii] =~ /^(a|b|1|0)/) { print "$char[$ii] OK\n"; } } __END__ -- ,-/- __ _ _ $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: http::daemon
Mike Brentlinger wrote: > Im having some difficulties with http::daemon. I know it must be > something i just dont understand, so could someone explain why in the > example below >$c->send_file_response("C:\\index.html"); > works for me and >$c->send_response("test\n"); > does not? > > Do I need to send a header? and if so how and why do i not have to with > the send_file_response. > > Thanks much in advance. > > > > > >#http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/site/lib/HTTP/Daemon.html > > > use HTTP::Daemon; > use HTTP::Status; > my $d = new HTTP::Daemon LocalPort => 80 || die; > print "Please contact me at: url, ">\n"; > while (my $c = $d->accept) { > while (my $r = $c->get_request) { > if ($r->method eq 'GET') { > # $c->send_file_response("C:\\index.html"); >$c->send_response("test\n"); Try more like: my $resp = HTTP::Response->new(200, 'OK', undef, "test\n") or die "HTTP::Response: $!"; $c->send_response($resp); > } else { > $c->send_error(RC_FORBIDDEN) > } > } > $c->close; > undef($c); > } > > _ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > -- ,-/- __ _ _ $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: Regexp with 0
Title: Regexp with 0 Normann, Mi surgencia es que utiliza lo siguiente: CARACTER[$i] =~/^([0|a|c|0])/ usando corchetes dira a Perl que este es una clase de caracter que pertenece al grupo que esta buscando. Espero que este le ayude. Dispense que not tengo este teclado con acentos. Pregunta: Donde esta su negocia - cual pais? -Original Message-From: "Muñoz O, Normann (Valparaíso)" [mailto:[EMAIL PROTECTED]]Sent: Thursday, September 05, 2002 9:44 AMTo: [EMAIL PROTECTED]Subject: Regexp with 0 Hi, I have a question: I get from STNDIN a string, for each caracter I check if it belong to a predifined group, the problem is that the caracter '0' is in that group'. As 0 es false, the match doesn't consider it. ¿How can I do that so the match take it as a caracter an not as false? CARACTER[$i] =~/^(a|b|1|0)/g; Thanks. ATTE: Normann Muñoz Oyarzún. Administrador de Sistemas El Mercurio de Valparaíso S.A.P. 264188 - 204189 [EMAIL PROTECTED]
RE: Regexp with 0
Title: Regexp with 0 Change to an if: if ( CARACTER[$i] =~ /^(a|b|1|0)/g; ) { #true }else { # false } Wags ;) -Original Message-From: "Muñoz O, Normann (Valparaíso)" [mailto:[EMAIL PROTECTED]]Sent: Friday, September 06, 2002 14:36To: [EMAIL PROTECTED]Subject: Regexp with 0 Hi, I have a question: I get from STNDIN a string, for each caracter I check if it belong to a predifined group, the problem is that the caracter '0' is in that group'. As 0 es false, the match doesn't consider it. ¿How can I do that so the match take it as a caracter an not as false? CARACTER[$i] =~/^(a|b|1|0)/g; Thanks. ATTE: Normann Muñoz Oyarzún. Administrador de Sistemas El Mercurio de Valparaíso S.A.P. 264188 - 204189 [EMAIL PROTECTED] ** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited.
Resolve IP address
Hello, Is there a module that anyone can recommend that will reverse resolve an IP address and return a domain. TIA. --Kevin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Counting using a regex.
Phil Ritchie wrote: > I'm trying to count occurrences of patterns using > > $_ = 'ababcdabcd'; > while ($_ =~ m/\Gab/gc) > { > $num++; > } > while ($_ =~ m/\Gcd/gc) > { > $num++; > } > print $num; > > But it doesn't work. I have a feeling that I need to employ the pos > function somewhere but have no idea where or how. Here's mine: use strict; my $A = 'abcabc abc ab d'; my $cnt = 0; $cnt++ while $A =~ /ab/g; print $cnt, "\n"; __END__ -- ,-/- __ _ _ $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: a question of regular expression
This sounds like the perfect time for a split() my($var1,$var2) = split /#/,$line; perldoc -f split -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 7:49 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: a question of regular expression Dear all, I have a line like this: notepad test.txt # This is a test. I want to put seprate the line into two by "#", like var1 = "notepad test.txt" var2 = "This is a test." (I do not want to include # sign) How can I do? Thanks a lot inadvance! Lixin ___ Perl-Win32-Admin 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
Read events from saved eventlog file
Dear All , I am in need of reading events from a saved event log file(*.evt). Please suggest me which module i should go to. I have checked lanman , but in vain. Please help me. This is very urgent. Thanks and regards rajuveera ** This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. ** ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: A regular expression question
while (<>) { if ( /^#/ ){ print; } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 3:12 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: A regular expression question I have a cron file which the line looks like this: 00 22 * * * perl -S queue_submit.pl esd-foundry "perl -S host-scrubber.pl" #build host scrubber 30 22 * * * perl -S queue_submit.pl esd-foundry "perl -S group-scrubber.pl" #build group scrubber 30 22 * * * perl -S queue_submit.pl esd-foundry "perl -S object-scrubber.pl" #build object scrubber I want to get the comment after # of each line(not including "#"), how could I do this? Thanks a lot in advance! Lixin ___ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Automatically closing Excel
To anyone that can help. I have written a perl script to open and check the values inside of excel worksheets and do some other stuff to it. All works well, It is just, I get the warning pop up asking " are you sure you want to save?". it's not to bad when you run two or three excel sheets but when the number is 581 it is really a pain. Is there any way to force the save (without getting the pop-up )or getting around this. any help would be beneficial. these are the modules that I am using; use Win32::WinError; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; local ($File) =@_; $Win32::OLE::Warn = 3; $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Book= $Excel->Workbooks->Open("$Win32Dir\\$File"); ... processing stuff $Book->Close; Thanks, Matt Ross Motorola ePIMS Configuration Management CMPR Phone: 817.245.6540 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Response.Buffer = False ?
hi Bill, i can't do this because i only have write permission(from a script and not using ftp) to a folder that can't be access from an browser. so i have to generate the HTML code from inside the script :( Cheers, Tim -Message d'origine- De : $Bill Luebkert [mailto:[EMAIL PROTECTED]] Envoyé : mercredi 18 septembre 2002 11:02 À : Tim Fletcher Cc : [EMAIL PROTECTED] Objet : Re: Response.Buffer = False ? Tim Fletcher wrote: > hi all, > > i have a perl script(html page) that takes a good 10 mins to run. i would like to be >able to show the user that the script is still > running by regularly printing a little text to the page. but it seems that the page >isn't sent to the browser till the whole script > has been processed! in VBscript ASP (the language the script was first written in) i >had a property that i could change; > Response.Buffer = False. > is there something similar in perl? > > Thanks all for your time & have a nice day Easiest thing to do would be to write the HTML to a file and send a meta refresh page back to the browser that points to the file and periodically refreshes from the file (which you are changing). -- ,-/- __ _ _ $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: Response.Buffer = False ?
Tim Fletcher wrote: > hi all, > > i have a perl script(html page) that takes a good 10 mins to run. i would like to be >able to show the user that the script is still > running by regularly printing a little text to the page. but it seems that the page >isn't sent to the browser till the whole script > has been processed! in VBscript ASP (the language the script was first written in) i >had a property that i could change; > Response.Buffer = False. > is there something similar in perl? > > Thanks all for your time & have a nice day Easiest thing to do would be to write the HTML to a file and send a meta refresh page back to the browser that points to the file and periodically refreshes from the file (which you are changing). -- ,-/- __ _ _ $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
Response.Buffer = False ?
hi all, i have a perl script(html page) that takes a good 10 mins to run. i would like to be able to show the user that the script is still running by regularly printing a little text to the page. but it seems that the page isn't sent to the browser till the whole script has been processed! in VBscript ASP (the language the script was first written in) i had a property that i could change; Response.Buffer = False. is there something similar in perl? Thanks all for your time & have a nice day Cheers, Tim ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Read events from saved eventlog file
Win32::EventLog. Also check out the documentation on the non-standard OpenBackup function on http://www.le-berre.com/perl/perldoc.htm. This may be what you are after. Phil Morley |-+---> | | Veeraraju_Mareddi | | | <[EMAIL PROTECTED]> | | | Sent by:| | | [EMAIL PROTECTED]| | | veState.com | | | | | | | | | 18/09/02 06:41 | | | | |-+---> >| | | |To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>, | |"'[EMAIL PROTECTED]'" | |<[EMAIL PROTECTED]> | |cc: | |Subject: Read events from saved eventlog file | >| Dear All , I am in need of reading events from a saved event log file(*.evt). Please suggest me which module i should go to. I have checked lanman , but in vain. Please help me. This is very urgent. Thanks and regards rajuveera ** This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. ** ___ Perl-Win32-Admin 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