where would i look?

2002-07-25 Thread nkuipers
Hello all, Here's the situation. I work as an analyst for a genomics lab. We have a dedicated local BLAST (http://www.ncbi.nih.gov/) server. Whether from the summer heat, or a failing drive, or an OS bug, or some combination of various factors, our server is crapping out too frequently. Th

installing modules when not root...my bad

2002-07-25 Thread nkuipers
perl Makefile.PL LIB=~/somedir make make test make install blah -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: determining whether Net::FTP module present: version 5.005_03on Solaris

2002-07-25 Thread nkuipers
I learned just today actually how to install a module when not root. So, you have your module tarball all good to go: >mkdir ~/lib >tar -zxvf modulename.tar.gz >perl Makefile.PL LIB=~/lib >make test >make >make install and you should be fine the link where I found the above is: http://perlmon

RE: time comparison

2002-07-25 Thread Timothy Johnson
You can try using Time::Local to convert it to time() format and then just subtract the number of seconds to see if it is expired... -Original Message- From: lz [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 11:02 AM To: [EMAIL PROTECTED] Subject: time comparison Hi guys, I

Re: determining whether Net::FTP module present: version 5.005_03on Solaris

2002-07-25 Thread McDonald Patrick
Net::FTP is not present in the version of Perl you reference. You will have to obtain Net::FTP from CPAN. The package comes with install instructions located in the file "INSTALL". If I remember correctly it should be the standard: perl Makefile.pl make make install I a

determining whether Net::FTP module present: version 5.005_03on Solaris

2002-07-25 Thread McCormick, Rob E
All, I'm scratching my head trying to determine whether perldoc isn't working correctly or if Net::FTP just isn't present? If I need to obtain Net::FTP from CPAN , how would I install as not and use it? I wouldn't simply be able to: use Net::FTP; # would I? Tried: /bin> perldoc -m Net::FTP

Re: Hi, newbie question

2002-07-25 Thread Robert Thompson
In vi, you have to type ctrl-v ctrl-m. This will tell vi you mean control-m and not carrot-m. :%s///g =-= Robert Thompson > > Even in vi when i do a search for ^M by doing '/^M' it says that no matches were >found. The ^M is not two characters but one. Can anyone out there please help me? --

named-pipes limited to 1 line?

2002-07-25 Thread zentara
Hi, I'm starting to check out IPC with named pipes. In the following example, my pipe-writer dosn't work from inside a loop. It only sends one line and then it all closes. Is this a limitation of named pipes? How do you keep the pipe open? First I create the named-pipe: #!/bin/sh mkfifo named-

RE: Command line Password

2002-07-25 Thread Meidling, Keith, CTR, OSD-C3I
If you have the Perl Cookbook, check 15.10 on pages 529 and 530. You can use the Term::Readkey from CPAN. use Term::Readkey; ReadMode('noecho'); $password = ReadLine(0); That's the brief example they gave. A more elaborate example is in the book. -Original Message- From: Richard Low

Re: function for finding the index of an element in an array?

2002-07-25 Thread John W. Krahn
Daniel David wrote: > > Hi, Hello, > I couldn't seem to find a built-in function for finding the index > of an element in an array...so I wrote this one: > > > > # position_of returns the position of a string in an array of

Re: Problem with UNPACK

2002-07-25 Thread John W. Krahn
Tin-Shan Chau wrote: > > I have run into the following problem: If I concatenate > the packed values of a list to a string, when I use the > unpack operation to put the values back into an array, > the last element is missing. I can only get around the > problem by specifying the exact number of

Re: another sort question (flame away)

2002-07-25 Thread John W. Krahn
Bob Showalter wrote: > > > From: [EMAIL PROTECTED] > > > > This should not matter what the size is but would > > expect a number at > > the beginning: > > > > foreach my $MyKey (sort {$a->[1] <=> $b->[1]} > > map{[ $_, /^(\d+)/ ]} > > keys %final_list) {

Re: del files

2002-07-25 Thread John W. Krahn
[ Please don't top-post Please remove unwanted lines from your post. ( 122 lines trimmed ) ] Connie Chan wrote: > > 1. in the array > > Method 1 > for (my $x = 0; $x <= $#privates; $x++) > { $privates[$x] =~ s/^(.+)$/"$1"/ } > > Method 2 > for (0..$#privates) > { my $temp = shift(@privat

RE: Command line Password

2002-07-25 Thread Bob Showalter
> -Original Message- > From: Richard Lowe [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 5:57 AM > To: [EMAIL PROTECTED] > Subject: Command line Password > > > Hi, > > I'm trying to read in a password from the command prompt, but > want to either > mask the typed characters

Re: Command line Password

2002-07-25 Thread drieux
On Thursday, July 25, 2002, at 02:57 , Richard Lowe wrote: > The systems I'm using are Win32, and I'd rather not have to use any CPAN > modules - I've been looking into tied filehandles, but can't work out > what's > required in the subroutines. I presume that you are doing this in a 'dos comm

RE: Jes new to List

2002-07-25 Thread Mark Anderson
>I couldn't quite follow this program off the book. The parts not quite >clear to me are (the hwole program is given below): I'll go through them block by block, and then you can ask deeper questions about the ones that I don't explain well enough. >$i = 0; I'm guessing that you know that $i i

RE: time comparison

2002-07-25 Thread Nikola Janceski
Date::Calc And any other Date module you can find on search.cpan.org > -Original Message- > From: lz [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 2:02 PM > To: [EMAIL PROTECTED] > Subject: time comparison > > > Hi guys, > > I am extracting the following expiration time

Re: Jes new to List

2002-07-25 Thread Janek Schleicher
[EMAIL PROTECTED] wrote at Fri, 26 Jul 2002 07:18:00 +0200: > Strolling thru' Learning Perl and already have a few q's in mind: > > I couldn't quite follow this program off the book. The parts not quite clear to me >are (the hwole > program is given below): > > $i = 0; > $correct = "maybe"; {

Re: on a lighter note

2002-07-25 Thread Chris Garaffa
Have you submitted to http://www.perlmonks.org/index.pl?node=Perl%20Poetry (Perl Poetry @ perlmonks.org)? He who calles himself "nkuipers" (from <[EMAIL PROTECTED]>) wrote on 7/25/02 11:47 AM: > a bit of humour in appreciation for the help I've gotten on this mailing list. > > > #!/usr/bin/pe

Command line Password

2002-07-25 Thread Richard Lowe
Hi, I'm trying to read in a password from the command prompt, but want to either mask the typed characters with the '*' character, or 'disconnect' the input from the screen so the characters don't appear at all, but the input is still captured. The systems I'm using are Win32, and I'd rather not

Re: Checking if a file is downloading

2002-07-25 Thread Yupapa
Hi, Does this work ah? #!/usr/bin/perl use strict; my($Bytes,$fhandle,$Buffer); my $file = 'yourfile.ext'; open(FILE, ">$file") or die print "Could not open $file: $!\n"; while ($Bytes = read($fhandle,$Buffer,1024)) { print FILE $Buffer; } close($fhandle); cl

time comparison

2002-07-25 Thread lz
Hi guys, I am extracting the following expiration time from a certificate, and I get expiration time from the certificate in the following format. notAfter=Nov 16 23:59:59 2002 GMT I need to compare system date with the date from a certificate to find out whether certificate has already been

Re: Jes new to List

2002-07-25 Thread Joe Raube
So what part are you having trouble with Tell us what you don't understand. -Joe --- "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Strolling thru' Learning Perl and already have a few q's in mind: > > I couldn't quite follow this program off the book. The parts not > quite > clear to m

Problem with UNPACK

2002-07-25 Thread Tin-Shan Chau
I have run into the following problem: If I concatenate the packed values of a list to a string, when I use the unpack operation to put the values back into an array, the last element is missing. I can only get around the problem by specifying the exact number of elements to unpack. And if I

Problem with UNPACK

2002-07-25 Thread Tin-Shan Chau
I have run into the following problem: If I concatenate the packed values of a list to a string, when I use the unpack operation to put the values back into an array, the last element is missing. I can only get around the problem by specifying the exact number of elements to unpack. And if I

RE: little help

2002-07-25 Thread Nikola Janceski
No offense intended, but you could start by making the varible names a little more descriptive. Then use at least use strict, but it's only a suggestion. Now see inline comments > -Original Message- > From: William Black [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 1:39 PM >

Jes new to List

2002-07-25 Thread [EMAIL PROTECTED]
Strolling thru' Learning Perl and already have a few q's in mind: I couldn't quite follow this program off the book. The parts not quite clear to me are (the hwole program is given below): $i = 0; $correct = "maybe"; { while ($correct eq "maybe") { if ($words[$i] eq $guess){ $correct = "yes"; }

RE: Percent % completed?

2002-07-25 Thread Timothy Johnson
That's the one. :) -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 10:40 AM To: 'Timothy Johnson'; 'David Samuelsson (PAC)'; '[EMAIL PROTECTED]' Subject: RE: Percent % completed? I think Tim meant: open(COMMAND, "command |") or die "$!

RE: Percent % completed?

2002-07-25 Thread Nikola Janceski
I think Tim meant: open(COMMAND, "command |") or die "$!"; while (){ #here will come each line of output in $_ while the command runs and until the command ends. } close COMMAND; > -Original Message- > From: Timothy Johnson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, Ju

re: little help

2002-07-25 Thread William Black
Can someone tell me why the below code can't won't work. Essentially, there is a directory full of files and I wanted to compare them to names I stored in a file. If the name of the file is not found I just want to say file not found, etc... A liitle help please $bin_dir = '...'; ope

RE: del files

2002-07-25 Thread Timothy Johnson
You're right, sorry, but perhaps the reason why it is returning 0 is because a) he's attempting to unlink @private instead of @privates (or that could just be an email typo) b) he's attempting to unlink @privates each time he cycles through an element of @privates, so the only time he would get

Re: Using Cwd; in practice how have you used...

2002-07-25 Thread drieux
On Wednesday, July 24, 2002, at 12:42 , McCormick, Rob E wrote: [..] > I don't > understand cwd (current working directory). My questions apply to this > general scenario: > > In practice, I'd like to work with my .pl or .plx files in say, > /myhome/bin/ [..] Let's start with some simple basic

RE: Percent % completed?

2002-07-25 Thread Timothy Johnson
Perhaps you could open the command to a filehandle open(COMMAND,"|command"); and figure out something from there. I've never done it, so I'm not sure, and I have to run, but that might get you started. -Original Message- From: David Samuelsson (PAC) [mailto:[EMAIL PROTECTED]] Sent: Thu

Re: directory scanning

2002-07-25 Thread zentara
On Thu, 25 Jul 2002 12:25:06 -0400, [EMAIL PROTECTED] (Bob Showalter) wrote: >Uh, you're running the digest on the file *names* and not >the file *contents*. Obviously, the file *names* aren't the >same! Thanks Bob, I gloss over the details sometimes. :-) This one works fine: ###

Re: directory scanning

2002-07-25 Thread Felix Geerinckx
on Thu, 25 Jul 2002 16:18:00 GMT, Zentara wrote: > I checked the files with a hexdiff program and > they are identical. I wonder if Digest::MD5 can > be trusted??? Oh yes, it can. You should reread perldoc Digest::MD5 the md5_hex function expects data as its argument, not a filename. You

RE: directory scanning

2002-07-25 Thread Bob Showalter
> -Original Message- > From: zentara [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 12:18 PM > To: [EMAIL PROTECTED] > Subject: Re: directory scanning > > > On Thu, 25 Jul 2002 08:09:17 -0400, [EMAIL PROTECTED] (William > Black) wrote: > > >Hi All, > > > >I need an idea on h

Re: directory scanning

2002-07-25 Thread zentara
On Thu, 25 Jul 2002 08:09:17 -0400, [EMAIL PROTECTED] (William Black) wrote: >Hi All, > >I need an idea on how to approach a script. Say I had a directory X with 50 >files in it and I have another directory Y that is suppose to have the same >exact files in it as X. How could someone approach

on a lighter note

2002-07-25 Thread nkuipers
a bit of humour in appreciation for the help I've gotten on this mailing list. #!/usr/bin/perl no strict; $rules; my %hash = (smells => 'good'); for $i (@drag) { open EYES, "$i"."must" or warn "groovy man"; print "Once again, my hash makes me one with the Llama;" } close EYES and sleep; "You

Re: function for finding the index of an element in an array?

2002-07-25 Thread Janek Schleicher
Daniel David wrote at Thu, 25 Jul 2002 12:00:29 +0200: > I couldn't seem to find a built-in function for finding the index of an element in >an array...so I > wrote this one: > ... > > it works but somehow i feel there's a built in function for this You could also exploit the List::Util mo

RE: another sort question (flame away)

2002-07-25 Thread David . Wagner
Depends on what the user is really after. To me it is a starting point for the developer to continue from there. With minor changes, it should be able to handle all that the developer wants, but it was stated that this was a Key into a hash. Wags ;) -Original Message- From: Bob

Re: function for finding the index of an element in an array?

2002-07-25 Thread Connie Chan
Ooops... =) I 've posted the bug version, which should set the beginning with -1. Thanks for remind =) Rgds, Connie - Original Message - From: "Kay Bieri" <[EMAIL PROTECTED]> To: "Connie Chan" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 9:07 PM Subject: R

RE: That seems interesting ? but I don't know why ?

2002-07-25 Thread Bob Showalter
> -Original Message- > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 24, 2002 4:30 PM > To: [EMAIL PROTECTED] > Subject: Re: That seems interesting ? but I don't know why ? > > > Bob Showalter wrote: > > > > Well, it only works for integers. It's because of the

Re: That seems interesting ? but I don't know why ?

2002-07-25 Thread Chas Owens
> Drieux might provide us with some benchmarks about which one's faster > these days... ;-) I beat him to it. Interestingly enough, I either have a bug in my code (and I don't think I do) or xor is dangerous in relation to negative numbers (without the integer pragma). The results seem to fav

Re: function for finding the index of an element in an array?

2002-07-25 Thread Robin Norwood
Kay Bieri <[EMAIL PROTECTED]> writes: > > Right! I have the same idea as you, and I have this : > > > > my @list = ('1234', '4567', '789A', 'BCDE', 'FGHI'); > > my $GetLocation = 0; > > my $value = 'BCDE'; > > > > for (my $atLoc = 0; $atLoc <= $#list and ! $GetLocation ; $atLoc++) > > { $GetLocat

Re: function for finding the index of an element in an array?

2002-07-25 Thread Kay Bieri
> Right! I have the same idea as you, and I have this : > > my @list = ('1234', '4567', '789A', 'BCDE', 'FGHI'); > my $GetLocation = 0; > my $value = 'BCDE'; > > for (my $atLoc = 0; $atLoc <= $#list and ! $GetLocation ; $atLoc++) > { $GetLocation = $atLoc if ($value eq $list[$atLoc]) } > > And

RE: directory scanning

2002-07-25 Thread Nikola Janceski
Funny. I wrote a script that does that, but recursively for all subdirs too. Here's a good place to start: File::Find > -Original Message- > From: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 8:56 AM > To: Perl beginners > Subject: re: directory scanning

re: directory scanning

2002-07-25 Thread Sudarshan Raghavan
On Thu, 25 Jul 2002, William Black wrote: > Hi All, > > I need an idea on how to approach a script. Say I had a directory X with 50 > files in it and I have another directory Y that is suppose to have the same > exact files in it as X. How could someone approach checking directory Y > agins

Re: function for finding the index of an element in an array?

2002-07-25 Thread Connie Chan
Right! I have the same idea as you, and I have this : my @list = ('1234', '4567', '789A', 'BCDE', 'FGHI'); my $GetLocation = 0; my $value = 'BCDE'; for (my $atLoc = 0; $atLoc <= $#list and ! $GetLocation ; $atLoc++) { $GetLocation = $atLoc if ($value eq $list[$atLoc]) } And I finally got t

RE: another sort question (flame away)

2002-07-25 Thread Bob Showalter
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 24, 2002 5:31 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: another sort question (flame away) > > > This should not matter what the size is but would > expect a numb

Re: del files

2002-07-25 Thread Connie Chan
1. in the array Method 1 for (my $x = 0; $x <= $#privates; $x++) { $privates[$x] =~ s/^(.+)$/"$1"/ } Method 2 for (0..$#privates) { my $temp = shift(@privates); $temp = '"'.$temp.'"'; push (@privates, $temp) } I believe there should be a simpiler way, anybody in list can tell ? 2. in the u

Re: function for finding the index of an element in an array?

2002-07-25 Thread Sudarshan Raghavan
On Thu, 25 Jul 2002, Sudarshan Raghavan wrote: > On Thu, 25 Jul 2002, Daniel David wrote: > > > Hi, > > I couldn't seem to find a built-in function for finding the index > > of an element in an array...so I wrote this one: > > > >

re: directory scanning

2002-07-25 Thread William Black
Hi All, I need an idea on how to approach a script. Say I had a directory X with 50 files in it and I have another directory Y that is suppose to have the same exact files in it as X. How could someone approach checking directory Y aginst X to see if they had the same files? Thks, William

Re: function for finding the index of an element in an array?

2002-07-25 Thread Sudarshan Raghavan
On Thu, 25 Jul 2002, Daniel David wrote: > Hi, > I couldn't seem to find a built-in function for finding the index > of an element in an array...so I wrote this one: > > > > # position_of returns the position of a string in a

Weekly list FAQ posting

2002-07-25 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address)

Interaction whith the OS: System command or better ?

2002-07-25 Thread Jean Berthold
Hello everybody, This is my first post on this list ... Currently I try to learn Perl language ... I want to rewrite a Korn Shell script wich is make a full system backup, by using the system tools available under Solaris 8: fssnap/ufsdump The Korn Shell script does the following tasks: 1. Th

function for finding the index of an element in an array?

2002-07-25 Thread Daniel David
Hi, I couldn't seem to find a built-in function for finding the index of an element in an array...so I wrote this one: # position_of returns the position of a string in an array of strings, # and -1 if the string is not a mem

Re: del files

2002-07-25 Thread John W. Krahn
Javeed Sar wrote: > > I want to delete files. > > I am not able to delete , what is the wrong thing I am doing here. > I am able to see the file in @privates > > I am getting following output: > > 0 deleted > Attempting to delete M:\jav_test\train\k k k.mkelem.mkelem > > #!c:\perl\bin\perl >

Re: del files

2002-07-25 Thread Connie Chan
> What about if there r space in file names? There is no problem for unlink to handle filename with spaceS. The issue is on how you get the file list to the array. Rgds, Connie > > > -Original Message- > From: Connie Chan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2

Re: del files

2002-07-25 Thread Connie Chan
for (@privates) { chomp; print "Attemp to del $_\n"; unlink ($_) ? {print "$_ unable to del" } : {print "$_ deleted" }; } I didn't ever tried unlink @array like method, perhaps the problem is there. and you got 0 delete is the "fail signal" send back from the unl

Re: del files

2002-07-25 Thread Felix Geerinckx
on Thu, 25 Jul 2002 06:58:03 GMT, Javeed Sar wrote: If you had used strict, Perl would have noticed the problem. > #!c:\perl\bin\perl > @privates =`cleartool lsprivate -tag jav_test -other`; > #print "@privates"; > #print "Enter a pattern:"; > #my $pattern =<>; > #chomp $pattern; > foreach (@

Percent % completed?

2002-07-25 Thread David Samuelsson (PAC)
Hello again out there. Is there anyway to get perl to do a counter so it counts in the command shell how many % that is done? I have a script that runs a check on a database, its just 1 command and it spits out some information. Can i parse this information from when its printing out this info

RE: del files

2002-07-25 Thread Sudarshan Raghavan
On Thu, 25 Jul 2002, Timothy Johnson wrote: > > Your script states "Attempting to delete $_", but when you actually go to > delete it, you have "unlink @private", which translates to "unlink a file > whose name is the number of elements in @private. No, unlink takes a list of files to delete a

RE: del files

2002-07-25 Thread Timothy Johnson
Your script states "Attempting to delete $_", but when you actually go to delete it, you have "unlink @private", which translates to "unlink a file whose name is the number of elements in @private. I think you want to change that line to "unlink $_", followed by "$_ deleted". -Original Mes