Re: Perl script at shutdown
You can download a free copy of HSLAB Shutdown folder Lite, I have downloaded it from: http://www.hs-lab.com/Downloads/Shareware/df/df-l.exe and it works perfect! - Original Message - From: Hirosi Taguti [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 16, 2003 5:42 AM Subject: Perl script at shutdown Hello, I wanna make a Perl script doing some little jobs before my PC's shutdown, Windows 2000 pro. Is there a start-up-folder-like folder executing scripts at shutdown time or I must running all the day long a script waiting WM_ENDSESSION message, which I don't think perl script can receive it? Regards, Hirosi Taguti [EMAIL PROTECTED] ___ 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: remove carriage return
Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Rquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Keyboard input sting on Win32 pltform
hi all, i have a code snippet as below: while( $pass1 ne $pass2 ) { while( $pass1 eq || $pass1 !~ /^[a-zA-Z0-9-_]{3,16}$/ ) { print Enter a password for the administrator account: ; $pass1 = STDIN; chomp $pass1; print Hello\n; print You entered $pass1 \n; if(! $pass1 ) { print \n\nIt's just plain stupid to not have a password. Try again!\n; } elsif ( $pass1 !~ /^.{3,16}$/ ) { print The password must be 3-16 characters in length.; } } print \nPlease retype the password to verify: ; $pass2 = STDIN; chomp $pass2; if ($pass1 ne $pass2) { print \n\nPasswords don't match. Try again!\n; $pass1 = ; $pass2 = *; } } although i enter the password as Hello, it does not come out of the inner loop. I guess it is because pass1 reads even carriage return which is probably invalid character. Can anyone help me to handle this. Regards Manjula ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: remove carriage return
use strict; use warnings; my $input_file = input.txt; open (INFILE, $input_file) or die Can't open $input_file! $!\n; my @input = INFILE; foreach (@input) { chomp; next if (/^\D/); print $_\n; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 10:04 To: [EMAIL PROTECTED] Subject: RE: remove carriage return Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Réquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ 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: Keyboard input sting on Win32 pltform
Manjula Babu wrote: hi all, i have a code snippet as below: while( $pass1 ne $pass2 ) { while( $pass1 eq || $pass1 !~ /^[a-zA-Z0-9-_]{3,16}$/ ) { print Enter a password for the administrator account: ; $pass1 = STDIN; chomp $pass1; print Hello\n; print You entered $pass1 \n; if(! $pass1 ) { print \n\nIt's just plain stupid to not have a password. Try again!\n; } elsif ( $pass1 !~ /^.{3,16}$/ ) { print The password must be 3-16 characters in length.; } } print \nPlease retype the password to verify: ; $pass2 = STDIN; chomp $pass2; if ($pass1 ne $pass2) { print \n\nPasswords don't match. Try again!\n; $pass1 = ; $pass2 = *; } } although i enter the password as Hello, it does not come out of the inner loop. I guess it is because pass1 reads even carriage return which is probably invalid character. Can anyone help me to handle this. This should work, but you should use Term::ReadKey to stop the echo and not echo it out yourself (example snippet after). use strict; my $pass1 = ''; my $pass2 = ''; while (1) { while ($pass1 eq '' || $pass1 !~ /^[\w-]{3,16}$/ ) { print Enter a password for the administrator account: ; $pass1 = STDIN; chomp $pass1; print You entered $pass1\n; if (!$pass1) { print It's plain stupid to not have a password.\n; print Try again!\n; } elsif ($pass1 !~ /^.{3,16}$/) { print The password must be 3-16 characters.; } } print Please retype the password to verify: ; $pass2 = STDIN; chomp $pass2; last if $pass1 eq $pass2; print Passwords don't match. Try again!\n; $pass1 = ''; $pass2 = ''; } __END__ Example to read password with no echo: use Term::ReadKey; binmode STDIN; print Password: ; ReadMode ('cbreak'); while (defined (my $ch = ReadKey ())) { last if $ch eq \x0a or $ch eq \x0d; if ($ch eq \x08) {# backspace print \b \b if $pwd; # back up 1 chop $pwd; next; } if ($ch eq \x15) {# ^U print \b \b x length $pwd;# back 1 for each char $pwd = ''; next; } $pwd .= $ch; print '*'; } ReadMode ('restore'); -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /-- o // // Castle of Medieval Myth Magic http://www.todbe.com/ -/-' /___/__/_/_http://dbecoll.tripod.com/ (Free site for Perl/Lakers) ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: remove carriage return
Thanks it works but it deletes the line which not begins with a number, i wanted to put what is not beginning with a number and at the beginning of a new line to the continuation of the preceding line. I hope you understand what i want to do. Thanks. -Message d'origine- De: Beckett Richard-qswi266 [mailto:[EMAIL PROTECTED] Date: vendredi 18 juillet 2003 13:01 : SII - GONCALVES, Jorge; [EMAIL PROTECTED] Objet: RE: remove carriage return use strict; use warnings; my $input_file = input.txt; open (INFILE, $input_file) or die Can't open $input_file! $!\n; my @input = INFILE; foreach (@input) { chomp; next if (/^\D/); print $_\n; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 10:04 To: [EMAIL PROTECTED] Subject: RE: remove carriage return Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Rquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ 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: remove carriage return
use strict; my @out; foreach() { chomp; if (/^\d+;/) { push @out, $_; } else { if (defined $out[-1]) { $out[-1] .= $_; } } } $,=\n; print @out, ; -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoy : vendredi 18 juillet 2003 11:04 : [EMAIL PROTECTED] Objet : RE: remove carriage return Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Rquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs * Ce message et toutes les pices jointes (ci-aprs le message) sont confidentiels et tablis l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorise est interdite. Tout message lectronique est susceptible d'altration. La SOCIETE GENERALE et ses filiales dclinent toute responsabilit au titre de ce message s'il a t altr, dform ou falsifi. This message and any attachments (the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. * ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Neater?
Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } But this doesn't work as intended. Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Neater?
How 'bout: print \$_ = $_\n foreach (1, 2 4); Or foreach my $sheet (1, 2, 4) { print \$sheet = $sheet\n; } jason -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Beckett Richard-qswi266 Sent: Friday, July 18, 2003 8:57 AM To: '[EMAIL PROTECTED]' Subject: Neater? Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } But this doesn't work as intended. Thanks. R. ___ 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: remove carriage return
C:\tmptype in.txt 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Réquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des C:\tmpperl -pe BEGIN{ $\=qq{};} chomp; print qq{\n} if($.1/^\d/); in.txt 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance -Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole-Bouygtel/Fraude/FRD : Geole/Réquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G :LM-Forfait/Gestion Des Hope this helps Tobias -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, July 18, 2003 5:54 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: remove carriage return Thanks it works but it deletes the line which not begins with a number, i wanted to put what is not beginning with a number and at the beginning of a new line to the continuation of the preceding line. I hope you understand what i want to do. Thanks. -Message d'origine- De: Beckett Richard-qswi266 [mailto:[EMAIL PROTECTED] Date: vendredi 18 juillet 2003 13:01 À: SII - GONCALVES, Jorge; [EMAIL PROTECTED] Objet: RE: remove carriage return use strict; use warnings; my $input_file = input.txt; open (INFILE, $input_file) or die Can't open $input_file! $!\n; my @input = INFILE; foreach (@input) { chomp; next if (/^\D/); print $_\n; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 10:04 To: [EMAIL PROTECTED] Subject: RE: remove carriage return Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Réquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ 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-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Neater?
What about: foreach my $sheet (1,2,4) { print \$sheet = $sheet\n; } Tobias -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Beckett Richard-qswi266 Sent: Friday, July 18, 2003 6:57 AM To: '[EMAIL PROTECTED]' Subject: Neater? Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } But this doesn't work as intended. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Neater?
Beckett Richard-qswi266 wrote, on Friday, July 18, 2003 8:57 AM : Is there a neater way of doing this:? : : my $sheet; : foreach (1, 2, 4) { : $sheet = $_; : print \$sheet = $sheet\n; : } Is this what you're looking for? foreach my $sheet (1, 2, 4) { print \$sheet = $sheet\n; } Now, you could also print \$sheet = $sheet\n foreach my $sheet (1, 2, 4); but I have the feeling you mean to do more with $sheet than print it out :). Good luck, Joe == Joseph P. Discenza, Sr. Programmer/Analyst mailto:[EMAIL PROTECTED] Carleton Inc. http://www.carletoninc.com 574.243.6040 ext. 300fax: 574.243.6060 Providing Financial Solutions and Compliance for over 30 Years * Please note that our Area Code has changed to 574! * ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Neater?
Title: RE: Neater? foreach (1, 2, 4) { print \$sheet = $_\n; } -Original Message- From: Beckett Richard-qswi266 [mailto:[EMAIL PROTECTED]] Sent: Friday, July 18, 2003 8:57 AM To: '[EMAIL PROTECTED]' Subject: Neater? Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } But this doesn't work as intended. Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
FW: [ERR] Neater?
Does anyone else see this when they post? Any idea what it is? Should I worry about it? Thanks. R. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 14:33 To: Richard Beckett Subject: [ERR] Neater? Transmit Report: To: [EMAIL PROTECTED], 2003/07/18 22:32:59, 999, o?e1ae 1/4o1/2A1/4-1o Ac1/4O1/2A?? AE?u ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Neater?
Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } But this doesn't work as intended. Thanks. R. Guys, foreach my $sheet (1, 2, 4) { print \$sheet = $sheet\n; } Is exactly what I was trying to do. Thanks to all who replied, there's too many to list! :-D R ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Antwort: Neater?
Hi, try: foreach my $sheet (1, 2, 4) { print \$sheet = $sheet\n; } Regards, Martin Kellner |-+--- | | Beckett Richard-qswi266 | | | [EMAIL PROTECTED] | | | Gesendet von: | | | [EMAIL PROTECTED]| | | veState.com | | | | | | | | | 18.07.2003 14:57| | | | |-+--- --| | | | An: '[EMAIL PROTECTED]' [EMAIL PROTECTED]| | Kopie: | | Thema:Neater? | --| Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } But this doesn't work as intended. Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [EMAIL PROTECTED] This footnote also confirms that this email message has been inspected by SOPHOS Antivirus for the presence of computer viruses. ** ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Neater?
foreach $sheet (1,2,4) { print \$sheet = $sheet\n; } -Message d'origine- De : Beckett Richard-qswi266 [mailto:[EMAIL PROTECTED] Envoyé : vendredi 18 juillet 2003 14:57 À : '[EMAIL PROTECTED]' Objet : Neater? Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } But this doesn't work as intended. Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs * Ce message et toutes les pièces jointes (ci-après le message) sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. La SOCIETE GENERALE et ses filiales déclinent toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. This message and any attachments (the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. * ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Neater?
- Original Message - From: Beckett Richard-qswi266 [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 10:57 PM Subject: Neater? Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } But this doesn't work as intended. for (1,2,4) {print \$_ = $_\n} and if it positively definitely has to be loaded into a variable named '$sheet' : for my $sheet (1,2,4) { print \$sheet = $sheet\n; } Cheers, Rob ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: REWRITE RE: Error trapping
Title: RE: REWRITE RE: Error trapping Grrr still didn't catch the error =( -Original Message- From: Burak Gürsoy [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 17, 2003 1:06 PM To: [EMAIL PROTECTED] Subject: RE: REWRITE RE: Error trapping ok, try this one: #!/usr/bin/perl -w use strict; BEGIN { $| = 1; $SIG{__DIE__} = sub my $msg = shift; EventLogger(PERL Service, error, 666, $msg\n\n); exit; }; } # add your code here... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Farrington, Ryan Sent: Thursday, July 17, 2003 4:18 PM To: '[EMAIL PROTECTED]' Subject: REWRITE RE: Error trapping Ok so now here is the stumper for me... I used [code] Local $SIG{__DIE__} = sub my $msg = shift; EventLogger(PERL Service, error, 666, $msg\n\n); exit; }; [/code] And it died again today but no event written =( if it dies in a module will this catch it? -Original Message- From: Burak Gursoy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 15, 2003 1:52 PM To: [EMAIL PROTECTED] Subject: RE: Error trapping it is $SIG{__DIE__} actually... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Carl Jolley Sent: Tuesday, July 15, 2003 7:39 PM To: FARRINGTON, RYAN Cc: [EMAIL PROTECTED] Subject: Re: Error trapping On Mon, 14 Jul 2003, FARRINGTON, RYAN wrote: Ok I have a perl script that has been compiled as an executable and is running on a 2K server as a service. Now the problem is that it is die'ing without generating an error. Is there anyway to trap the die and then have it output it to a function before actually die'ing? Have you tried to define a $SIG{DIE} subroutine? [EMAIL PROTECTED] Carl Jolley 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 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
DBI errors
Hi, I am writing a simple query which is failing: The query and the error is : QUERY = use DBI; $dbh = DBI-connect('DBI:Oracle:reldb','rnd','welcome') or die Couldn't connect to Local database: . DBI-errstr; $GET_ARU_FAILURES EOU; SELECT b.product_abbreviation,a.bug_number,e.status,f.release_name,c.platform_short_name,d.description FROM [EMAIL PROTECTED] a, [EMAIL PROTECTED] b,[EMAIL PROTECTED] c, [EMAIL PROTECTED] d, [EMAIL PROTECTED] e,[EMAIL PROTECTED] f WHERE b.product_id=a.product_id and a.product_id in (SELECT product_id from [EMAIL PROTECTED] where product_abbreviation like ?) and a.status_id in (55,62) and c.platform_id=a.platform_id and d.status_id=a.status_id and e.rptno=a.bug_number and f.release_id=a.release_id ORDER by b.product_abbreviation EOU $vget_aru_failures = $dbh-prepare_cached($GET_ARU_FAILURES) or die Couldnt prepare query . DBI-errstr; . . . . . ERROR Backslash found where operator expected at Noname1.pl line 10, near aru_bugfix_requests\ Backslash found where operator expected at Noname1.pl line 10, near @arudb\ (Missing operator before \?) Bareword found where operator expected at Noname1.pl line 10, near %20a (Missing operator before a?) Backslash found where operator expected at Noname1.pl line 10, near aru_products\ Bareword found where operator expected at Noname1.pl line 10, near @arudb b (Missing operator before b?) Backslash found where operator expected at Noname1.pl line 10, near aru_platforms\ Bareword found where operator expected at Noname1.pl line 10, near @arudb c (Missing operator before c?) Backslash found where operator expected at Noname1.pl line 10, near aru_status_codes\ Bareword found where operator expected at Noname1.pl line 10, near @arudb d (Missing operator before d?) Backslash found where operator expected at Noname1.pl line 10, near rpthead\ Bareword found where operator expected at Noname1.pl line 10, near @bugdb e (Missing operator before e?) Backslash found where operator expected at Noname1.pl line 10, near aru_releases\ Bareword found where operator expected at Noname1.pl line 10, near @arudb f (Missing operator before f?) Bareword found where operator expected at Noname1.pl line 12, near @arudb where (Missing operator before where?) syntax error at Noname1.pl line 10, near aru_bugfix_requests\ Execution of Noname1.pl aborted due to compilation errors. _ It's new, it's here! It's full of fun! http://server1.msn.co.in/sp03/messengerpromo/index.asp MSN Messenger V6.0 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: DBI errors
What happens if you do this instead: $GET_ARU_FAILURES = EOU; (yes, the equal sign is missing). And, you're not doing any interpolation in the here-doc, so you might as well write: $GET_ARU_FAILURES = 'EOU'; and save yourself from writing those \ over and over again. Hope this helps Tobias -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ashish srivastava Sent: Friday, July 18, 2003 8:40 AM To: [EMAIL PROTECTED] Subject: DBI errors Hi, I am writing a simple query which is failing: The query and the error is : QUERY = use DBI; $dbh = DBI-connect('DBI:Oracle:reldb','rnd','welcome') or die Couldn't connect to Local database: . DBI-errstr; $GET_ARU_FAILURES EOU; SELECT b.product_abbreviation,a.bug_number,e.status,f.release_name,c. platform_short_name,d.description FROM [EMAIL PROTECTED] a, [EMAIL PROTECTED] b,[EMAIL PROTECTED] c, [EMAIL PROTECTED] d, [EMAIL PROTECTED] e,[EMAIL PROTECTED] f WHERE b.product_id=a.product_id and a.product_id in (SELECT product_id from [EMAIL PROTECTED] where product_abbreviation like ?) and a.status_id in (55,62) and c.platform_id=a.platform_id and d.status_id=a.status_id and e.rptno=a.bug_number and f.release_id=a.release_id ORDER by b.product_abbreviation EOU $vget_aru_failures = $dbh-prepare_cached($GET_ARU_FAILURES) or die Couldnt prepare query . DBI-errstr; . . . . . ERROR Backslash found where operator expected at Noname1.pl line 10, near aru_bugfix_requests\ Backslash found where operator expected at Noname1.pl line 10, near @arudb\ (Missing operator before \?) Bareword found where operator expected at Noname1.pl line 10, near %20a (Missing operator before a?) Backslash found where operator expected at Noname1.pl line 10, near aru_products\ Bareword found where operator expected at Noname1.pl line 10, near @arudb b (Missing operator before b?) Backslash found where operator expected at Noname1.pl line 10, near aru_platforms\ Bareword found where operator expected at Noname1.pl line 10, near @arudb c (Missing operator before c?) Backslash found where operator expected at Noname1.pl line 10, near aru_status_codes\ Bareword found where operator expected at Noname1.pl line 10, near @arudb d (Missing operator before d?) Backslash found where operator expected at Noname1.pl line 10, near rpthead\ Bareword found where operator expected at Noname1.pl line 10, near @bugdb e (Missing operator before e?) Backslash found where operator expected at Noname1.pl line 10, near aru_releases\ Bareword found where operator expected at Noname1.pl line 10, near @arudb f (Missing operator before f?) Bareword found where operator expected at Noname1.pl line 12, near @arudb where (Missing operator before where?) syntax error at Noname1.pl line 10, near aru_bugfix_requests\ Execution of Noname1.pl aborted due to compilation errors. _ It's new, it's here! It's full of fun! http://server1.msn.co.in/sp03/messengerpromo/index.asp MSN Messenger V6.0 ___ 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: REWRITE RE: Error trapping
well... it must catch it. BEGIN blocks happen at the compile time and at the beginning... for example, I can catch this compile time error: #!/usr/bin/perl -w use strict; BEGIN { $| = 1; $SIG{__DIE__} = sub my $msg = shift; print ERROR: $msg; exit; }; } use dbdbdb; but if I add the signal code outside BEGIN, I can not catch it... if you didnt properly defined EventLogger() sub, that can be the problem... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Farrington, Ryan Sent: Friday, July 18, 2003 5:26 PM To: [EMAIL PROTECTED] Subject: RE: REWRITE RE: Error trapping Grrr still didn't catch the error -Original Message- From: Burak Gürsoy [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 1:06 PM To: [EMAIL PROTECTED] Subject: RE: REWRITE RE: Error trapping ok, try this one: #!/usr/bin/perl -w use strict; BEGIN $| = 1; $SIG{__DIE__} = sub my $msg = shift; EventLogger(PERL Service, error, 666, $msg\n\n); exit; }; } # add your code here... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Farrington, Ryan Sent: Thursday, July 17, 2003 4:18 PM To: '[EMAIL PROTECTED]' Subject: REWRITE RE: Error trapping Ok so now here is the stumper for me... I used [code] Local $SIG{__DIE__} = sub my $msg = shift; EventLogger(PERL Service, error, 666, $msg\n\n); exit; }; [/code] And it died again today but no event written =( if it dies in a module will this catch it? -Original Message- From: Burak Gursoy [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2003 1:52 PM To: [EMAIL PROTECTED] Subject: RE: Error trapping it is $SIG{__DIE__} actually... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Carl Jolley Sent: Tuesday, July 15, 2003 7:39 PM To: FARRINGTON, RYAN Cc: [EMAIL PROTECTED] Subject: Re: Error trapping On Mon, 14 Jul 2003, FARRINGTON, RYAN wrote: Ok I have a perl script that has been compiled as an executable and is running on a 2K server as a service. Now the problem is that it is die'ing without generating an error. Is there anyway to trap the die and then have it output it to a function before actually die'ing? Have you tried to define a $SIG{DIE} subroutine? [EMAIL PROTECTED] Carl Jolley 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 ___ 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
find files across network
Hi all, The search function is incredibly slow on Activestate. I am looking for a sample script that lets me search my entire network for a file. foreach $server (@Servers) { if (file I'm looking for ) { print $file \tPath to file; } ) Anyone have suggestions? -Tom ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Neater?
Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print \$sheet = $sheet\n; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print \$sheet = $sheet\n; } print \$sheet = $_\n for (1,2,4) ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs