Re[2]: Titlecase

2003-01-12 Thread Irina Volkova
Stefan Lidman <[EMAIL PROTECTED]> wrote: > > David Gerler wrote: > > > > Hi, > > I have a line of text that is all uppercase and I need to change it > > to titlecase. i.e. "THIS IS THE LINE" needs to become "This Is The > > Line". I can make it all lower case using tr///. I have researche

Re[2]: build an array from a pattern match?

2003-01-12 Thread Irina Volkova
"Michael Kelly" <[EMAIL PROTECTED]> wrote > On Sat, Jan 11, 2003 at 02:00:58PM -0800, John W. Krahn wrote: > > Rob Dixon wrote: > > > "Michael Kelly" <[EMAIL PROTECTED]> wrote > > > > # print out all the captured numbers > > > > map{ print "$_\n"; } @numbers; > > > > > > Hi Michael. > > > > > > M

Re[2]: possible improvement(s)

2003-01-12 Thread Yacketta, Ronald
Hello Jenda, JK> Why don't you open the file directly? JK> open ($LOG,"$g_logdir/OrderServer-*.log") JK> or die ( "Unable to open $g_logdir/OrderServer-*.log : $!"); JK> or am I misunderstanding something? I will give that a whirl in the AM, could have sworn I tried tha

RE: String Stripping?

2003-01-12 Thread Toby Stuart
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 13, 2003 1:25 PM > To: [EMAIL PROTECTED] > Subject: String Stripping? > > > Hello all, > >I need to strip some HTML tags from a stringHowever, > the complete tags are not consis

String Stripping?

2003-01-12 Thread [EMAIL PROTECTED]
Hello all, I need to strip some HTML tags from a stringHowever, the complete tags are not consistent, so I would like to remove all the text between certain strings I specify.regardless of what is between them! For example: I would like to remove all the text starting with

Re: possible improvement(s)

2003-01-12 Thread John W. Krahn
Jenda Krynicky wrote: > > From: "Yacketta, Ronald" <[EMAIL PROTECTED]> > > I am sure someone out their in Perl land can offer a better solution > > to the following. > > > > ### > > ### slurp in all the required data for the report > > ### > > open ($LOG,"cat $g

Re: Removing strings

2003-01-12 Thread John W. Krahn
Dan wrote: > > "John W. Krahn" <[EMAIL PROTECTED]> wrote in message > > > > You need to use the \b word boundary zero-width assertion. > > > > $variable =~ s/\b\Q$remove\E\b//g; > > Moving on, same subject/problem, but slightly different scenario.. > In my next variable $variable2, i have entries

RE: Printing Output To Screen.

2003-01-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Korthrun wrote: > I have written a program in perl that collects some data and prints > it to the screen based on parameters that are given on the command > line (gee original idea for perl eh). Most of the time there are more > lines in the file being printed than there are on my display. I would

Re: Removing strings

2003-01-12 Thread dan
Moving on, same subject/problem, but slightly different scenario.. In my next variable $variable2, i have entries: $variable2 = "#ha #bad #cod #ba #dog"; Basically, i want to be able to remove #ba, without removing #ba from #bad, so it ends up: $variable2 = "#ha #bad #cod #dog"; This also needs

Printing Output To Screen.

2003-01-12 Thread Korthrun
I have written a program in perl that collects some data and prints it to the screen based on parameters that are given on the command line (gee original idea for perl eh). Most of the time there are more lines in the file being printed than there are on my display. I would like to get it to prin

Re: Removing a specific value from a hash whose keys contains multiple values

2003-01-12 Thread Dave K
Sophia, et al > If you know in advance the array index then use splice. If you know only the value you want to remove (and you like map...): #/usr/bin/perl -w use strict; my %compilers = ( system1 => ['compiler_a'], system2 => ['compiler_b', 'compiler_c','compiler_d'], system3 => ['compiler_e'],

Re: Best way to return largest of 3 Vars?

2003-01-12 Thread Tim Musson
Hey Jenda, My MUA believes you used Pegasus Mail for Windows (v4.02a) to write the following on Sunday, January 12, 2003 at 2:08:13 PM. JK> Which one would you rather do? :-) Looking back through the thread, I think we are both arguing that the one to use is... my $max = (sort {$b<=>$a

Re: Remove some, not all \n from a text block

2003-01-12 Thread Rob Dixon
"Alan C." <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Rob Dixon wrote: > > "Alan C." <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > >>Rob Dixon wrote: > >> > >>>my $last = undef; > >>> > >>>while (<>) > >>

Re: Titlecase

2003-01-12 Thread Rob Dixon
perldoc -q capitalize /R "David Gerler" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > I have a line of text that is all uppercase and I need to change it > to titlecase. i.e. "THIS IS THE LINE" needs to become "This Is The > Line". I can make it al

Re: Titlecase

2003-01-12 Thread Stefan Lidman
David Gerler wrote: > > Hi, > I have a line of text that is all uppercase and I need to change it > to titlecase. i.e. "THIS IS THE LINE" needs to become "This Is The > Line". I can make it all lower case using tr///. I have researched in > my books and found that and the \u to for making

Problem Installing NMS FormMail

2003-01-12 Thread Mike Butler
I'm trying to install the NMS FormMail program on a clients web site. I think that I have done everything correctly but when I test the script I get the following error message: Application Error An error has occurred in the program close sendmail pipe failed, mailprog=[/usr/sbin/sendmail -oi -

slice indexing

2003-01-12 Thread Bryan Harris
I need to slice an array such that it gives me the first through the 4th to last in a variable length array. I thought I could just do: @comments[0..-4] but Perl seems to choke on this. It's perfectly okay with a slice using two negative #s: @comments[-2..-4] Anyone know why it doesn't l

Titlecase

2003-01-12 Thread David Gerler
Hi, I have a line of text that is all uppercase and I need to change it to titlecase. i.e. "THIS IS THE LINE" needs to become "This Is The Line". I can make it all lower case using tr///. I have researched in my books and found that and the \u to for making the next character titlecase but

Re: possible improvement(s)

2003-01-12 Thread Jenda Krynicky
From: "Yacketta, Ronald" <[EMAIL PROTECTED]> > I am sure someone out their in Perl land can offer a better solution > to the following. > > ### > ### slurp in all the required data for the report > ### > open ($LOG,"cat $g_logdir/OrderServer-*.

Re: ppm: No suitable installation target for package G

2003-01-12 Thread Jenda Krynicky
From: "David Eason" <[EMAIL PROTECTED]> > What does the error "No suitable installation target for package ..." > mean? I am using ppm 3.0.1 from perl 5.8.0 build 802. It means that PPM did not find the right version of the module for your version of Perl. > ppm> describe G Sorry I forgot to up

Re: build an array from a pattern match?

2003-01-12 Thread Michael Kelly
On Sat, Jan 11, 2003 at 02:00:58PM -0800, John W. Krahn wrote: > Rob Dixon wrote: > > "Michael Kelly" <[EMAIL PROTECTED]> wrote > > > # print out all the captured numbers > > > map{ print "$_\n"; } @numbers; > > > > Hi Michael. > > > > May I warn against using 'map' in a void context like this? I

Re: Remove some, not all \n from a text block

2003-01-12 Thread Alan C.
Rob Dixon wrote: "Alan C." <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Rob Dixon wrote: my $last = undef; while (<>) { next unless defined $last; chomp $last unless /^\./; print $last; } continue { $last = $_; }

Re: No suitable installation target for package G

2003-01-12 Thread Bob X
"David Eason" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > What does the error "No suitable installation target for package ..." mean? > I am using ppm 3.0.1 from perl 5.8.0 build 802. > > ppm> describe G > > Name: G > Version: 4.1 >

Re: Removing strings

2003-01-12 Thread dan
Excellent, worked! Cheers Dan "John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dan wrote: > > > > Hey, I have a slight dilemma which i'm struggling to overcome. Wondering if > > anyone has any ideas on this.. > > > > I have a variable, for examp

Re: hash of arrays

2003-01-12 Thread John W. Krahn
Nicole Seitz wrote: > > hi there! Hello, > I've got a problem with a complex data structure and hope you can help me. > > I know that I can't have a hash whose values are arrays. So I tried to > build a hash of references to arrays. > > I guess I've made some mistakes . > > This is what my

Re: Removing strings

2003-01-12 Thread John W. Krahn
Dan wrote: > > Hey, I have a slight dilemma which i'm struggling to overcome. Wondering if > anyone has any ideas on this.. > > I have a variable, for example's sake, say $variable. $variable has a load > of entries. > > $variable = "danneh blah dan etc danster"; > > What i want to do, without

Re: hash of arrays

2003-01-12 Thread Rob Dixon
Hi Nicole "Nicole Seitz" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi there! > > I've got a problem with a complex data structure and hope you can help me. > > I know that I can't have a hash whose values are arrays. So I tried to > build a hash of refer

Re: tail + count

2003-01-12 Thread Mark Goland
> if (!$ARGV[0]){ > die("you've forgotten to enter the file name\n"); > } > if (!$ARGV[1]) { > $n = 9; # output 10 rows by default > } > else { > $n = $ARGV[1]-1; > } what if the user enters, "script.pl 8 " ??? This wil try to open a file 8 and dump last 9 lines of it. if(

Removing strings

2003-01-12 Thread dan
Hey, I have a slight dilemma which i'm struggling to overcome. Wondering if anyone has any ideas on this.. I have a variable, for example's sake, say $variable. $variable has a load of entries. $variable = "danneh blah dan etc danster"; What i want to do, without having to set the entire string

Re: slice indexing

2003-01-12 Thread Rob Dixon
"Rob Dixon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > Hi Bryan > > "Bryan Harris" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > I need to slice an array such that it gives me the first through the 4th > to > > last in a variable

RE: hash of arrays

2003-01-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Nicole Seitz wrote: > hi there! > > I've got a problem with a complex data structure and hope you can > help me. > > I know that I can't have a hash whose values are arrays. So I tried > to build a hash of references to arrays. > > I guess I've made some mistakes . > > This is what my hash

hash of arrays

2003-01-12 Thread Nicole Seitz
hi there! I've got a problem with a complex data structure and hope you can help me. I know that I can't have a hash whose values are arrays. So I tried to build a hash of references to arrays. I guess I've made some mistakes . This is what my hash looks like: %myHash = (); # lots of code

Re: slice indexing

2003-01-12 Thread John W. Krahn
Bryan Harris wrote: > > I need to slice an array such that it gives me the first through the 4th to > last in a variable length array. I thought I could just do: > > @comments[0..-4] > > but Perl seems to choke on this. It's perfectly okay with a slice using two > negative #s: > > @commen

slice indexing

2003-01-12 Thread Bryan Harris
I need to slice an array such that it gives me the first through the 4th to last in a variable length array. I thought I could just do: @comments[0..-4] but Perl seems to choke on this. It's perfectly okay with a slice using two negative #s: @comments[-2..-4] Anyone know why it doesn't l