Re: Changing the String of the file at one shot.

2005-03-08 Thread David Storrs
On Tue, Mar 08, 2005 at 12:02:09PM +0100, John Doe wrote: > Am Dienstag, 8. März 2005 02.04 schrieb David Storrs: > > > >Suneel Kumar B <mailto:[EMAIL PROTECTED]> wrote: > > > >: Can i > > > >: have an option by which i could open a file for both re

Re: Changing the String of the file at one shot.

2005-03-08 Thread David Storrs
On Mon, Mar 07, 2005 at 11:00:49AM -0500, Wiggins d'Anconia wrote: > Charles K. Clarkson wrote: > >Suneel Kumar B wrote: > > > >: I have a situation where in, iam updating a file by replacing few > >: strings in some lines with another string. While doing this, Can i > >:

Re: Appending constant string to variable inside a here-document

2005-03-08 Thread David Storrs
On Sun, Mar 06, 2005 at 11:21:23PM -0600, Charles K. Clarkson wrote: > Harold Castro wrote: > : if the current content of $word is the word "big", and > : I would want to print a here document appending > : something to "big" like "foot": > : > : print < : > : $word."f

Re: Count the occurence of a character

2004-07-24 Thread David Storrs
On Fri, Jul 23, 2004 at 12:13:48PM +0200, Paul Johnson wrote: > On Fri, Jul 23, 2004 at 03:12:22PM +0530, Jaffer Shaik wrote: > > > I have the below strig > > > > $str = "abckdweqadidkisdikda"; > > > > In the above string, I want to count the occurrences of character 'a', > > i.e I should g

Re: Elegant quoted word parsing

2004-06-12 Thread David Storrs
On Fri, Jun 11, 2004 at 10:08:23AM -0500, James Edward Gray II wrote: > On Jun 10, 2004, at 9:46 PM, Beau E. Cox wrote: > > >Hi - > > > >I am trying to come up with a simple, elegant word parsing script, > >that: > > > >* takes a scalar string, and > >* splits it into words separating on white sp

Re: Very wierd problem with CGI.pm

2004-06-12 Thread David Storrs
On Fri, Jun 11, 2004 at 01:07:54PM +0100, mike wrote: > Has anyone ever come accross this wied problem before > > I have a script which pulls records from a DB then loops into a form and > shows each record, with the id no being concatenated to the field name > to give a unique record id. > > How

Re: returning problem of regexp

2004-06-12 Thread David Storrs
On Fri, Jun 11, 2004 at 09:10:48AM +0200, Graf Laszlo wrote: > Hi Ziggy > > You got me wrong. Anyway thanks for example. > Take a look here: > > #!/usr/bin/perl > @str = (); > push @str, "\n"; > push @str, "\n"; > push @str, "BBB\n"; > push @str, "\n"; > push @str, "\n";#<- watch

Re: vi editor

2004-06-07 Thread David Storrs
On Sat, Jun 05, 2004 at 04:34:00PM +0100, aditi gupta wrote: > hi, > > vi is used only in unix and linux.which editor can be used in windows and is better > than notepad. > > thanx, > > aditi I'm extremely pleased with Textpad (http://www.textpad.com). Fast start time, easy to use, highly

Re: searching a code for performing blast n giving output in a particular format.

2004-06-06 Thread David Storrs
On Fri, Jun 04, 2004 at 03:15:28PM -, aditi wrote: > hi, > > i have to blast genes of human Y chromosome(104 genes)with genomes of non > human species to find which genes are conserved on Y and on non-Y > chromosomes in other species.and for each gene,its chromosome its 5' and > 3'end loc

Re: how to use perl in windows

2004-06-06 Thread David Storrs
On Sat, Jun 05, 2004 at 02:38:06PM +0100, aditi gupta wrote: > hi, > > for writing perl programs,notepad is used.But what should be done to execute the > programs? What I generally do is to open a DOS window and type 'perl '. So, if I want to run foo.pl, I type: perl foo.pl > Also

Re: removing element of array

2004-05-16 Thread David Storrs
On Fri, May 14, 2004 at 10:35:45PM -0500, Andrew Gaffney wrote: > Charles K. Clarkson wrote: > >Andrew Gaffney <[EMAIL PROTECTED]> wrote: > >: > >: This doesn't quite work because I'm removing elements > >: from the array I'm looping through. What would be the > >: best way to take care of this? >

Re: How to load environment ?

2004-05-16 Thread David Storrs
On Fri, May 14, 2004 at 07:59:40PM -0500, max wrote: [...] > So i use another bash script to load the environment and run the perl script > from one line in the crontab, the content of the load and run script is this: > > ---

Re: lowercase

2003-10-26 Thread David Storrs
Or you can even do it without the parens: $stri = lc $stri; --Dks On Fri, Oct 24, 2003 at 09:26:40PM -0700, [EMAIL PROTECTED] wrote: > or you can do $stri=lc($stri); > > -rkl > > > try this: > > $stri =~ tr/A-Z/a-z/; > > > > yi > > > > --- Andre Chaves Mascarenhas <[EMAIL PROTECTED]> wrote:

Re: Passing and returning values from another script?

2003-10-26 Thread David Storrs
On Fri, Oct 24, 2003 at 09:47:14AM -0800, Mark Weisman wrote: > I'm not sure, however I put the script mods in that you suggested, and > my $output is the word "SCRIPT", I would like clarification on line 2 if > you would please? > >my $output = join("", SCRIPT); > From: [EMAIL PROTECTED] [mailto:

Re: Parsing pipe delimited file

2003-10-25 Thread David Storrs
On Wed, Oct 22, 2003 at 07:22:24PM +0200, Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, Charles K. Clarkson > wrote: > > > Kevin Pfeiffer <[EMAIL PROTECTED]> wrote: > > > > : Where I am stuck is on the question: > > : > > : Given an @array such as > > : ("Title of Song", "Artist", "Tit

Re: Do BEGIN blocks and END blocks have priority?

2003-09-28 Thread David Storrs
On Fri, Sep 26, 2003 at 11:04:21AM -0400, Dan Anderson wrote: > > BEGIN blocks do not take precedence over one another--they are all > > still executed. They are, however, executed immediately after perl > > finishes compiling them. So, if you have the following code: > > Ok, so I'm guessing tha

Re: How to get the file name from a path

2003-09-25 Thread David Storrs
On Thu, Sep 25, 2003 at 05:15:56PM +0300, Juris wrote: > On Thu, 25 Sep 2003 12:10:15 +0530, Chetak Sasalu M > <[EMAIL PROTECTED]> wrote: > > > > >Hi, > >How can I extract "filename" from /root/dir1/.../filename > $path_name='/root/dir1/.../filename'; > my $fname=substr($path, > rindex($path,"/

Re: Do BEGIN blocks and END blocks have priority?

2003-09-25 Thread David Storrs
On Thu, Sep 25, 2003 at 09:12:48PM -0400, Dan Anderson wrote: > If I create code with: > > BEGIN > { ># something >BEGIN >{ > # something else >} > } > > Will the inner BEGIN block take precedence over the outer one, and thus > load any subroutines or whatever is in the inner

Re: How do I query whether a toplevel window exists?

2003-09-25 Thread David Storrs
> On Tue, Sep 23, 2003 at 12:04:05PM -0500, Robert Greenway wrote: > > have opened 3 additional toplevel windows in my application for input of > > optional parameters. How can I query if they exist, so I don't recreate > them > > and so I can process them when completed? > > On Wed, Sep 24, 2003

Re: How do I query whether a toplevel window exists?

2003-09-23 Thread David Storrs
On Tue, Sep 23, 2003 at 12:04:05PM -0500, Robert Greenway wrote: > have opened 3 additional toplevel windows in my application for input of > optional parameters. How can I query if they exist, so I don't recreate them > and so I can process them when completed? > > Thanks > Bob Bob, When you

Re: Need help on Hash Slices. !!

2003-09-23 Thread David Storrs
On Tue, Sep 23, 2003 at 08:49:11PM +0530, Pandey Rajeev-A19514 wrote: > Hi, > > I have a list like > > @list = ( "key1: Vlan1 :0989\n" > "key2: Vlan2 :0989\n" > "key3: Vlan3 :0989\n" > "key4: Vlan4 :0989\n"); > > I wanted to make a hash with keys as key1, key2 , key3, key4. >

Re: migrating perl from version x to version y

2003-09-23 Thread David Storrs
On Tue, Sep 23, 2003 at 10:56:09AM -0400, Rich Fernandez wrote: > Can some one tell me if there is an easy way generally speaking to migrate > one version of perl and the modules installed under it to another version? > > Also, in this specific case I want to go from 5.00503 to 5.8.0 The wrinkle >

Re: multiple regex in if() staetment

2003-08-21 Thread David Storrs
On Tue, Aug 19, 2003 at 05:54:42PM -0500, Dan Muey wrote: > Howdy all: > > I'm trying to figure out the best way to test a string agains a list of regexs like > so: > > my @regex = qw(qr(joe$) qr(^mama) qr([abc])); As was pointed out already, don't use the qw(). Here are some interesting bench

Re: compare date,time

2003-08-14 Thread David Storrs
On Mon, Aug 11, 2003 at 10:25:07PM +0200, awards wrote: > Hi, > > thank you, Now i have a new question. > If I do the code myself which I can do. > would the process of executing the program faster if I do the code myself or > if I use a Module i.e Date::Calc?? > > regards > awards There is a s

Re: compare date,time

2003-08-14 Thread David Storrs
On Wed, Aug 13, 2003 at 09:35:20PM -0700, R. Joseph Newton wrote: > David Storrs wrote: > > > On Mon, Aug 11, 2003 at 10:25:07PM +0200, awards wrote: [snip] > > > would the process of executing the program faster if I do the code myself or > > > if I use a Module i.e

Re: :Telnet

2003-08-14 Thread David Storrs
On Mon, Aug 11, 2003 at 09:42:40AM -0400, Stephen Gilbert wrote: > > -Original Message- > > From: SilverFox [mailto:[EMAIL PROTECTED] > > Sent: Sunday, August 10, 2003 4:58 PM > > To: [EMAIL PROTECTED] > > Subject: Net::Telnet > > > > > > hey anyone know how to check if a file exists usin

Re: Substiuting portions of a string with elements from a hash ...

2003-07-17 Thread David Storrs
Hi Jamie, On Thu, Jul 17, 2003 at 11:46:08AM -0400, Jamie Risk wrote: > I'm trying to add HTML anchors to a lines of text. Quick example would be > to take the line: >"Search the internet using an engine like Google." > and turn it into: >"Search the internet using an engine like href="w

Re: null fields from split

2003-07-13 Thread David Storrs
On Sun, Jul 13, 2003 at 08:39:16AM -0400, Jeff 'japhy' Pinyan wrote: > On Jul 13, David Storrs said: > > >Given this code: > > > > my $TOKEN_DELIMS = qr/[^\w\-'\$]/; > > my $text = # string containing the contents of an mbox file > > > >

null fields from split

2003-07-13 Thread David Storrs
Greetings all, Given this code: my $TOKEN_DELIMS = qr/[^\w\-'\$]/; my $text = # string containing the contents of an mbox file my @tokens = split /$TOKEN_DELIMS/o, $text; I end up with a large number of null strings ('') in @tokens. After RTFMing on split, I assume this is because I am m

Re: convertion bash script to perl

2003-07-09 Thread David Storrs
On Wed, Jul 09, 2003 at 05:59:47AM -0700, thyagarajan k wrote: > Hello friends, > > i am quite new to perl and currently i have a > requirement like to re-write the script written in > unix bash shell to perl. I would like to know is > there any convertion tools available so that i can > convert

Re: Why doesn't this match

2003-07-09 Thread David Storrs
On Tue, Jul 08, 2003 at 02:48:59PM -0400, Paul Kraus wrote: > Expression > /Sales - Freight - Leimkuehler\s+(\d+,?\d+\.?\d+)/ > > String > 410-02-00Sales - Freight - Leimkuehler > 6.96 > > It does match if I remove everything after Leimkuehler. > This is how it reads to me > > 1 or more

Re: Rename - readdir - Permission Denied

2003-07-08 Thread David Storrs
On Mon, Jul 07, 2003 at 11:45:34AM -0400, Paul Kraus wrote: > I am doing a readdir. > Taking the filenames that are found and trying to rename them. > > Opendir > @files = Readdir > > Foreach @files > parse filename > $newfile = newfile name based on parsed name > push (@renam

Re: RegEx stuff

2003-07-07 Thread David Storrs
On Sat, Jul 05, 2003 at 09:06:53AM -0700, Skot wrote: > Hello, > > I want to search a string for matching content, > not quite getting it. > > something like: > > if ($myInputLine =~ m/.\123\.222/) { ... } Your regex consists of 6 atoms, which must be matched in the precise order in which they

Re: match count

2003-07-07 Thread David Storrs
On Sat, Jul 05, 2003 at 11:29:12AM -0400, Jeff 'japhy' Pinyan wrote: > On Jul 3, George P. said: > > >> while ($string =~ /pattern/g){ > >> $count++; > >> if ($count > $max_count){ > >> $string = substr($string,0,pos($string)); > >> last; > >> } > >> } > > > >$string =~ s/((.*?$patte

Re: RegEx stuff

2003-07-07 Thread David Storrs
On Mon, Jul 07, 2003 at 11:46:06AM -0700, David Storrs wrote: > On Sat, Jul 05, 2003 at 09:06:53AM -0700, Skot wrote: > > > > if ($myInputLine =~ m/.\123\.222/) { ... } > > > Your regex consists of 6 atoms, which must be matched in the precise > order in which they ap

Re: Newbie and Perl+Mail Questions

2003-07-06 Thread David Storrs
On Sat, Jul 05, 2003 at 05:28:41PM +, Pablo Fischer wrote: > Hi; > > > cd ~ > > mkdir -p perl5mod/Mail > > save Sendmail.pm to ~/perl5mod/Mail > > export PERL5LIB=/home/unmada/perl5mod > > > > You probably want to put that last line in your .profile so it gets > > reset every t

Re: testing an argument's type

2003-07-05 Thread David Storrs
On Sat, Jul 05, 2003 at 12:29:46PM -0400, Bob Showalter wrote: > David Storrs wrote: > > I've got a function that takes several arguments, the first of which > > should be a scalar (specifically, a string). I'd like to have a > > precondition to verify that the argu

Re: Newbie and Perl+Mail Questions

2003-07-05 Thread David Storrs
On Sat, Jul 05, 2003 at 12:25:47PM +, Pablo Fischer wrote: > > use Mail::Sendmail; > Load Module. Can I save it in my working dir? /home/unmada/MailP/? Sure. You need to make sure that it will appear on @INC (the module include path that Perl uses to find your modules). Probably the easie

Re: Newbie and Perl+Mail Questions

2003-07-05 Thread David Storrs
On Sat, Jul 05, 2003 at 12:43:10AM +, Pablo Fischer wrote: > Hi all! > > My name is Pablo Fischer and Im a little new in Perl, however I have a project > where I need to parse mails and send mails: > > I receive 2 files (contacts and arguments), I get 2000 mail adds from the > file, so I ne

Re: testing an argument's type

2003-07-05 Thread David Storrs
On Fri, Jul 04, 2003 at 06:03:55PM -0400, Casey West wrote: > It was Friday, July 04, 2003 when David Storrs took the soap box, saying: > : I've got a function that takes several arguments, the first of which > : should be a scalar (specifically, a string). I'd like to have a

Re: testing an argument's type

2003-07-05 Thread David Storrs
On Fri, Jul 04, 2003 at 06:02:21PM -0400, Steve Grazzini wrote: > On Fri, Jul 04, 2003 at 02:18:40PM -0700, David Storrs wrote: > > I've got a function that takes several arguments, the first of > > which should be a scalar (specifically, a string). I'd like to > >

testing an argument's type

2003-07-04 Thread David Storrs
I've got a function that takes several arguments, the first of which should be a scalar (specifically, a string). I'd like to have a precondition to verify that the argument is, in fact, a scalar. Is there a way to do that (preferably without using modules--I'm trying to write an entirely self-co

Re: How to check Array Uniqueness without Modul Array::unique

2003-07-01 Thread David Storrs
On Tue, Jul 01, 2003 at 01:18:46PM -0400, Robin Norwood wrote: > David Storrs <[EMAIL PROTECTED]> writes: > > keys_compare might be slightly better for small sets, but for large > sets, short_circuit is the way to go. > > I initialized my @array like so: > &g

Re: How to check Array Uniqueness without Modul Array::unique

2003-07-01 Thread David Storrs
On Tue, Jul 01, 2003 at 06:26:08AM +0200, Janek Schleicher wrote: > B. Fongo wrote at Mon, 30 Jun 2003 23:46:19 +0200: > > > Is there any other way to check array uniqueness except the Module > > Array::Unique? > > I'm having problems in installing these two Modules: Array::Unique and > > Tie. S

Re: context, printing, and concatenation

2003-06-25 Thread David Storrs
On Mon, Jun 23, 2003 at 11:13:00PM -0500, Peter wrote: > I'm on the first few chapters of "Learning Perl" and came up with a > question. Given: > > - > > @array = qw ( one two three ); > print @array . "\n"; > print @array; > >

Re: using FIle::Find::name if regex to filter

2003-06-24 Thread David Storrs
On Mon, Jun 23, 2003 at 09:14:25PM +0200, [EMAIL PROTECTED] wrote: > hi, how can i use a real regex with this: > > File::Find::name if -x? > > the filetestops are working fine, but how can i filter things like > .gz$? i tried many ways, but all failed. any idea? thanks!! > > bye andreas Andreas

Re: Rational Clearcase perl and Mail::Send

2003-06-19 Thread David Storrs
On Sat, Jun 14, 2003 at 11:59:55AM -0500, Wiggins d'Anconia wrote: > David Storrs wrote: > > Is anyone familiar with Mail::Send and, if so, do you have an answer > > to this? > > > > It appears Mail::Send just wraps Mail::Mailer, which states that in its >

Rational Clearcase perl and Mail::Send

2003-06-14 Thread David Storrs
At work, we have a dated copy of Rational Clearcase that shipped with Perl 5.001 (!). The distribution comes with a module, Mail::Send. Our data manager is trying to write a script that will parse the logs after the nightly build and mail the results to several addresses (one or more of which may

Re: Wanting to send email but have some bold or underlined text in message

2003-06-14 Thread David Storrs
On Fri, Jun 13, 2003 at 04:24:16PM -0700, Wagner, David --- Senior Programmer Analyst --- WGO wrote: > So used to just sending data and I was wondering if one can send bold or > underlined text, etc from straight email message or does it have to be in an > attachment? > > Using w2k

Re: Best way to return largest of 3 Vars?

2003-01-11 Thread David Storrs
On Fri, Jan 10, 2003 at 10:23:43AM -0600, Jensen Kenneth B SrA AFPC/DPDMPQ wrote: > In the line > my $max = (sort {$b<=>$a} ($x, $y, $z))[0]; > > What is the "[0]" doing? This part: (sort {$b<=>$a} ($x, $y, $z)) creates a list. The "[0]" returns the first element in that list. > Also an