Re: uppercase strings

2003-10-08 Thread simran
Looks like you are almost there... % perldoc -f ucfirst On Thu, 2003-10-09 at 13:41, Sara Gribble wrote: > I would appreciate some help with this. I am learning > Perl. I have a string inputed by the user. This string > is then split, every first letter of each word in the > string is uppercase

Re: uppercase strings

2003-10-08 Thread Jeff 'japhy' Pinyan
On Oct 8, Sara Gribble said: >I would appreciate some help with this. I am learning >Perl. I have a string inputed by the user. This string >is then split, every first letter of each word in the >string is uppercased, then joined back together and >printed. >my @words = split( / /, $firstline );

uppercase strings

2003-10-08 Thread Sara Gribble
I would appreciate some help with this. I am learning Perl. I have a string inputed by the user. This string is then split, every first letter of each word in the string is uppercased, then joined back together and printed. Here is my code, can anyone help? Thanks, Sara G. !/usr/bin/perl # Demons

Re: Handling Dates Suggestions

2003-10-08 Thread Tore Aursand
On Wed, 08 Oct 2003 17:56:03 -0700, perl wrote: > Can someone offers some recommendation into using dates? Take a look at CPAN [1] for Date-related modules. My personal favorite has become Time::Piece, although all the Date::* modules should be looked upon. [1] http://www.cpan.org/> -- Tore A

Re: Exponential numbers

2003-10-08 Thread John W. Krahn
Pedro Antonio Reche wrote: > > I have a table that has exponential numbers of the type 0.203E-2 and I > will like to reformat getting rid off the exponential so that the > previous number would look when printed as 0.00203. > Is there any easy way to do this? > Any help welcome. $ perl -le' $x =

Re: cat \u with a string

2003-10-08 Thread John W. Krahn
Brian Gruber wrote: > > Hello, Hello, > In the midst of learning perl, I was messing around with stuff, and I > found the following behavior to be a bit confusing. For some reason, > I seem to be unable to cat a \u or \l for that matter with another > string using the . operator. Other backsla

cat \u with a string

2003-10-08 Thread Brian Gruber
Hello, In the midst of learning perl, I was messing around with stuff, and I found the following behavior to be a bit confusing. For some reason, I seem to be unable to cat a \u or \l for that matter with another string using the . operator. Other backslash-escaped characters (tabs, newlines etc

Handling Dates Suggestions

2003-10-08 Thread perl
Can someone offers some recommendation into using dates? I will be referencing year, month,day,hour,min,sec. I will also need to increment or decrement by hours, days, months and years. thanks, -rkl - eMail solutions by http://www.swanmail.com -- To un

Re: What is hash randomization in 5.8.1?

2003-10-08 Thread Douglas Hunter
Kevin Old wrote: Hello everyone, I've seen several references on the Perl5 Porters mailing list about Perl 5.8.1's hash randomization. Can someone explain actually what it is, why I'd want to use it and how to use it? The most important bit of the documentation in is in perlsec: "Perl has never

Re: undefined subroutine

2003-10-08 Thread Dodo
I'm trying to convert so I can use a server that doesn't support PHP, but I'm giving up. With my limited knowledge I think it's impossible. I was told that the scripting was all Perl, so conversion should have been easy. But, I guess there's some C mixed in there as well or maybe some of it is PHP

Exponential numbers

2003-10-08 Thread Pedro Antonio Reche
Dear all, I have a table that has exponential numbers of the type 0.203E-2 and I will like to reformat getting rid off the exponential so that the previous number would look when printed as 0.00203. Is there any easy way to do this? Any help welcome. Regards, Pedro -- To unsubscribe, e-mail: [E

Re: undefined subroutine

2003-10-08 Thread Dodo
I'm trying to convert so I can use a server that doesn't support PHP, but I'm giving up. With my limited knowledge I think it's impossible. I was told that the scripting was all Perl, so conversion should have been easy. But, I guess there's some C mixed in there as well or maybe some of it is PHP

Re: Should loops return a value?

2003-10-08 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, R. Joseph Newton wrote: [...] > I'm not fond of this particular construct, but then, I'm not fond of grep, > either. I'd rather use something called get_all_matching(). Oh, you mean 'gam' ;-) -- Kevin Pfeiffer International University Bremen -- To unsubscribe,

Re: undefined subroutine

2003-10-08 Thread Rob Dixon
Jeff 'Japhy' Pinyan wrote: > > On Oct 8, Rob Dixon said: > > > >Jeff 'Japhy' Pinyan wrote: > >> > >> open BLAH, "< c:/Inetpub/wwwroot/dg/menu.txt" > >> or die "can't read c:/Inetpub/wwwroot/dg/menu.txt: $!"; > > > > my $fd; > > open $fd, '< c:/Inetpub/wwwroot/dg/menu.txt'; > > > >might be a

Adding nat to cisco

2003-10-08 Thread Dan Muey
Any one have any experience with adding nat statements to a cisco with Perl? I'm writing a script to do that from a db run by cron and using Net::Telnet::Cisco (which I have yet to install and experiement with) I just want to make sure I'm doing this right or if there's a better way or ??:

Re: What is hash randomization in 5.8.1?

2003-10-08 Thread Paul Johnson
On Wed, Oct 08, 2003 at 05:05:55PM -0400, Kevin Old wrote: > Hello everyone, > > I've seen several references on the Perl5 Porters mailing list about > Perl 5.8.1's hash randomization. Can someone explain actually what it > is, why I'd want to use it and how to use it? Perl has never guaranteed

What is hash randomization in 5.8.1?

2003-10-08 Thread Kevin Old
Hello everyone, I've seen several references on the Perl5 Porters mailing list about Perl 5.8.1's hash randomization. Can someone explain actually what it is, why I'd want to use it and how to use it? I've not seen it discussed on any of the major perl sites, just in the weekly perl5-porters sum

Re: undefined subroutine

2003-10-08 Thread Jeff 'japhy' Pinyan
On Oct 8, Rob Dixon said: >Jeff 'Japhy' Pinyan wrote: >> >> open BLAH, "< c:/Inetpub/wwwroot/dg/menu.txt" >> or die "can't read c:/Inetpub/wwwroot/dg/menu.txt: $!"; > > my $fd; > open $fd, '< c:/Inetpub/wwwroot/dg/menu.txt'; > >might be a better match? With $fd in place of 'BLAH' in the >r

Re: An extra space?

2003-10-08 Thread John W. Krahn
Michael Weber wrote: > > I am trying to write a mail filter that grabs the output of SpamAssassin > and drops any messages that score above a certain number of points. > > As I am writing it, I want to see exactly what the perl script is > getting and outputting. It's a pretty simple script now,

An extra space?

2003-10-08 Thread Michael Weber
I am trying to write a mail filter that grabs the output of SpamAssassin and drops any messages that score above a certain number of points. As I am writing it, I want to see exactly what the perl script is getting and outputting. It's a pretty simple script now, it does no filtering at all, yet.

Re: Microsoft Word Creation

2003-10-08 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: > > Quoting Rob Dixon <[EMAIL PROTECTED]>: > > > <[EMAIL PROTECTED]> wrote: > > > > Hi. > > > > A name would be nice...? > > > > All of the answers are in the module documentation. The code below shows > > a lot of the common requirements. Anything else you can fish from

Re: undefined subroutine

2003-10-08 Thread Rob Dixon
Jeff 'Japhy' Pinyan wrote: > > On Oct 8, Dodo said: > > >Undefined subroutine &main::fopen called at C:\Inetpub\wwwroot\dg\index.pl > >line 91. > >I get the same error for filesize, fclose, explode and include. > > That's because none of those are Perl functions. You need to look at some > Perl tu

RE: Inplace edit regex fun

2003-10-08 Thread Dan Muey
> qx interpolates variables. by the time $1 gets to perl, it's > already gone. > try: > > print qx(perl -pi -e 's/^$u:hello:([^:]*):/$u:goodbye:\$1/;' file); > That did it! Thanks a million for pointing that out! > why not simply: > > [panda]$ perl -pi -e > 's/^datax:hello:([^:]*):/datax:go

Re: if (-d .....

2003-10-08 Thread Tore Aursand
On Wed, 08 Oct 2003 12:39:40 +0200, Daniel Stellwagen wrote: > if (-d $file) > > What does it mean, and are there more Try 'perldoc -f -d'. -- Tore Aursand <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: mapping files

2003-10-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Byrne wrote: > Hello, > > I'm trying to map two files INPUT1 to INPUT2. I > believe that I've made a syntax error somewhere > because I'm not retrieving any ouput; yet I know that > there are IDs in INPUT2 (via $id2) that exist in > INPUT1 (via $id_1b). > > Also, is there a general, more e

mapping files

2003-10-08 Thread David Byrne
Hello, I'm trying to map two files INPUT1 to INPUT2. I believe that I've made a syntax error somewhere because I'm not retrieving any ouput; yet I know that there are IDs in INPUT2 (via $id2) that exist in INPUT1 (via $id_1b). Also, is there a general, more efficient, way to map files that conta

RE: Inplace edit regex fun

2003-10-08 Thread david
Dan Muey wrote: >> First, (.*) is very greedy. You might want to limit it in >> some way, possibly with a ? modifier like (.*?), possibly by >> looking for less than . such as ([^:]*) -- anything but a colon. >> >> Second, the backwack numbers \1 .. \9 are only for the >> matching portion of a s

RE: Inplace edit regex fun

2003-10-08 Thread Dan Muey
> First, (.*) is very greedy. You might want to limit it in > some way, possibly with a ? modifier like (.*?), possibly by > looking for less than . such as ([^:]*) -- anything but a colon. > > Second, the backwack numbers \1 .. \9 are only for the > matching portion of a subsitution. You mus

Re: undefined subroutine

2003-10-08 Thread Jeff 'japhy' Pinyan
On Oct 8, Dodo said: >Undefined subroutine &main::fopen called at C:\Inetpub\wwwroot\dg\index.pl >line 91. >I get the same error for filesize, fclose, explode and include. That's because none of those are Perl functions. You need to look at some Perl tutorial or beginner's manual so you know wha

Re: Inplace edit regex fun

2003-10-08 Thread Casey West
It was Wednesday, October 08, 2003 when Dan Muey took the soap box, saying: : Howdy list: : : Trying to do an inplace edit: : : perl -pi -e 's/whatever/newstuff/;' /file/path/here : : What I need to do is replace certain parts of the line for instance: : : : s/^$var:(.*):123:def/$var:\1:456:g

Inplace edit regex fun

2003-10-08 Thread Dan Muey
Howdy list: Trying to do an inplace edit: perl -pi -e 's/whatever/newstuff/;' /file/path/here What I need to do is replace certain parts of the line for instance: s/^$var:(.*):123:def/$var:\1:456:ghi/; Soo if a line matches the $var at the beginning a colon, some stuff, a colon, 123, a colo

undefined subroutine

2003-10-08 Thread Dodo
I'm doing a php to pl migration and having a little trouble. Help appreciated! Undefined subroutine &main::fopen called at C:\Inetpub\wwwroot\dg\index.pl line 91. I get the same error for filesize, fclose, explode and include. $fd = fopen('C:\Inetpub\wwwroot\dg\menu.txt',"r"); $line = fread($fd,f

Re: required help

2003-10-08 Thread James Edward Gray II
On Tuesday, October 7, 2003, at 11:17 PM, vaishali wrote: I am sending the email to the [EMAIL PROTECTED] and I am sending to you also as this is urgent. That's why myself and many others read the beginner's list, to fix you up as fast as possible. Using your previous help I can able to solv

Re: standard out returns "nothing", how do I print?

2003-10-08 Thread Jeff 'japhy' Pinyan
On Oct 8, Anthony J Segelhorst said: >@temparray = `"$lcf_tools\\ntprocinfo |$lcf_tools\\grep $process"`; Lose the double-quotes. You want `$lcf_tools\\ntprocinfo ...`. The double quotes are probably not helping. >foreach $temp (@temparray){ >($pid,$name) = split(" ", $

standard out returns "nothing", how do I print?

2003-10-08 Thread Anthony J Segelhorst
I have the following bit of code I have written: @temparray = `"$lcf_tools\\ntprocinfo |$lcf_tools\\grep $process"`; foreach $temp (@temparray){ ($pid,$name) = split(" ", $temp); print LOGFILE "The process named $name is running\n"; if ($name

Re: how to reuse sub

2003-10-08 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > I guess, you're the man! > > Your code works. I did not know of the Exporter. > > What happens if there are several package with the same name and exported? > > thanks, > rkl Then you have to prepend the name. For some reason the term is slipping my mind, but a sub dec

Re: Microsoft Word Creation

2003-10-08 Thread sc00170
This method would be perfect unless i had problem with the encoding. I want to write greek documents but i cannot. Quoting Rob Dixon <[EMAIL PROTECTED]>: > <[EMAIL PROTECTED]> wrote: > > > > Quoting Rob Dixon <[EMAIL PROTECTED]>: > > > > > John wrote: > > > > > > > > Rob Dixon wrote: > > > > >

Re: Best Token Char For Template

2003-10-08 Thread Paul Johnson
On Wed, Oct 08, 2003 at 02:44:11PM +0200, Jenda Krynicky wrote: > From: "Rob Dixon" <[EMAIL PROTECTED]> > > <[EMAIL PROTECTED]> wrote: > > > > > > 1 - What is the best char to use in a file template? > > > Also, please give me a good regex? > > > > > > I will have a formatted html page with som

Re: Best Token Char For Template

2003-10-08 Thread Jenda Krynicky
From: "Rob Dixon" <[EMAIL PROTECTED]> > Nobody else has mentioned this, but I think it's nice to have a name > to write to. '[EMAIL PROTECTED]' and 'rkl' don't do a lot for me! Agreed completely. > <[EMAIL PROTECTED]> wrote: > > > > 1 - What is the best char to use in a file template? > > Al

threads in perl

2003-10-08 Thread Igor Ryaboy
Hi, I need help in simple threaded solution. How can I join the active thread? After I was started the thread I want him to join itself at the end and go back to the main Example: # main program $thr1=new threads \&sub_name; $thr2=new threads \&sub_name; $thr3=new threads \&sub_name; $thr4=new t

RE: if (-d .....

2003-10-08 Thread Daniel Stellwagen
Thank you Stephan :-) > > This will return 'true' is $file contains the location of a > directory. More information can be found on this in the > 'perlfunc' manpage in the 'Alphabetical Listing of Perl > Functions' section. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

Re: Chopping off first&last character in a string

2003-10-08 Thread Rob Dixon
William Li wrote: > > Silly question, is there an equal but opposite function to chop in Perl? > I'd like to remove the first and last character of a string and am looking > for a simple way to do it. So far I have: > > # "1234567" -> "23456" > chop($string); # "123456" > $string = reverse($strin

RE: if (-d .....

2003-10-08 Thread Stephen Hardisty
> Hi EVERYBODY, Hi Dr Nick > > i saw this "-d" switch in an "if" statement. > > if (-d $file) > > What does it mean, and are there more > this kind of switches and where can I find information about them. This will return 'true' is $file contains the location of a directory. More informa

if (-d .....

2003-10-08 Thread Daniel Stellwagen
Hi EVERYBODY, i saw this "-d" switch in an "if" statement. if (-d $file) What does it mean, and are there more this kind of switches and where can I find information about them. Thanks d a n i e l -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Re: regex, is this possible?

2003-10-08 Thread Sudarshan Raghavan
Jerry Preston wrote: > Hi! > > I am trying to break down the following: > >printf("numsteps=%d i=%d im=%g vfr=%g \n",numsteps,i,imeas,vforce); > into >"numsteps= numsteps i=i im=imeas vfr=vforce \n" > >printf ("\noriginal cap = %g, offset = %g", *ci, cap_offset); > into >"\nor

RE: regex, is this possible?

2003-10-08 Thread Thomas Bätzler
Jerry Preston <[EMAIL PROTECTED]> asked: > I am trying to break down the following: > >printf("numsteps=%d i=%d im=%g vfr=%g > \n",numsteps,i,imeas,vforce); > into >"numsteps= numsteps i=i im=imeas vfr=vforce \n" > >printf ("\noriginal cap = %g, offset = %g", *ci, cap_offset); > in

Re: Best Token Char For Template

2003-10-08 Thread Rob Dixon
Hi. Nobody else has mentioned this, but I think it's nice to have a name to write to. '[EMAIL PROTECTED]' and 'rkl' don't do a lot for me! <[EMAIL PROTECTED]> wrote: > > 1 - What is the best char to use in a file template? > Also, please give me a good regex? > > I will have a formatted html

Re: Microsoft Word Creation

2003-10-08 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: > > Quoting Rob Dixon <[EMAIL PROTECTED]>: > > > John wrote: > > > > > > Rob Dixon wrote: > > > > > > > > John wrote: > > > > > > > > > > I want to create a doc file that will contain my text, > > > > > fonts, sizes as if i wrote manually. > > > > > > > > You can use Win3

regex, is this possible?

2003-10-08 Thread Jerry Preston
Hi! I am trying to break down the following: printf("numsteps=%d i=%d im=%g vfr=%g \n",numsteps,i,imeas,vforce); into "numsteps= numsteps i=i im=imeas vfr=vforce \n" printf ("\noriginal cap = %g, offset = %g", *ci, cap_offset); into "\noriginal cap = ci, offset = cap_offset"; I am

Re: how to reuse sub

2003-10-08 Thread perl
I guess, you're the man! Your code works. I did not know of the Exporter. What happens if there are several package with the same name and exported? thanks, rkl > [EMAIL PROTECTED] wrote: > >> > my $return = do_wrap('hello'); >> >> Doesn't this have to be MyCommon::do_wrap('hello'); ? > > No.

Re: Microsoft Word Creation

2003-10-08 Thread sc00170
Your solution is also amazing but where can i define the TrueType fonts for every single word? Or the size of them, color,... Quoting Rob Dixon <[EMAIL PROTECTED]>: > John wrote: > > > > Rob Dixon wrote: > > > > > > John wrote: > > > > > > > > I want to create a doc file that will contain my tex