CGI script not showing the textbox

2006-06-13 Thread Nath, Alok (STSD)
Hi,
Need some help to run this script.

#!/usr/bin/perl -w
use CGI qw(:standard);

my $favourite = param("flavour") ;

print header;   # here's a comment. print the header
print start_html("Alok's Page") , h1(" Paragraph... !") ;

if ($favourite) {
print q("Your favourite is : $favourite.") ;
}else  {
print hr, start_form ;
print q("Please select: ",textfield ("flavour", "mint")) ;
print end_form, hr ;
}

When I run this script through the browser, I see this page 

>>>

Paragraph... !




"Please select: ",textfield ("flavour", "mint")



>>
What I was expecting is a textbox, instead of this string.
"Please select: ",textfield ("flavour", "mint")

Can anybody point out what is wrong ?

Thanx,
Alok

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: A loop to parse a large text file--output is empty!

2006-06-13 Thread Tom Phoenix

On 6/13/06, Michael Oldham <[EMAIL PROTECTED]> wrote:


while () {



print OUT scalar();


You don't want that second use of . Check the documentation
for readline() in the perlfunc manpage. Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: A loop to parse a large text file--output is empty!

2006-06-13 Thread Timothy Johnson

Oops!  

Try changing

   if($find =~ /^>probe:\w+:(\w+):/)

to

   if($line =~ /^>probe\:\w+\:$find\:/) {



I can't remember if you have to escape colons or not.  If you do, then
you're probably a pearlfish.



-Original Message-
From: Michael Oldham [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 13, 2006 7:13 PM
To: Timothy Johnson; [EMAIL PROTECTED] Org
Subject: RE: A loop to parse a large text file--output is empty!

Thanks Timothy.  I tried the code you supplied and unfortunately the
output file is still empty.  Do you think there might be a problem with
the regular expression in:

if($find =~ /^>probe:\w+:(\w+):/)

?

Mike



-Original Message-
From: Timothy Johnson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 13, 2006 6:59 PM
To: Michael Oldham; [EMAIL PROTECTED] Org
Subject: RE: A loop to parse a large text file--output is empty!




One problem is that you are using the $_ variable twice.
"while()" assigns $_ to the current line being read, and
"foreach(@array)" assigns $_ to the current element of the array in
question.

It's usually a good idea to be more explicit anyway, and keep the $_
usage to a minimum so you don't have to worry about this kind of thing.

Also, I'm not sure what you're trying to accomplish by this line:

   print OUT scalar();

As far as I can see, you're grabbing the next line, assigning it to $_
(maybe), and printing it out in scalar context.  I'm assuming that you
actually wanted to print the line you read instead, so that's what I
did.

Try this and see if it is closer to what you want:

###

#!/usr/bin/perl -w

use strict;

my $IDs = 'ID.txt';

unless (open(IDFILE, $IDs)) {
print "Could not open file $IDs!\n";
}

my $probes = 'HG_U95Av2_probe_fasta.txt';

unless (open(PROBES, $probes)) {
print "Could not open file $probes!\n";
}

open (OUT,'>','probe_subset.txt') or die "Can't write output: $!";

my @ID = ;
chomp @ID;

#vvv
while (my $line = ) {
#   
foreach my $find(@ID) {
if($line =~ /^>probe:\w+:$find:/) {
print OUT $find."\n";
# VV
print OUT $line."\n";
}
}

}
exit;

###

-Original Message-
From: Michael Oldham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 13, 2006 6:42 PM
To: [EMAIL PROTECTED] Org
Subject: A loop to parse a large text file--output is empty!

Dear all,

I am a Perl newbie struggling to accomplish a conceptually simple
bioinformatics task.  I have a single large file containing about
200,000 DNA probe sequences (from an Affymetrix microarray), each of
which is accompanied by a header, like so (this is in FASTA format):

>probe:HG_U95Av2:1138_at:395:301; Interrogation_Position=2631;
Antisense;
TGGCTCCTGCTGAGGTTTTCC
>probe:HG_U95Av2:107_at:543:519; Interrogation_Position=258; Antisense;
CTACTCTCGTGGTGCACAAGGAGTG
>probe:HG_U95Av2:1156_at:528:483; Interrogation_Position=2054;
Antisense;
TGCAGGTGGCAGATCTGCAGTCCAT
>probe:HG_U95Av2:1102_s_at:541:589; Interrogation_Position=4316;
Antisense;
GTGAAGGTTGCTGAGGCTCTGACCC

.etc.

What I would like to do is extract from this file a subset of ~130,800
probes (both the header and the sequence) and output this subset into a
new text file in the same (FASTA) format.  These 130,800 probes
correspond to 8,175 probe set IDs ("1138_at" is an example of a probe
set ID in the header listed above).  I have these 8,175 IDs listed in a
separate file called "ID.txt" and the 200,000 probe sequences in a file
called "HG_U95Av2_probe_fasta.txt".  The script below is missing
something because the output file ("probe_subset.txt") is blank.  This
is also the case if I replace the file "ID.txt" with a file consisting
of a single probe set ID (e.g. 1138_at).  Does anyone know what I am
missing?  I am running this script in Cygwin on Windows XP.  I
appreciate any suggestions!

~ Mike O.

#!/usr/bin/perl -w

use strict;

my $IDs = 'ID.txt';

unless (open(IDFILE, $IDs)) {
print "Could not open file $IDs!\n";
}

my $probes = 'HG_U95Av2_probe_fasta.txt';

unless (open(PROBES, $probes)) {
print "Could not open file $probes!\n";
}

open (OUT,'>','probe_subset.txt') or die "Can't write output: $!";

my @ID = ;
chomp @ID;

while () {
foreach (@ID) {
if(/^>probe:\w+:(\w+):/) {
print OUT;
print OUT scalar();
}
}

}
exit;
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 6/13/2006


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

RE: A loop to parse a large text file--output is empty!

2006-06-13 Thread Michael Oldham
Thanks Timothy.  I tried the code you supplied and unfortunately the
output file is still empty.  Do you think there might be a problem with
the regular expression in:

if($find =~ /^>probe:\w+:(\w+):/)

?

Mike



-Original Message-
From: Timothy Johnson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 13, 2006 6:59 PM
To: Michael Oldham; [EMAIL PROTECTED] Org
Subject: RE: A loop to parse a large text file--output is empty!




One problem is that you are using the $_ variable twice.
"while()" assigns $_ to the current line being read, and
"foreach(@array)" assigns $_ to the current element of the array in
question.

It's usually a good idea to be more explicit anyway, and keep the $_
usage to a minimum so you don't have to worry about this kind of thing.

Also, I'm not sure what you're trying to accomplish by this line:

   print OUT scalar();

As far as I can see, you're grabbing the next line, assigning it to $_
(maybe), and printing it out in scalar context.  I'm assuming that you
actually wanted to print the line you read instead, so that's what I
did.

Try this and see if it is closer to what you want:

###

#!/usr/bin/perl -w

use strict;

my $IDs = 'ID.txt';

unless (open(IDFILE, $IDs)) {
print "Could not open file $IDs!\n";
}

my $probes = 'HG_U95Av2_probe_fasta.txt';

unless (open(PROBES, $probes)) {
print "Could not open file $probes!\n";
}

open (OUT,'>','probe_subset.txt') or die "Can't write output: $!";

my @ID = ;
chomp @ID;

#vvv
while (my $line = ) {
#   
foreach my $find(@ID) {
if($find =~ /^>probe:\w+:(\w+):/) {
print OUT $find."\n";
# VV
print OUT $line."\n";
}
}

}
exit;

###

-Original Message-
From: Michael Oldham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 13, 2006 6:42 PM
To: [EMAIL PROTECTED] Org
Subject: A loop to parse a large text file--output is empty!

Dear all,

I am a Perl newbie struggling to accomplish a conceptually simple
bioinformatics task.  I have a single large file containing about
200,000 DNA probe sequences (from an Affymetrix microarray), each of
which is accompanied by a header, like so (this is in FASTA format):

>probe:HG_U95Av2:1138_at:395:301; Interrogation_Position=2631;
Antisense;
TGGCTCCTGCTGAGGTTTTCC
>probe:HG_U95Av2:107_at:543:519; Interrogation_Position=258; Antisense;
CTACTCTCGTGGTGCACAAGGAGTG
>probe:HG_U95Av2:1156_at:528:483; Interrogation_Position=2054;
Antisense;
TGCAGGTGGCAGATCTGCAGTCCAT
>probe:HG_U95Av2:1102_s_at:541:589; Interrogation_Position=4316;
Antisense;
GTGAAGGTTGCTGAGGCTCTGACCC

.etc.

What I would like to do is extract from this file a subset of ~130,800
probes (both the header and the sequence) and output this subset into a
new text file in the same (FASTA) format.  These 130,800 probes
correspond to 8,175 probe set IDs ("1138_at" is an example of a probe
set ID in the header listed above).  I have these 8,175 IDs listed in a
separate file called "ID.txt" and the 200,000 probe sequences in a file
called "HG_U95Av2_probe_fasta.txt".  The script below is missing
something because the output file ("probe_subset.txt") is blank.  This
is also the case if I replace the file "ID.txt" with a file consisting
of a single probe set ID (e.g. 1138_at).  Does anyone know what I am
missing?  I am running this script in Cygwin on Windows XP.  I
appreciate any suggestions!

~ Mike O.

#!/usr/bin/perl -w

use strict;

my $IDs = 'ID.txt';

unless (open(IDFILE, $IDs)) {
print "Could not open file $IDs!\n";
}

my $probes = 'HG_U95Av2_probe_fasta.txt';

unless (open(PROBES, $probes)) {
print "Could not open file $probes!\n";
}

open (OUT,'>','probe_subset.txt') or die "Can't write output: $!";

my @ID = ;
chomp @ID;

while () {
foreach (@ID) {
if(/^>probe:\w+:(\w+):/) {
print OUT;
print OUT scalar();
}
}

}
exit;
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 6/13/2006


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 6/13/2006

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 6/13/2006


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: desktop application

2006-06-13 Thread Timothy Johnson

If you're looking to set up something like this, I strongly recommend
buying the Perl Dev Kit from ActiveState.  You'll get PerlApp and
PerlMSI, which make distribution easy, and PerlTray, which makes writing
System Tray applets in Perl much easier.

You're probably also going to want to get familiar with Win32::OLE and
join the ActiveState Win32 Perl Users and Perl Dev lists.


-Original Message-
From: Dave Pollak [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 13, 2006 7:02 PM
To: [EMAIL PROTECTED] Org
Subject: desktop application

I'm a Perl newbie with some PHP and ColdFusion experience. My employer 
has a book on cd that he wants to convert to a desktop application so it

will be interactive and secure. He wants each copy licensed to a machine

and wants it to be able to interact with a Windows desktop with popups 
out of the taskbar when something new has been added. I'd like to learn 
Perl. If this can be done, it's the excuse I've been waiting for.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




desktop application

2006-06-13 Thread Dave Pollak
I'm a Perl newbie with some PHP and ColdFusion experience. My employer 
has a book on cd that he wants to convert to a desktop application so it 
will be interactive and secure. He wants each copy licensed to a machine 
and wants it to be able to interact with a Windows desktop with popups 
out of the taskbar when something new has been added. I'd like to learn 
Perl. If this can be done, it's the excuse I've been waiting for.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: A loop to parse a large text file--output is empty!

2006-06-13 Thread Timothy Johnson


One problem is that you are using the $_ variable twice.
"while()" assigns $_ to the current line being read, and
"foreach(@array)" assigns $_ to the current element of the array in
question.

It's usually a good idea to be more explicit anyway, and keep the $_
usage to a minimum so you don't have to worry about this kind of thing.

Also, I'm not sure what you're trying to accomplish by this line:

   print OUT scalar();

As far as I can see, you're grabbing the next line, assigning it to $_
(maybe), and printing it out in scalar context.  I'm assuming that you
actually wanted to print the line you read instead, so that's what I
did.

Try this and see if it is closer to what you want:

###

#!/usr/bin/perl -w

use strict;

my $IDs = 'ID.txt';

unless (open(IDFILE, $IDs)) {
print "Could not open file $IDs!\n";
}

my $probes = 'HG_U95Av2_probe_fasta.txt';

unless (open(PROBES, $probes)) {
print "Could not open file $probes!\n";
}

open (OUT,'>','probe_subset.txt') or die "Can't write output: $!";

my @ID = ;
chomp @ID;

#vvv
while (my $line = ) {
#      
foreach my $find(@ID) {
if($find =~ /^>probe:\w+:(\w+):/) {
print OUT $find."\n";
# VV
print OUT $line."\n";
}
}

}
exit;

###

-Original Message-
From: Michael Oldham [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 13, 2006 6:42 PM
To: [EMAIL PROTECTED] Org
Subject: A loop to parse a large text file--output is empty!

Dear all,

I am a Perl newbie struggling to accomplish a conceptually simple
bioinformatics task.  I have a single large file containing about
200,000 DNA probe sequences (from an Affymetrix microarray), each of
which is accompanied by a header, like so (this is in FASTA format):

>probe:HG_U95Av2:1138_at:395:301; Interrogation_Position=2631;
Antisense;
TGGCTCCTGCTGAGGTTTTCC
>probe:HG_U95Av2:107_at:543:519; Interrogation_Position=258; Antisense;
CTACTCTCGTGGTGCACAAGGAGTG
>probe:HG_U95Av2:1156_at:528:483; Interrogation_Position=2054;
Antisense;
TGCAGGTGGCAGATCTGCAGTCCAT
>probe:HG_U95Av2:1102_s_at:541:589; Interrogation_Position=4316;
Antisense;
GTGAAGGTTGCTGAGGCTCTGACCC

.etc.

What I would like to do is extract from this file a subset of ~130,800
probes (both the header and the sequence) and output this subset into a
new text file in the same (FASTA) format.  These 130,800 probes
correspond to 8,175 probe set IDs ("1138_at" is an example of a probe
set ID in the header listed above).  I have these 8,175 IDs listed in a
separate file called "ID.txt" and the 200,000 probe sequences in a file
called "HG_U95Av2_probe_fasta.txt".  The script below is missing
something because the output file ("probe_subset.txt") is blank.  This
is also the case if I replace the file "ID.txt" with a file consisting
of a single probe set ID (e.g. 1138_at).  Does anyone know what I am
missing?  I am running this script in Cygwin on Windows XP.  I
appreciate any suggestions!

~ Mike O.

#!/usr/bin/perl -w

use strict;

my $IDs = 'ID.txt';

unless (open(IDFILE, $IDs)) {
print "Could not open file $IDs!\n";
}

my $probes = 'HG_U95Av2_probe_fasta.txt';

unless (open(PROBES, $probes)) {
print "Could not open file $probes!\n";
}

open (OUT,'>','probe_subset.txt') or die "Can't write output: $!";

my @ID = ;
chomp @ID;

while () {
foreach (@ID) {
if(/^>probe:\w+:(\w+):/) {
print OUT;
print OUT scalar();
}
}

}
exit;
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 6/13/2006


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




A loop to parse a large text file--output is empty!

2006-06-13 Thread Michael Oldham
Dear all,

I am a Perl newbie struggling to accomplish a conceptually simple
bioinformatics task.  I have a single large file containing about
200,000 DNA probe sequences (from an Affymetrix microarray), each of
which is accompanied by a header, like so (this is in FASTA format):

>probe:HG_U95Av2:1138_at:395:301; Interrogation_Position=2631;
Antisense;
TGGCTCCTGCTGAGGTTTTCC
>probe:HG_U95Av2:107_at:543:519; Interrogation_Position=258; Antisense;
CTACTCTCGTGGTGCACAAGGAGTG
>probe:HG_U95Av2:1156_at:528:483; Interrogation_Position=2054;
Antisense;
TGCAGGTGGCAGATCTGCAGTCCAT
>probe:HG_U95Av2:1102_s_at:541:589; Interrogation_Position=4316;
Antisense;
GTGAAGGTTGCTGAGGCTCTGACCC

.etc.

What I would like to do is extract from this file a subset of ~130,800
probes (both the header and the sequence) and output this subset into a
new text file in the same (FASTA) format.  These 130,800 probes
correspond to 8,175 probe set IDs ("1138_at" is an example of a probe
set ID in the header listed above).  I have these 8,175 IDs listed in a
separate file called "ID.txt" and the 200,000 probe sequences in a file
called "HG_U95Av2_probe_fasta.txt".  The script below is missing
something because the output file ("probe_subset.txt") is blank.  This
is also the case if I replace the file "ID.txt" with a file consisting
of a single probe set ID (e.g. 1138_at).  Does anyone know what I am
missing?  I am running this script in Cygwin on Windows XP.  I
appreciate any suggestions!

~ Mike O.

#!/usr/bin/perl -w

use strict;

my $IDs = 'ID.txt';

unless (open(IDFILE, $IDs)) {
print "Could not open file $IDs!\n";
}

my $probes = 'HG_U95Av2_probe_fasta.txt';

unless (open(PROBES, $probes)) {
print "Could not open file $probes!\n";
}

open (OUT,'>','probe_subset.txt') or die "Can't write output: $!";

my @ID = ;
chomp @ID;

while () {
foreach (@ID) {
if(/^>probe:\w+:(\w+):/) {
print OUT;
print OUT scalar();
}
}

}
exit;
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 6/13/2006


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: What is a prompt package that actually works on Windows

2006-06-13 Thread Timothy Johnson
What are you trying to do, and how is it failing?



-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael Goldshteyn
Sent: Tuesday, June 13, 2006 12:50 PM
To: beginners@perl.org
Subject: What is a prompt package that actually works on Windows

It is definitely not IO::Prompt and it is most likely not anything that
has 
a Term::ReadKey dependency.

Thanks for any suggestions



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




What is a prompt package that actually works on Windows

2006-06-13 Thread Michael Goldshteyn
It is definitely not IO::Prompt and it is most likely not anything that has 
a Term::ReadKey dependency.

Thanks for any suggestions




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: newlines on win32, old mac, and unix

2006-06-13 Thread Xavier Noria

On Jun 13, 2006, at 20:26, Anthony Ettinger wrote:


I have to write a simple function which strips out the various
newlines on text files, and replaces them with the standard unix
newline \n


In Perl "\n" depends on the system, it is eq "\012" everywhere except  
in MacOS pre-X, where it is "\015". The standard Unix newline is "\012".



In text-mode, I open the file, and do the following:

   while (defined(my $line = ))
   {
   my $outline;
   if ($line =~ m/\cM\cJ/)
   {
   print "dos\n";
   ($outline = $line) =~ s/\cM\cJ/\cJ/;  
#win32


   } elsif ($line =~ m/\cM(?!\cJ)/) {
   print "mac\n";
   ($outline = $line) =~ s/\cM/\cJ/g; #mac
   } else {
   print "other\n";
   $outline = $line; #default
   }

   print OUTFILE $outline;
   }

It works fine on unix when I run the unit tests on old mac files, win,
and unix files and do a hexdump -C on themhowever, when I run it
on win32 perl 5.6.1, it is not doing any replacement. Teh lines remain
unchanged.

My understanding is that \n is a reference (depending on which OS your
perl is running on) to CR (mac), CRLF (dos), and LF (unix) in
text-mode STDIO.


That is a common misconception. The string "\n" has length 1 always,  
everywhere. It is not CRLF on Windows.


To explain this properly I'd need to reproduce here an article I've  
written for Perl.com, not yet published. But to address the problem  
is enough to say that in text mode there is an I/O layer (PerlIO)  
that does some magic back and forth between \n and the native newline  
convention. That's the way portability is accomplished, inherited  
from C.


To be able to deal with any newline convention the way you want in a  
portable way you disable that magic enabling binmode on the  
filehandle. The easiest solution is to slurp the text and s/// it  
like this (written inline):


  binmode $in_fh;
  my $raw_text = do { local $/; <$in_fh> };

  # order matters
  $raw_text =~ s/\015\012/\n/g;
  $raw_text =~ s/\012/\n/g unless "\n" eq "\012";
  $raw_text =~ s/\015/\n/g unless "\n" eq "\015";

  # $raw_text is normalized here

Since the newline convention is not necessarily the one in the  
runtime platform you cannot write a line-oriented script. If files  
are too big to slurp then you'd work on chunks, but need to check by  
hand whether a CRLF has been cut in the middle.


-- fxn


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: scoping problem with hash

2006-06-13 Thread Charles K. Clarkson
Mr. Shawn H. Corey wrote:

:   for ( keys %kv_pairs ){
: $hash_ref->{$_} = $kv_pairs{$_};
:   }

You could use a hash slice there.

@{ %$hash_ref }{ keys %kv_pairs } = values %kv_pairs;


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
Free Market Advocate
Web Programmer

254 968-8328

Don't tread on my bandwidth. Trim your posts.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




newlines on win32, old mac, and unix

2006-06-13 Thread Anthony Ettinger

I have to write a simple function which strips out the various
newlines on text files, and replaces them with the standard unix
newline \nafter reading the perlport doc, I'm even more confused
now.

  LF  eq  \012  eq  \x0A  eq  \cJ  eq  chr(10)  eq  ASCII 10
  CR  eq  \015  eq  \x0D  eq  \cM  eq  chr(13)  eq  ASCII 13



   | Unix | DOS  | Mac  |
  ---
  \n   |  LF  |  LF  |  CR  |
  \r   |  CR  |  CR  |  LF  |
  \n * |  LF  | CRLF |  CR  |
  \r * |  CR  |  CR  |  LF  |
  ---
  * text-mode STDIO


In text-mode, I open the file, and do the following:

   while (defined(my $line = ))
   {
   my $outline;
   if ($line =~ m/\cM\cJ/)
   {
   print "dos\n";
   ($outline = $line) =~ s/\cM\cJ/\cJ/; #win32

   } elsif ($line =~ m/\cM(?!\cJ)/) {
   print "mac\n";
   ($outline = $line) =~ s/\cM/\cJ/g; #mac
   } else {
   print "other\n";
   $outline = $line; #default
   }

   print OUTFILE $outline;
   }

It works fine on unix when I run the unit tests on old mac files, win,
and unix files and do a hexdump -C on themhowever, when I run it
on win32 perl 5.6.1, it is not doing any replacement. Teh lines remain
unchanged.

My understanding is that \n is a reference (depending on which OS your
perl is running on) to CR (mac), CRLF (dos), and LF (unix) in
text-mode STDIO. So replacing CR (not followed by LF) with LF should
work on mac, and CRLF with LF on dos, and leaving LF untouched on *nix
(other)then it shouldn't be a problem...however it appears that
\cJ is actually different on win32 than it is on unix.

so is \cJ is actually \cM\cJ on win32?



--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: scoping problem with hash

2006-06-13 Thread Mr. Shawn H. Corey
On Tue, 2006-13-06 at 13:08 -0400, Mr. Shawn H. Corey wrote:
>   $times{$hashkey}{home} = $time;
>   $times{hashkey}{total} = $total;
> 
> # Your code replaces, not augments

Consider adding this to your library of useful Perl utilities:

# --
# hset %hash, ( $key => $value, ... );
#   Augment the hash with the key-value pairs.
#   WARNING: This subroutine overwrites the value of any key that
already
#   exists.
sub hset (\%%) {
  my $hash_ref = shift;
  my %kv_pairs = @_;

  for ( keys %kv_pairs ){
$hash_ref->{$_} = $kv_pairs{$_};
  }
}


-- 
__END__

Just my 0.0002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: scoping problem with hash

2006-06-13 Thread Mr. Shawn H. Corey
On Tue, 2006-13-06 at 17:20 +0100, [EMAIL PROTECTED] wrote:
> Hi,
> 
> This is a bit of an extension on an earlier post. 
> 
> I am trying to create a data structure from a file (contents below). It is 
> meant to be a hash of 
> hashes but I suspect there is either a typo somewhere or I am hitting some 
> scoping problems. All 
> that is left in the hash is the last data assigned to it. Am I overwritting 
> my earlier assignment?
> 
> Data::Dumper shows the data as this
> ...snip
> 
> $VAR3 = 'Wed-07';
> $VAR4 = {
>   'total' => '8:42',
>   'home' => '17:51'
> };
> $VAR5 = 'Tue-06';
> $VAR6 = {
>   'total' => '7:20',
>   'home' => '16:18'
> };
> $VAR7 = 'Fri-09';
> $VAR8 = {
>   'total' => '8:05',
>   'home' => '18:37'
> };
> 
> 
> I want something like this
> $VAR3{Wed-07} = {
>   name=> Some Name,
>   began   => Tue-06,
>   day => Wed,
>   dom => 07,
>   morning => 09:27,
>   home=> 18:37,
>   total   => 8:42
> };
> 
> Can someone point me in the right direction (again)?
> 
> ### my effort ##
> 
> #!/usr/bin/perl
> 
> 
> use strict;
> use warnings;
> use Data::Dumper;
> 
> 
> my $file = 'myfile.txt';
> 
> my $stuff = read_file($file);
> 
> 
> sub read_file {
> 
> 
>  my $file = shift;
>  open(FH,$file) or die "Can't open $file: $!\n";
>  my %times;
>  my ($name,$begin,$hashkey,$key,$day,$dom,$mon,$time,$hour);
>  while () {
> chomp;
> if ($_ =~ /&N/) {
> ($name) = ($_ =~ /(\w+\s\w+|\w+\s\w+\s\w+|\w+\s\w+-\w+)$/);
> }
> if ($_ =~ /&D/) {
> ($begin) = ($_ =~ /(\w+\s+\d+-\w+-\d+)$/);
> }
> next if ($_ !~ /^(x|j|k|z)/);
> #   daydom   mon  
>time   hour
> ($key,$day,$dom,$mon,$time,$hour) = ($_ =~ 
> /^(\w)\s+(\w+)\s+(\d+)-(\w+)-
> \d+\s+(\d+:\d+):.*(\d+:\d+|-\d+:-\d+)/);
> $hashkey = $day.'-'.$dom;
>   $times{$hashkey}->{name} = $name;
>   $times{$hashkey}->{began} = $begin;
>  if ($key =~ /x/i ) {
> $times{$hashkey} = {
> name=> $name,
> began   => $begin,
> day => $day,
> dom => $dom,
> morning => $time,
> };
> }
>  }
>  elsif ($key =~ /z/) {
>  my ($h,$total) = ($_ =~ /\s+(\d+:\d+)\s+.*\s+(\d+:\d+)\s\$/);
>  $times{$hashkey} = {
> home=> $time,
> total   => $total,
>  };

  $times{$hashkey}{home} = $time;
  $times{hashkey}{total} = $total;

# Your code replaces, not augments


> 
>  }
>   }
>   print STDERR Dumper(%times);
>   return %times;
>  }
> ##
> 
> 
> ## Sample data ##
> 
> &N: Joe Bloggs
> &D: Tue 06-Jun-2006
> %%
> x Tue 06-Jun-2006 08:18:22 2006 2:11 [OKAY] $
> j Tue 06-Jun-2006 12:51:33 2006 4:33 [OKAY] $
> k Tue 06-Jun-2006 13:21:27 2006 0:30 OK+SHL $
> z Tue 06-Jun-2006 16:18:52 2006 2:57 [OKAY] 7:20 $
> ~
> %%
> x Wed 07-Jun-2006 08:39:05 2006 0:44 [OKAY] $
> j Wed 07-Jun-2006 13:11:23 2006 4:32 [OKAY] $
> k Wed 07-Jun-2006 13:41:04 2006 0:30 OK+SHL $
> z Wed 07-Jun-2006 17:51:18 2006 4:10 [OKAY] 8:42 $
> ~
> %%
> x Thu 08-Jun-2006 08:13:54 2006 2:06 [OKAY] $
> j Thu 08-Jun-2006 13:57:55 2006 5:44 [OKAY] $
> k Thu 08-Jun-2006 16:08:42 2006 2:10 OK+SHL $
> z Thu 08-Jun-2006 16:09:03 2006 0:00 [OKAY] 5:44 $
> ~
> %%
> x Fri 09-Jun-2006 09:24:05 2006 1:05 [OKAY] $
> j Fri 09-Jun-2006 13:10:56 2006 3:46 [OKAY] $
> k Fri 09-Jun-2006 14:17:40 2006 1:06 OK+SHL $
> z Fri 09-Jun-2006 18:37:38 2006 4:19 AFTER! 8:05 $
> ~
> %%
> ##
> Dermot Paikkos
> 
> Network Administrator @ Science Photo Library
> Phone: 0207 432 1100 
> Fax: 0207 286 8668
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: scoping problem with hash

2006-06-13 Thread Dermot Paikkos
On 13 Jun 2006 at 12:27, Mr. Shawn H. Corey wrote:

> On Tue, 2006-13-06 at 17:20 +0100, [EMAIL PROTECTED] wrote: > 
>  print STDERR Dumper(%times);
> 
> print STDERR Dumper( \%times );

That seems to have helped the Dumper output but I still haven't 
managed to get the other assignments to stick. The name, morning 
...etc are not in the output only the last assignments that were made 
in the while loop.


$VAR1 = {
  'Thu-08' => {
'aft' => '0:00',
'total' => '5:44',
'home' => '16:09'
  },
  'Wed-07' => {
'aft' => '4:10',
'total' => '8:42',
'home' => '17:51'
  },
  'Tue-06' => {
'aft' => '2:57',
'total' => '7:20',
'home' => '16:18'
  },
  'Fri-09' => {
'aft' => '4:19',
'total' => '8:05',
'home' => '18:37'
  }
};


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: scoping problem with hash

2006-06-13 Thread Mr. Shawn H. Corey
On Tue, 2006-13-06 at 17:20 +0100, [EMAIL PROTECTED] wrote:
>   print STDERR Dumper(%times);

print STDERR Dumper( \%times );


-- 
__END__

Just my 0.0002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




scoping problem with hash

2006-06-13 Thread dermot
Hi,

This is a bit of an extension on an earlier post. 

I am trying to create a data structure from a file (contents below). It is 
meant to be a hash of 
hashes but I suspect there is either a typo somewhere or I am hitting some 
scoping problems. All 
that is left in the hash is the last data assigned to it. Am I overwritting my 
earlier assignment?

Data::Dumper shows the data as this
...snip

$VAR3 = 'Wed-07';
$VAR4 = {
  'total' => '8:42',
  'home' => '17:51'
};
$VAR5 = 'Tue-06';
$VAR6 = {
  'total' => '7:20',
  'home' => '16:18'
};
$VAR7 = 'Fri-09';
$VAR8 = {
  'total' => '8:05',
  'home' => '18:37'
};


I want something like this
$VAR3{Wed-07} = {
name=> Some Name,
began   => Tue-06,
day => Wed,
dom => 07,
morning => 09:27,
home=> 18:37,
total   => 8:42
};

Can someone point me in the right direction (again)?

### my effort ##

#!/usr/bin/perl


use strict;
use warnings;
use Data::Dumper;


my $file = 'myfile.txt';

my $stuff = read_file($file);


sub read_file {


 my $file = shift;
 open(FH,$file) or die "Can't open $file: $!\n";
 my %times;
 my ($name,$begin,$hashkey,$key,$day,$dom,$mon,$time,$hour);
 while () {
chomp;
if ($_ =~ /&N/) {
($name) = ($_ =~ /(\w+\s\w+|\w+\s\w+\s\w+|\w+\s\w+-\w+)$/);
}
if ($_ =~ /&D/) {
($begin) = ($_ =~ /(\w+\s+\d+-\w+-\d+)$/);
}
next if ($_ !~ /^(x|j|k|z)/);
#   daydom   mon
 time   hour
($key,$day,$dom,$mon,$time,$hour) = ($_ =~ /^(\w)\s+(\w+)\s+(\d+)-(\w+)-
\d+\s+(\d+:\d+):.*(\d+:\d+|-\d+:-\d+)/);
$hashkey = $day.'-'.$dom;
$times{$hashkey}->{name} = $name;
$times{$hashkey}->{began} = $begin;
 if ($key =~ /x/i ) {
$times{$hashkey} = {
name=> $name,
began   => $begin,
day => $day,
dom => $dom,
morning => $time,
};
}
 }
 elsif ($key =~ /z/) {
 my ($h,$total) = ($_ =~ /\s+(\d+:\d+)\s+.*\s+(\d+:\d+)\s\$/);
 $times{$hashkey} = {
home=> $time,
total   => $total,
 };

 }
  }
  print STDERR Dumper(%times);
  return %times;
 }
##


## Sample data ##

&N: Joe Bloggs
&D: Tue 06-Jun-2006
%%
x Tue 06-Jun-2006 08:18:22 2006 2:11 [OKAY] $
j Tue 06-Jun-2006 12:51:33 2006 4:33 [OKAY] $
k Tue 06-Jun-2006 13:21:27 2006 0:30 OK+SHL $
z Tue 06-Jun-2006 16:18:52 2006 2:57 [OKAY] 7:20 $
~
%%
x Wed 07-Jun-2006 08:39:05 2006 0:44 [OKAY] $
j Wed 07-Jun-2006 13:11:23 2006 4:32 [OKAY] $
k Wed 07-Jun-2006 13:41:04 2006 0:30 OK+SHL $
z Wed 07-Jun-2006 17:51:18 2006 4:10 [OKAY] 8:42 $
~
%%
x Thu 08-Jun-2006 08:13:54 2006 2:06 [OKAY] $
j Thu 08-Jun-2006 13:57:55 2006 5:44 [OKAY] $
k Thu 08-Jun-2006 16:08:42 2006 2:10 OK+SHL $
z Thu 08-Jun-2006 16:09:03 2006 0:00 [OKAY] 5:44 $
~
%%
x Fri 09-Jun-2006 09:24:05 2006 1:05 [OKAY] $
j Fri 09-Jun-2006 13:10:56 2006 3:46 [OKAY] $
k Fri 09-Jun-2006 14:17:40 2006 1:06 OK+SHL $
z Fri 09-Jun-2006 18:37:38 2006 4:19 AFTER! 8:05 $
~
%%
##
Dermot Paikkos

Network Administrator @ Science Photo Library
Phone: 0207 432 1100 
Fax: 0207 286 8668


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: DESTROY executed twice

2006-06-13 Thread Randal L. Schwartz
> ""Glaessl," == "Glaessl, Danilo" <[EMAIL PROTECTED]> writes:

"Glaessl,> I have a OOP problem. I wrote a script that forks several child
"Glaessl,> processes that in turn create instances of the same class:

The DESTROY is being executed in both the parent and child.  There's
really no way around that... because you are indeed destroying the
object in both the parent and the child. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




DESTROY executed twice

2006-06-13 Thread Glaessl, Danilo
Hi,
 
I have a OOP problem. I wrote a script that forks several child
processes that in turn create instances of the same class:
 
for (my $i = 0; $i <= 10; $i++) {
defined(my $pid = fork()) or die "Unable to fork: $!";
 
if ($pid) { # parent process
next;
} else {# child process
setsid() or die "Unable to start a new instance: $!";

my $instance = MyModules::MyClass->new();
 
$instance->start();
last;
}
}

 
In MyModules/MyClass.pm there is a DESTROY method for taking some
houskeeping actions (closing database handle and deleting PID file):
 
sub DESTROY {
my $self  = shift;
my $exit_code = $? || 0; # use exit code from previous error
exit call
 
# close DB connection
$self->get_attribute("db_handle")->disconnect() if
($self->get_attribute("db_handle"));
 
# remove PID file and exit unless PID error
remove_pid_file($self->get_attribute("pid_file")) || exit(1);
 
exit($exit_code);
}
 
When running the script, everything works fine except for each
instance's error message reading "Unable to remove : No
such file or directory". By examing the log file and debugging the
script I found that the DESTROY method is executed twice. So the PID
file is deleted the first time the destructor is invoked, the second
time the deletion fails, of course, and results in the error message.
 
I read that the DESTROY method might be executed more than once if one
re-blesses the object in the destructor. But to my mind, this is not the
case in my script.
By the way, it works fine with Perl 5.6.1 on Solaris 8 for SPARC, the
problem occurs with 5.8.8 on Solaris 10 for x86.
 
Any help is appreciated.
 
Best regards,
 
Danilo
 
PS: The problem can be solved by making the objects remember if they
have been destroyed before and doing housekeeping only in case they have
not, though. However, I would like to find out about the root cause.


module install on HPUX 11.11 ....any suggestions?

2006-06-13 Thread Smith, Derek
I know I will probably need another compiler but wanted to make sure.  I
changed the make file to point to gcc, g++, cpp and c++ and I am still
getting errors. Here are my errors using /usr/bin/cc

 

[EMAIL PROTECTED] make

cp Size.pm blib/lib/Term/Size.pm

AutoSplitting blib/lib/Term/Size.pm (blib/lib/auto/Term/Size)

   /usr/bin/perl /opt/perl/lib/5.8.2/ExtUtils/xsubpp  -typemap
/opt/perl/li

b/5.8.2/ExtUtils/typemap  Size.xs > Size.xsc && mv Size.xsc Size.c

   cc -c-D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae
-D_HPUX_SOURCE -Wl,+

vnocompatwarnings -DNO_HASH_SEED -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -fas

t +Onolimit +Opromote_indirect_calls +DAportable +DS2.0
-DVERSION=\"0.2\"  -D

XS_VERSION=\"0.2\" +Z
"-I/opt/perl/lib/5.8.2/PA-RISC1.1-thread-multi/CORE"   Siz

e.c

(Bundled) cc: warning 480: The -A option is available only with the
C/ANSI C pro

duct; ignored.

(Bundled) cc: warning 422: Unknown option "f" ignored.

(Bundled) cc: warning 480: The +Onolimit option is available only with
the C/ANS

I C product; ignored.

(Bundled) cc: warning 480: The +Opromote_indirect_calls option is
available only

with the C/ANSI C product; ignored.

(Bundled) cc: warning 480: The +Z option is available only with the
C/ANSI C product; ignored.

cpp: "/opt/perl/lib/5.8.2/PA-RISC1.1-thread-multi/CORE/perlio.h", line
108: erro

r 4065: Recursion in macro "PerlIO".

*** Error exit code 1

 

Stop.

 

Thank you

Derek

 

 

 

Derek Bellner Smith

Unix Systems Engineer

Cardinal Health Dublin, Ohio

  

 


Cardinal Health -- Working together. For life. (sm)
_

This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information. If you have received it in 
error, please notify the sender immediately and delete the original. Any other 
use of the email by you is prohibited.

Dansk - Deutsch - Espanol - Francais - Italiano - Japanese - Nederlands - Norsk 
- Portuguese - Svenska: www.cardinalhealth.com/legal/email


SOAP::WSDL cant get a simple example working

2006-06-13 Thread Ramprasad A Padmanabhan

Hi,
  I have installed the example server script test.cgi from SOAP::Clean 
examples

Ref
http://backpan.perl.org/authors/id/S/ST/STODGHIL/SOAP-Clean-0.02.readme


Now I have a simple perl script just connecting to this server  , but it 
is failing


#!/usr/bin/perl
use SOAP::WSDL;
use strict;
my $url='http://192.168.2.105/rambin/test.cgi';
my $soap=SOAP::WSDL->new( wsdl => $url);
$soap->proxy('http://localhost');
$soap->servicename('arithmetic-test');
$soap->wsdlinit;

-
OUTPUT
SOAP::Schema->schema has been deprecated. Please use 
SOAP::Schema->schema_url instead. at 
/usr/lib/perl5/site_perl/5.8.5/SOAP/Lite.pm line 2885.
Error processing WSDL: cannot get  at 
/usr/lib/perl5/site_perl/5.8.5/SOAP/WSDL.pm line 62.




Can someone help me debug this ?
Thanks
Ram

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




CPAN help

2006-06-13 Thread Beast


I'm running "/usr/bin/wget -O - 
"http://cpan.cbn.net.id/authors/01mailrc.txt.gz";  > test just fine.

Why?


[EMAIL PROTECTED] ~]# cpan Mail::SpamAssassin
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Warning: Found only 0 objects in /root/.cpan/Metadata
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
 http://cpan.cbn.net.id/authors/01mailrc.txt.gz
LWP failed with code[501] message[Protocol scheme '' is not supported]
Fetching with LWP:
 http://komo.vlsm.org/CPAN/authors/01mailrc.txt.gz
LWP failed with code[501] message[Protocol scheme '' is not supported]

Trying with "/usr/bin/wget -O -" to get
   http://cpan.cbn.net.id/authors/01mailrc.txt.gz
--15:31:59--  http://cpan.cbn.net.id/authors/01mailrc.txt.gz
  => `-'
Resolving %20... failed: Host not found.

System call "/usr/bin/wget -O - 
"http://cpan.cbn.net.id/authors/01mailrc.txt.gz";  > 
/root/.cpan/sources/authors/01mailrc.txt"

returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz] 
doesn't exist

...
System call "/usr/bin/wget -O - 
"http://komo.vlsm.org/CPAN/modules/03modlist.data.gz";  > 
/root/.cpan/sources/modules/03modlist.data"

returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/modules/03modlist.data.gz] 
doesn't exist

No external ftp command available

Please check, if the URLs I found in your configuration file
(http://cpan.cbn.net.id/, http://komo.vlsm.org/CPAN/) are valid. The
urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/'

Could not fetch modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Warning: Cannot install Mail::SpamAssassin, don't know what it is.
Try the command

   i /Mail::SpamAssassin/

to find objects with matching identifiers.
---




--
--beast


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Using Net::SSH::Perl to execute a set of commands

2006-06-13 Thread Kelvin Wu

Sorry I didn't get you, why it is related to Math::BigInt::GMP?
To me  it sounds like a SSH interactive issue...


On 30/05/06, Oyler, Nathan <[EMAIL PROTECTED]> wrote:


Have you installed Math::BigInt::GMP?

Might not be it, but I was having a somewhat similar problem that it
fixed.


> -Original Message-
> From: Kelvin Wu [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 29, 2006 19:44 PM
> To: Perl
> Subject: Using Net::SSH::Perl to execute a set of commands
>
> Hi,
>
> I was trying to use Net::SSH::Perl to log into a remote box and
execute a
> program with pre-defined commands, something like:
>
>
> #!/usr/bin/perl
>
> use strict;
> use Net::SSH::Perl;
>
> my $ssh = Net::SSH::Perl->new("ip", debug => 0);
> $ssh->login("name", "password");
> my ($return) = $ssh->cmd("minicom -S mini_script_vpn.force");
> print $return;
>
> minicom is a program, and mini_script_vpn.force is a script which
defined
> a
> set of commands sent to minicom
>
> The terminal output should be something like: (if run the program
manually
> from shell)
>
> > minicom -S mini_script_vpn.force
> minicom: WARNING: please don't run minicom as root when not
maintaining
>   it (with the -s switch) since all changes to the
>   configuration will be GLOBAL !.
>
> Welcome to minicom 1.83.1
>
> OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n
> Compiled on May  3 2001, 22:36:07.
>
> Press CTRL-A Z for help on special keys
>
> Logging in..
>
> c_fw>enable
> Password:
> c_fw#Resetting VPN
> configure terminal
> c_fw(config)#Clear ipsec
> clear crypto ipsec sa
> c_fw(config)#Clear isakmp
> clear crypto isakmp sa
> c_fw(config)#Logging out and leaving...
> Killed
>
> But when I was running this command via the Perl Script above,
>
> shell: RSA authentication failed: Can't load public key.
> shell: Doing challenge response authentication.
> shell: No challenge presented.
> shell: Trying password authentication.
> shell: Sending command: minicom -S mini_script_vpn.force
> shell: Entering interactive session.
>
> It quits immediately after sending command.
>
> Any suggestion?
>
> Thanks



Re: Help understand documentation

2006-06-13 Thread Xavier Noria

On Jun 13, 2006, at 6:14, Vijay Kumar Adhikari wrote:


I understand. My question is that Net::Ping does not use that info at
all. If a host is alive, it will be listed in the output no matter
what port you specify. Is this a bug?


The module uses the port in several subroutines, like this

  $saddr = sockaddr_in($self->{"port_num"}, $ip);

but I think there is an errata in the SYNOPSIS indeed, it should read

  $p->{port_num} = (getservbyname("http", "tcp"))[2];

-- fxn



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]