RE: directory
It is looping because of what you said. Windows will place the modified files at the end of the directory. Thus when you modify the last unmodified file, it will continue with already modified files because they were appended to the end of the directory. This can continue forever. Try reading your files into an array and then working with the array. Troy -Original Message- From: Tanya Graham [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 12:32 PM To: 'Rubinow, Larry'; Tanya Graham; 'Troy Sniff'; [EMAIL PROTECTED] Subject: RE: directory it looks like it is in an infinite loop now...do my curly braces look wrong? chomp ($dirname = STDIN); opendir (DIR, $dirname) or die can't open directory $dirname: $!; $copyright = COPYRIGHT; #while ( defined ($file = readdir (DIR))){ my @files = readdir (DIR); foreach my $file(@files){ while (defined $file){ next if ($file=~/^\.+$/); open (SOURCE, $dirname/$file) or die can't open original file $file ; open (NEW, $dirname/file2.txt) or die Can't Create new file; print NEW $copyright or die can't print copyright info to new file; while (SOURCE){ print NEW $_; } close NEW; close SOURCE; rename $dirname/file2.txt, $dirname/$file; } } thanks tanya -Original Message- From: Rubinow, Larry [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 11:24 AM To: 'Tanya Graham'; 'Troy Sniff'; [EMAIL PROTECTED] Subject: RE: directory Tanya Graham wrote: it is very close...sometimes it adds the copyright twice, it looks like it does that to the first and last file in the folder. any ideas why? also, on Weird. It's possible you're actually reopening a file you've already prepended to. Don't know. To ensure you're not doing this, try reading all the file names at once, rather than one by one; then you don't have to worry about the OS modifying the directory contents while your loop is running. Instead of while ( defined ($file = readdir (DIR))){ try my @files = readdir( DIR ); foreach my $file(@files) { while( defined $file ) { # ... a larger note, do you think there will be problems when i'm using this program to alter .c and .cpp files (among others). i'm going to have to use this program to change this company's code, and i don't know if having file2.txt will screw things up. thanks tanya Your code renames file2.txt in each iteration; it should be gone after the program finishes. In any event, I can't imagine that a .txt file is going to confuse any make environment. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
RE: directory
actually, it was almost perfect before, it would just add teh copyright thing a few extra times...sometimes it wouldn't do it at all. i cant' really detect a pattern as to which files to which it is doing it extra...i get teh infinite loop now that i'm working with the array. that code is in my last email. thanks for any ideas tanya -Original Message- From: Troy Sniff [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 11:46 AM To: [EMAIL PROTECTED] Subject: RE: directory It is looping because of what you said. Windows will place the modified files at the end of the directory. Thus when you modify the last unmodified file, it will continue with already modified files because they were appended to the end of the directory. This can continue forever. Try reading your files into an array and then working with the array. Troy -Original Message- From: Tanya Graham [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 12:32 PM To: 'Rubinow, Larry'; Tanya Graham; 'Troy Sniff'; [EMAIL PROTECTED] Subject: RE: directory it looks like it is in an infinite loop now...do my curly braces look wrong? chomp ($dirname = STDIN); opendir (DIR, $dirname) or die can't open directory $dirname: $!; $copyright = COPYRIGHT; #while ( defined ($file = readdir (DIR))){ my @files = readdir (DIR); foreach my $file(@files){ while (defined $file){ next if ($file=~/^\.+$/); open (SOURCE, $dirname/$file) or die can't open original file $file ; open (NEW, $dirname/file2.txt) or die Can't Create new file; print NEW $copyright or die can't print copyright info to new file; while (SOURCE){ print NEW $_; } close NEW; close SOURCE; rename $dirname/file2.txt, $dirname/$file; } } thanks tanya -Original Message- From: Rubinow, Larry [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 11:24 AM To: 'Tanya Graham'; 'Troy Sniff'; [EMAIL PROTECTED] Subject: RE: directory Tanya Graham wrote: it is very close...sometimes it adds the copyright twice, it looks like it does that to the first and last file in the folder. any ideas why? also, on Weird. It's possible you're actually reopening a file you've already prepended to. Don't know. To ensure you're not doing this, try reading all the file names at once, rather than one by one; then you don't have to worry about the OS modifying the directory contents while your loop is running. Instead of while ( defined ($file = readdir (DIR))){ try my @files = readdir( DIR ); foreach my $file(@files) { while( defined $file ) { # ... a larger note, do you think there will be problems when i'm using this program to alter .c and .cpp files (among others). i'm going to have to use this program to change this company's code, and i don't know if having file2.txt will screw things up. thanks tanya Your code renames file2.txt in each iteration; it should be gone after the program finishes. In any event, I can't imagine that a .txt file is going to confuse any make environment. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
RE: directory
it appears to work...thanks so much! i'll test it more thoroughly after lunch :) thanks again tanya graham -Original Message- From: Rubinow, Larry [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 11:59 AM To: 'Tanya Graham'; 'Troy Sniff'; [EMAIL PROTECTED] Subject: RE: directory Tanya Graham wrote: actually, it was almost perfect before, it would just add teh copyright thing a few extra times...sometimes it wouldn't do it at all. i cant' really detect a pattern as to which files to which it is doing it extra...i get teh infinite loop now that i'm working with the array. that code is in my last email. thanks for any ideas tanya My bad for not giving you enough code. The problem is that the next while line is now referencing the inner while loop, and it gets stuck. You should be able to do it like this: my @files = grep { defined !/^\./ } readdir (DIR); foreach my $file(@files){ open (SOURCE, $dirname/$file) or die can't open original file $file ; # ... ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Win32::AuthenticateUser
Apparently this module is part of v5.6 but I can't find the actual module for installation. My goal is to use this module with v5.005_03. Any ideas or suggestions would be appreciated. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Re: Interacting with COM+ w/ Perl?
' We have the database so lets set the properties that we want. CompObject.Value(ConstructionEnabled) = True CompObject.Value(ConstructorString) = Chr(34) + Provider=SQLOLEDB;Driver={SQL Server};User ID=momma;Password=;DATABASE=BigDog;SERVER= strServer ; + Chr(34) Anyone heard of interacting directly with the MS COM+ API's via Perl or some Perl Module? I struck out searching www.perl.com use OLE; $CompObject = OLE CreateObject(CompObject.Foo); # I forget the syntax... $CompObject-{ConstructionEnabled} = 1; $CompObject-{ConstructorString} = char(34) . Provider=SQLOLEDB;Driver={SQL Server};UserID=momma;Password=;DATABASE=BigDog;SERVER=$strServer; . chr(34); What do you mean by 'interacting directly with the COM+ API'? Do you want to make raw calls to the DLL with Win32::API as opposed to using the COM interface? ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
RE: Komodo
It's decent. Memory pig and really slow to start up. I have to shut it down and restart it once or twice a day to keep it from being flaky. Hate the fact that I can't set the line terminators myself when editing Unix files on a win machine. The regular expression tool is killer! It almost makes it worth the wait. -Original Message- From: Mark Bergeron [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 3:40 PM To: [EMAIL PROTECTED] Subject: Komodo Hello group, Has anyone been using Komodo for their development? What do you think of it? I find it a little klunky. It doesn't scroll very well and the cursor and highlight features are slow. What do you guys think? Mark Bergeron A Duck! ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
RE: Komodo
Hello group, Has anyone been using Komodo for their development? What do you think of it? I find it a little klunky. It doesn't scroll very well and the cursor and highlight features are slow. What do you guys think? FWIW, I don't touch it out of principal. Lee ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Re: Re: Komodo
I agree, the reg. expression tool is nice. Needs more customization features to tweak out the interface too. Mark -Original Message- From: Jamison, Shawn[EMAIL PROTECTED] To: Mark Bergeron[EMAIL PROTECTED], [EMAIL PROTECTED] Date: Wed May 30 12:44:32 PDT 2001 Subject: Re: Komodo It's decent. Memory pig and really slow to start up. I have to shut it down and restart it once or twice a day to keep it from being flaky. Hate the fact that I can't set the line terminators myself when editing Unix files on a win machine. The regular expression tool is killer! It almost makes it worth the wait. -Original Message- From: Mark Bergeron [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 3:40 PM To: [EMAIL PROTECTED] Subject: Komodo Hello group, Has anyone been using Komodo for their development? What do you think of it? I find it a little klunky. It doesn't scroll very well and the cursor and highlight features are slow. What do you guys think? Mark Bergeron A Duck! ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users A Duck! ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
OT RE: Komodo
Hello group, Has anyone been using Komodo for their development? What do you think of it? I find it a little klunky. It doesn't scroll very well and the cursor and highlight features are slow. What do you guys think? FWIW, I don't touch it out of principal. Which? The value for money thing. These are my principals. If you don't like them, I have others. - Groucho Marx ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Re: Re: Komodo
No problem. I've been using ActiveState stuff for years and just found out about it myself. Komodo is an IDE for Perl development (along with some others) which allows you to create projects, debug code and pull a few tricks out of your hat. It's built on Mozilla. That means the interface is built on the same technology as the Netscape browser. They made all of their sorce code available to the public years ago in an efforts to win the browser wars you know and now it's a Perl IDE, go figure (-8 It has a few nice features but it's seems a little buggy right off the bat. I'd say they have a ways to go before it's ready for serious commercial release. My 2 cents. Mark' -Original Message- From: Peter Eisengrein[EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Wed May 30 13:05:46 PDT 2001 Subject: Re: Komodo Pardon my ignorance, but what is it? -Original Message- From: Lee Goddard [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 3:57 PM To: Mark Bergeron; [EMAIL PROTECTED] Subject: RE: Komodo Hello group, Has anyone been using Komodo for their development? What do you think of it? I find it a little klunky. It doesn't scroll very well and the cursor and highlight features are slow. What do you guys think? FWIW, I don't touch it out of principal. Lee ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users A Duck! ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Mail::Sender help needed
my system is windows 2000 , IIS 5.0 i am using the Mail::Sender module with the code below, the problem is that all the e-mails are saved to the c:\Inetpub\mailroot\queue there is also another file in the dir which is called NTFS_e121a4c001c0fc1d0001.EML the file type for this is :Certificate Trust List when double clicked the file brings up a dialog box which says Invalid Public Key Security File , this is an invalid security trust file i have no idea what this means , please can someone help ? perl code #!/usr/local/perl/bin use Mail::Sender; print Content-type: text/html\n\n; ref ($sender = new Mail::Sender({from = '[EMAIL PROTECTED]',smtp = '127.0.0.1'})) or die $Mail::Sender::Error\n; (ref ($sender-MailFile( {to =[EMAIL PROTECTED]', subject = 'this is a test', msg = Hi Johnie.\nI'm sending you the pictures you wanted., file = 'c:\ukemails\Greenstone.bmp' })) and print Mail sent OK. ) or die $Mail::Sender::Error\n; - note the code works fine if i use another SMTP server, and not localhost thank you in advance Waseem http://www.todayinsoccer.com - the ultimate soccer history site ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users