error message

2006-07-09 Thread Geetha Weerasooriya
Dear All, In my perl code for MapMatching, I have following while loop. When I run the program I get the following two error messages(for each data line in the data file) But the out put file is created. Use of uninitialized value in int at filename.pl lineNo, line .. Use of unititialized valu

Re: write out filenames of files existing on a filesystem into afile

2006-07-09 Thread Alan_C
[ . . ] Hi, my @new = grep /[^.]/, readdir DIR; (on Linux I tried it) that eliminates . and .. from the catch. *But the next code prints all 8 lines of data it does not eliminate . and .. from the catch, print* Isn't that a character class that says "not a dot" So, why the difference (readdi

Re: Which line?

2006-07-09 Thread Mr. Shawn H. Corey
Ryan Dillinger wrote: > Hello, > I have a script here, I have been going over and over. > Every time I run it I get several errors, and I have tried to fix them > to no avail. > Can someone tell me what line I missed, please? > Thanks for your help! > > #!usr/bin/perl > use warnings; > use str

Re: efficiently keeping a short list

2006-07-09 Thread Mr. Shawn H. Corey
Tom Allison wrote: > I want to keep a short list of the most recently used 'X'. > < 200 elements. > > Is there any suggestions other than to > unshift @recent, $element; > $#recent = $maximum; > > I know this will create a lot of array movement, but I can't think of > anything better off the top

Which line?

2006-07-09 Thread Ryan Dillinger
Hello, I have a script here, I have been going over and over. Every time I run it I get several errors, and I have tried to fix them to no avail. Can someone tell me what line I missed, please? Thanks for your help! #!usr/bin/perl use warnings; use strict; %names = (); @raw = (); $fn = "";

Re: write out filenames of files existing on a filesystem into afile

2006-07-09 Thread Nishi Bhonsle
Yes, thank you. This is it. I was able to manage a similar working version, your post is much cleaner and easy to follow. Thanks again -Nishi. On 7/9/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Nishi Bhonsle wrote: > > Thanks for all your suggestions and help. I was able to do the following -- > 1

Re: #!/usr/bin/perl ... and __DATA__

2006-07-09 Thread Chasecreek Systemhouse
On 7/9/06, Dr.Ruud <[EMAIL PROTECTED]> wrote: perl -x$HOME $HOME/sxVHost.conf First test it from the command line. Thx! That's got it. The docs show a space between the -x and My version works on the command line but not as part of a BASH shell; I spent a lot of time troubleshooting thi

Re: #!/usr/bin/perl ... and __DATA__

2006-07-09 Thread John W. Krahn
Chasecreek Systemhouse wrote: > On 7/9/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: >> Try: >> >> #!/bin/sh >> perl -pe '' <> foo >> bar >> End_Of_Data >> >> See `perldoc perlrun` and `man sh` for details. > > OK, well; can someone tell me how to properly use the -x switch? What > I'm trying

efficiently keeping a short list

2006-07-09 Thread Tom Allison
I want to keep a short list of the most recently used 'X'. < 200 elements. Is there any suggestions other than to unshift @recent, $element; $#recent = $maximum; I know this will create a lot of array movement, but I can't think of anything better off the top of my head. You? -- To unsubscri

Re: #!/usr/bin/perl ... and __DATA__

2006-07-09 Thread Dr.Ruud
"Chasecreek Systemhouse" schreef: > Shell script example: > #!/bin/sh > perl -x ~ /home/bill/sxVHost.conf Remove the space after -x. Don't assume that ~ will be $HOME. perl -x$HOME $HOME/sxVHost.conf First test it from the command line. -- Affijn, Ruud "Gewoon is een tijger." -- To uns

Re: #!/usr/bin/perl ... and __DATA__

2006-07-09 Thread Chasecreek Systemhouse
On 7/9/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: Try: #!/bin/sh perl -pe '' < OK, well; can someone tell me how to properly use the -x switch? What I'm trying is to have Perl code reside inside an Apache conf file: Shell script example: #!/bin/sh perl -x ~ /home/bill/sxVHost.conf Whe

Re: write out filenames of files existing on a filesystem into afile

2006-07-09 Thread Rob Dixon
Nishi Bhonsle wrote: > > Thanks for all your suggestions and help. I was able to do the following -- > 1)Flatten out the directory structure into a file containing the dir and > files within the dir into > C:\buildlist.txt > 2)Read the lines from a file say files2.txt and modify the lines to conta

Re: question on redirecting output of Perl debugger commands

2006-07-09 Thread Chasecreek Systemhouse
On 7/7/06, Gavin Bowlby <[EMAIL PROTECTED]> wrote: Is there a way to redirect the output of a debugger command to a file? What I use is Linux specific, sort of varies by bash and distro for example, but you are welcome to try it out (I asked in irc #bash before posting here) - ls -ial |tee cap

Re: #!/usr/bin/perl ... and __DATA__

2006-07-09 Thread Mr. Shawn H. Corey
Chasecreek Systemhouse wrote: > Are there any syntax tricks that would allow both the "shebang and > __DATA__" on the same line? > No. Try: #!/bin/sh perl -pe ''

#!/usr/bin/perl ... and __DATA__

2006-07-09 Thread Chasecreek Systemhouse
I tried googling for this but Im not quite sure how to write it up? Are there any syntax tricks that would allow both the "shebang and __DATA__" on the same line? So that the Perl code looks like this: #!/usr/bin/perl -wT {initialization code}; __DATA__ # # other stuff # # other stuff # # other

Re: write out filenames of files existing on a filesystem into afile

2006-07-09 Thread Nishi Bhonsle
Hi: Thanks for all your suggestions and help. I was able to do the following -- 1)Flatten out the directory structure into a file containing the dir and files within the dir into C:\buildlist.txt 2)Read the lines from a file say files2.txt and modify the lines to contain the filenames fetched int

Re: File last modified time

2006-07-09 Thread Chasecreek Systemhouse
On 7/7/06, Omega -1911 <[EMAIL PROTECTED]> wrote: 1. The script has to open a rather large number of files (100,000). 2. Instead of opening all of them, I am trying to only open those files where the file was actually MODIFIED not just accessed within the last 20 minutes. The implementation log

Re: Need help with error from certain ASCII characters in a CSV file

2006-07-09 Thread Mr. Shawn H. Corey
Dr.Ruud wrote: > That changes the encoding of the script, and of STDIN and STDOUT, but > not of any open()s, so it might not be enough. You can open with encoding with the three-argument form. For example: open(FH, "<:utf8", "file") See `perldoc -f open` for details. Also, after an open, you c

Re: Need help with error from certain ASCII characters in a CSV file

2006-07-09 Thread Dr.Ruud
"Mumia W." schreef: > Roman Daszczyszak: >> I am using a script to parse a CSV file with approximately 65,000 >> records. Some of these records contain characters such as é, ì, etc. >> I can read and write lines containing these characters via a file >> handle, however when I try and parse the li

Re: Need help with error from certain ASCII characters in a CSV file

2006-07-09 Thread Mr. Shawn H. Corey
Dr.Ruud wrote: > "Roman Daszczyszak" schreef: > > >>#!\perl\perl.exe > > > Does that do anything useful? Maybe change to just > #!perl > How about: #!/perl/bin/perl On MS Windows, perl is usually 'C:\PERL\BIN\PERL.EXE'. You would not need the '.exe' and I'm quite sure you need a 'bin' somewhe

Re: solved [was Re: Net::LDAP]

2006-07-09 Thread Dr.Ruud
Beast schreef: > This aparently because of input is coming from and LANG=utf8 > > chomp($username=); > my $exists = ldap_search($username); > > after set "LANG=en_US" it works. > Anyone know the reason? I guess your input-data wasn't utf8-encoded. If your data was ASCII-only (so no characters >

Re: Need help with error from certain ASCII characters in a CSV file

2006-07-09 Thread Dr.Ruud
"Roman Daszczyszak" schreef: > #!\perl\perl.exe Does that do anything useful? Maybe change to just #!perl > my @lines = @{$csv_file->lines()}; > shift @lines; # Strips off the header line before processing Variant: (undef, @my lines) = @{$csv_file->lines()} ; -- Affijn, Ruud "Gewoon is e

Re: using backticks

2006-07-09 Thread Mahdi A Sbeih
Hi Ron, Thank you very very much, -Mahdi. Rob Dixon wrote: Mahdi A Sbeih wrote: > > I am using the below code: > > $fmtFile = `$dpImportCmd`; > .. > .. > unlink($fmtFile) || die "unable to remove $fmtFile\n"; > > > dpImportCmd, is a program that generates a text file, this text file > name i

Re: using backticks

2006-07-09 Thread Rob Dixon
Mahdi A Sbeih wrote: > > I am using the below code: > > $fmtFile = `$dpImportCmd`; > .. > .. > unlink($fmtFile) || die "unable to remove $fmtFile\n"; > > > dpImportCmd, is a program that generates a text file, this text file > name is now in the variable: $fmtFile. Later in the program, I want to

Re: write out filenames of files existing on a filesystem into afile

2006-07-09 Thread Rob Dixon
Nishi Bhonsle wrote: > > Rob: > > Thanks for your input. > Can you tell me how I could define $file in the below snippet so, i can > subsitute the filename ie $file into the files2.txt that contains lines > of the format > "SL/" "%HOME%/server/bin/" "" NA > > Thanks a lot! > --

using backticks

2006-07-09 Thread Mahdi A Sbeih
I am using the below code: $fmtFile = `$dpImportCmd`; .. .. unlink($fmtFile) || die "unable to remove $fmtFile\n"; dpImportCmd, is a program that generates a text file, this text file name is now in the variable: $fmtFile. Later in the program, I want to delete this file, but it fails. I don'