Re: Detecting line terminators in a CSV file

2006-06-29 Thread Daniel Kasak
John W. Krahn wrote: > Because when on Windows the CR LF pair is converted to the "\n" > newline character. > perldoc PerlIO > [snip] >:crlf >A layer that implements DOS/Windows like CRLF line endings. On >read converts pairs of CR,LF to a single "\n" newline chara

Re: Detecting line terminators in a CSV file

2006-06-29 Thread John W. Krahn
Daniel Kasak wrote: > Greetings. Hello, > I'm trying to write a CSV import routine for MySQL ( possibly will > extend it with a flashy GUI and release open-source ). > > I'm having great difficulty doing this under Windows. If I use the code > below under Linux, it works perfectly, detecting cor

Detecting line terminators in a CSV file

2006-06-29 Thread Daniel Kasak
Greetings. I'm trying to write a CSV import routine for MySQL ( possibly will extend it with a flashy GUI and release open-source ). I'm having great difficulty doing this under Windows. If I use the code below under Linux, it works perfectly, detecting correctly whether the file has a Windows (

RE: Script Required to Check a range of IP's

2006-06-29 Thread Timothy Johnson
You've gotten many good suggestions, but the main problem is that you are doing a TCP ping, and I'm pretty sure you are expecting the results to match your ICMP ping. >From the Perldoc: "You may choose one of six different protocols to use for the ping. The "tcp" protocol is the default. Note that

Re: Script Required to Check a range of IP's

2006-06-29 Thread Dr.Ruud
"Dr.Ruud" schreef: > You are calling ping() with an un-comp-ed $host. s/comp/chomp/ -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Crypt::GPG won't decrypt file

2006-06-29 Thread RICHARD FERNANDEZ
Hi folks, I have the following function: sub lbx_decrypt { my $encrypted = shift or die "No file passed in to lbx_decrypt for decryption?\n"; my $decrypted = substr $encrypted, 4; $decrypted .= '.zip'; my $gpg = new Crypt::GPG; $gpg -> gpgbin('/usr/bin/gpg'); open CIPHERTXT

RE: Script Required to Check a range of IP's

2006-06-29 Thread Ryan Frantz
> Here's the same thing but "Perl Best Practice" ified a bit: > > #!/usr/bin/perl > > use strict; > use wanrings; > use Net::Ping; > > die 'Please give me a filename as my argument!' if !defined $ARGV[0]; > open(my $ipfile_fh, '<', $ARGV[0]) || die "Could not open $ARGV[0]: $!"; > > my $icmp =

Re: Script Required to Check a range of IP's

2006-06-29 Thread Dr.Ruud
Prabu schreef: > open(FILE,"$file_name") || die "Not been Accessed" ; open my $fh, '<', $file_name or die "open $file_name: $!" ; >if($p->ping($host, 2)) >{ > chomp($host); > print "$host is alive.\n"; >} >else > { > chomp($host

Re: Script Required to Check a range of IP's

2006-06-29 Thread JupiterHost.Net
#!/usr/bin/perl use strict; use warnings; Excellent! use Net::Ping; my $file_name=$ARGV[0]; What if its not given anything? my $line; You don't use this? my @host_array; open(FILE,"$file_name") || die "Not been Accessed" ; Why is $file_name in quotes? Why is the die string in dou

Re: Script Required to Check a range of IP's

2006-06-29 Thread Mazhar
Thanks Prabhu, Your script works Regards Mazhar On 6/29/06, Prabu <[EMAIL PROTECTED]> wrote: Hello, Hope this is what you need Input File --- test.txt 172.16.1.194 172.16.1.20 172.16.1.200 172.16.1.34 Program to check active or not -- pingpro.pl #!/usr/bin/perl use strict; use warnin

Re: regexp pattern matching

2006-06-29 Thread Mr. Shawn H. Corey
On Thu, 2006-29-06 at 14:31 -0400, Mr. Shawn H. Corey wrote: > OK, here are some pointers: > > 1. Create a file with lines you want to match. Use copy & paste rather > than generating them by hand; you'll avoid typing errors. Try to include > as many just-barely-hits as you can, that is, those lin

Re: regexp pattern matching

2006-06-29 Thread Mr. Shawn H. Corey
On Thu, 2006-29-06 at 13:40 -0400, Hair wrote: > Hello, I have a pattern matching question, that I can't seem to find the > answer to either online or in books, so here is the pattern I am trying to > match, and hopefully some kind soul will give me pointers: > > > The satchel contains the follow

Re: regexp pattern matching

2006-06-29 Thread Dr.Ruud
"Dr.Ruud" schreef: > You're problem might be that you use the () unescaped. Hihi, that's what you get when you shift from You're probably ... to Your problem ... mid-sentence. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: regexp pattern matching

2006-06-29 Thread Dr.Ruud
Hair schreef: > Hello, I have a pattern matching question, that I can't seem to find > the answer to either online or in books, so here is the pattern I am > trying to match, and hopefully some kind soul will give me pointers: > > > The satchel contains the following items (97): item1, item2, etc e

regexp pattern matching

2006-06-29 Thread Hair
Hello, I have a pattern matching question, that I can't seem to find the answer to either online or in books, so here is the pattern I am trying to match, and hopefully some kind soul will give me pointers: The satchel contains the following items (97): item1, item2, etc etc I can match the fir

Re: Script Required to Check a range of IP's

2006-06-29 Thread Mr. Shawn H. Corey
On Thu, 2006-29-06 at 19:44 +0400, Mazhar wrote: > Hi Folks, > > I have a requirement of writing down a script to check the range of IP's in > a text file and display them which all are active and not active. > > I have written down the below and needs your help because it is not giving > me the

Re: Script Required to Check a range of IP's

2006-06-29 Thread Anthony Ettinger
On 6/29/06, Mazhar <[EMAIL PROTECTED]> wrote: Hi Folks, I have a requirement of writing down a script to check the range of IP's in a text file and display them which all are active and not active. I have written down the below and needs your help because it is not giving me the correct ouptut.

Re: Script Required to Check a range of IP's

2006-06-29 Thread Prabu
Hello, Hope this is what you need Input File --- test.txt 172.16.1.194 172.16.1.20 172.16.1.200 172.16.1.34 Program to check active or not -- pingpro.pl #!/usr/bin/perl use strict; use warnings; use Net::Ping; my $file_name=$ARGV[0]; my $line; my @host_array; open(FILE,"$file_name") || die "

RE: Script Required to Check a range of IP's

2006-06-29 Thread Ryan Frantz
-Original Message- From: Mazhar [mailto:[EMAIL PROTECTED] Sent: Thursday, June 29, 2006 12:51 PM To: Ryan Frantz Cc: Perl Beginners Subject: Re: Script Required to Check a range of IP's On 6/29/06, Ryan Frantz <[EMAIL PROTECTED]> wrote: > -Original Message- > From: Mazhar [ma

Re: Script Required to Check a range of IP's

2006-06-29 Thread Mazhar
On 6/29/06, Ryan Frantz <[EMAIL PROTECTED]> wrote: > -Original Message- > From: Mazhar [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 29, 2006 11:44 AM > To: Perl Beginners > Subject: Script Required to Check a range of IP's > > Hi Folks, > Howdy, > I have a requirement of writing

RE: Script Required to Check a range of IP's

2006-06-29 Thread Ryan Frantz
> -Original Message- > From: Mazhar [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 29, 2006 11:44 AM > To: Perl Beginners > Subject: Script Required to Check a range of IP's > > Hi Folks, > Howdy, > I have a requirement of writing down a script to check the range of IP's > in > a te

Re: Script Required to Check a range of IP's

2006-06-29 Thread Mazhar
thanks Joshua for the help but the server is very critical and they will not install any external softwares. This is the policy and i have to adhere to the policy... i need a perl script to do so.. Regards Mazhar On 6/29/06, Joshua Colson <[EMAIL PROTECTED]> wrote: On Thu, 2006-06-29 at 19:44

Re: Script Required to Check a range of IP's

2006-06-29 Thread Joshua Colson
On Thu, 2006-06-29 at 19:44 +0400, Mazhar wrote: > Hi Folks, > > I have a requirement of writing down a script to check the range of IP's in > a text file and display them which all are active and not active. > > I have written down the below and needs your help because it is not giving > me the

Script Required to Check a range of IP's

2006-06-29 Thread Mazhar
Hi Folks, I have a requirement of writing down a script to check the range of IP's in a text file and display them which all are active and not active. I have written down the below and needs your help because it is not giving me the correct ouptut. #

Re: Installation query

2006-06-29 Thread Mr. Shawn H. Corey
On Thu, 2006-29-06 at 17:07 +0530, Mohd Abdul Rasheed wrote: > Sir, I am a student of Biotechnology . I want to learn for > programming in bio-informatics. > I have downloaded the 5.8.8. version of perl for windows, but i 'm > unable to install it on win 2003 server & also of win X

Installation query

2006-06-29 Thread Mohd Abdul Rasheed
Sir, I am a student of Biotechnology . I want to learn for programming in bio-informatics. I have downloaded the 5.8.8. version of perl for windows, but i 'm unable to install it on win 2003 server & also of win XP . Typing 'C:\perl> perl this_program ' generates a message "P

RE: cscope for perl?

2006-06-29 Thread Jeff Peng
Cscope is just a developer's tool for browsing source code.See here: http://cscope.sourceforge.net/ But as the name implies cscope is limited to C-like languages,maybe you would see: http://search.cpan.org/~dsb/ClearCase-CRDB-0.12/whouses Hope this helps. From: Travis Thornhill <[EMAIL PROTE

Re: file script and cmd script difference

2006-06-29 Thread John W. Krahn
joseph wrote: > Hi list, Hello, > I'd like to ask explaination/help regarding this: > > 1)perl -e '%hash; for (`arp`) {($addr,$mac) = (split(/\s+/))[0,2]; > $hash{$addr}= $mac } foreach (keys %hash) { print "\t $_ => $hash{$_}\n";}' Could be written more simply as: arp | perl -lane'print "\t

Re: file script and cmd script difference (close)

2006-06-29 Thread joseph
""Jeff Peng"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > >> my($addr,$mac) = (split(/s+/))[0,2]; > > You maybe would check your scripts carefully at first. > Here should be: > my($addr,$mac) = (split(/\s+/))[0,2]; > > You have lost the '\' before 's+' in your regex. >

RE: file script and cmd script difference

2006-06-29 Thread Jeff Peng
my($addr,$mac) = (split(/s+/))[0,2]; You maybe would check your scripts carefully at first. Here should be: my($addr,$mac) = (split(/\s+/))[0,2]; You have lost the '\' before 's+' in your regex. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

cscope for perl?

2006-06-29 Thread Travis Thornhill
I've heard that there is a way to make cscope work for perl. I can't find any info in the cscope man page or in perldocs. Can anyone point me in the right direction? Thanks in advance - Do you Yahoo!? Next-gen email? Have it all with the