Re: String question

2007-09-07 Thread Rodrick Brown
On 9/7/07, Santana <[EMAIL PROTECTED]> wrote: > Hei all, > i'am a newbie in PERL and i find a solution for this problem : > > I have a string "xxx" , i want put ones("1") on left of string, if > this string dont have a length of 20 character. > > Example : > > if i have th string "HELLO" and wo

Re: Test data generation using Perl Scripting.

2007-09-07 Thread Chas Owens
On 9/7/07, Satya <[EMAIL PROTECTED]> wrote: snip > If it is possible to do it using the perl or any other scripting > language, what would be the approach. snip It is possible; the approach is the same as in all languages: use random numbers to select/build strings that match your needs. For inst

RE: Test data generation using Perl Scripting.

2007-09-07 Thread Bob McConnell
How often will int rand 7 == 7? I think the max year will be 2006 in this case. Bob McConnell > -Original Message- > From: Chas Owens [mailto:[EMAIL PROTECTED] > Sent: Friday, September 07, 2007 9:57 AM > To: Beginner > Cc: beginners@perl.org > Subject: Re: Test data generation using Per

Re: Test data generation using Perl Scripting.

2007-09-07 Thread Chas Owens
On 9/7/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip > #FIXME: this creates invalid dates like 2007-02-30 > sub rand_date { > sprintf "%04d-%02d-%02d", > 2000 + int rand 7, > 1 + int rand 12, > 1 + int rand 31; > } snip Actually that sub can

Re: String question

2007-09-07 Thread Gunnar Hjalmarsson
Santana wrote: Hei all, i'am a newbie in PERL and i find a solution for this problem : I have a string "xxx" , i want put ones("1") on left of string, if this string dont have a length of 20 character. Example : if i have th string "HELLO" and woul like get this ; "111HELLO"

Re: String question

2007-09-07 Thread Xavier Noria
On Sep 7, 2007, at 10:07 AM, Santana wrote: Hei all, i'am a newbie in PERL and i find a solution for this problem : I have a string "xxx" , i want put ones("1") on left of string, if this string dont have a length of 20 character. Example : if i have th string "HELLO" and woul like get

Re: Regex to matching Parenthesis

2007-09-07 Thread Aruna Goke
John W. Krahn wrote: Aruna Goke wrote: Chris E. Rempola wrote: How would you match Parenthesis in Perl? - STRING - Received: from 10.143.205.68.abc.def.gh.com (10.205.143.238) - /STRING - I want to be able to grab the IP address in (10.205.143.238). Thanks in advance. #/usr/bin/perl use w

Re: Test data generation using Perl Scripting.

2007-09-07 Thread John W. Krahn
Chas Owens wrote: On 9/7/07, Beginner <[EMAIL PROTECTED]> wrote: On 7 Sep 2007 at 9:47, Chas Owens wrote: On 9/7/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip #FIXME: this creates invalid dates like 2007-02-30 sub rand_date { sprintf "%04d-%02d-%02d", 2000 + int rand

Test data generation using Perl Scripting.

2007-09-07 Thread Satya
HI I need to generate a flat file. I want to know if i can make use of perl or any other scripting language to automate it. My program reads flat file as input , does some validations based on defined rules and gives back the output as a flat file. The flat file is say CSV. The CSV in turn contai

Re: Off-topic (Re: Apache startup problem)

2007-09-07 Thread Tom Phoenix
On 9/7/07, Praveena Vittal <[EMAIL PROTECTED]> wrote: > ExecCGI is off in this directory: > /opt/SUNWTeleAlarm/www_live/cgi-bin/frontpage.cgi Have you considered turning it on? Have you tried consulting Apache folks? We're Perl folks, but you can easily find mailing lists, FAQs, and other resour

Re: Test data generation using Perl Scripting.

2007-09-07 Thread Chas Owens
On 9/7/07, Beginner <[EMAIL PROTECTED]> wrote: > On 7 Sep 2007 at 9:47, Chas Owens wrote: > > > On 9/7/07, Chas Owens <[EMAIL PROTECTED]> wrote: > > snip > > > #FIXME: this creates invalid dates like 2007-02-30 > > > sub rand_date { > > > sprintf "%04d-%02d-%02d", > > > 2000

Re: Which module use to launch program using perl in linux?

2007-09-07 Thread Chas Owens
On 9/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello guys, I'm a new leaner for perl. I wanted to ask you guys Which > module use to launch program using perl in linux? plz help me > asap.Thanks...; ) snip Depends on what you mean by launch. I believe you probably want either the s

Which module use to launch program using perl in linux?

2007-09-07 Thread khairul_annas
Hello guys, I'm a new leaner for perl. I wanted to ask you guys Which module use to launch program using perl in linux? plz help me asap.Thanks...; ) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

String question

2007-09-07 Thread Santana
Hei all, i'am a newbie in PERL and i find a solution for this problem : I have a string "xxx" , i want put ones("1") on left of string, if this string dont have a length of 20 character. Example : if i have th string "HELLO" and woul like get this ; "111HELLO" How i can this

Re: Off-topic (Re: Apache startup problem)

2007-09-07 Thread Praveena Vittal
Folks , thanks for ur suggestionI ran the script as root ,apache got started but it is throwing error as below when accessing the home page of the site [Fri Sep 7 10:38:25 2007] [error] [client 129.158.71.40] Options ExecCGI is off in this directory: /opt/SUNWTeleAlarm/www_live/cgi

Re: Generating flat file.

2007-09-07 Thread Tom Phoenix
On 9/6/07, Satya <[EMAIL PROTECTED]> wrote: > If it is possible to do it using the perl, what would be the approach. I recommend designing an algorithm, then writing Perl code to implement it. Perhaps a main loop should read the data, process it, and write it out to the new file. Have you written

Apache startup problem

2007-09-07 Thread Praveena Vittal
Hi All, This is not related to Perl .But I am using a Apache Webserver for my perl application. I have newly setting up web server with the virtual host listening in the port 3032(with SSL enabled).When starting the apache ,following error is displayed. *"permission denied make_sock: could

Re: Test data generation using Perl Scripting.

2007-09-07 Thread Beginner
On 7 Sep 2007 at 9:47, Chas Owens wrote: > On 9/7/07, Chas Owens <[EMAIL PROTECTED]> wrote: > snip > > #FIXME: this creates invalid dates like 2007-02-30 > > sub rand_date { > > sprintf "%04d-%02d-%02d", > > 2000 + int rand 7, > > 1 + int rand 12, > >

Re: Which module use to launch program using perl in linux?

2007-09-07 Thread John W. Krahn
Chas Owens wrote: On 9/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello guys, I'm a new leaner for perl. I wanted to ask you guys Which module use to launch program using perl in linux? plz help me asap.Thanks...; ) snip Depends on what you mean by launch. I believe you probably w

Re: Test data generation using Perl Scripting.

2007-09-07 Thread Chas Owens
On 9/7/07, Bob McConnell <[EMAIL PROTECTED]> wrote: > How often will int rand 7 == 7? I think the max year will be 2006 in > this case. > > Bob McConnell snip They will be equal roughly zero percent of time (they might actually be equal if there is a bug in the implementation of int, rand, or ==).

Generating flat file.

2007-09-07 Thread Satya
HI All, I need to generate a flat file. I want to know if i an make use of perl. My program reads flat file as input , does some validations based on defined rules and gives back the output as a flat file. The flat file is CSV. The CSV in turn contains large number of claims . Each claim will hav

Re: Regex to matching Parenthesis

2007-09-07 Thread John W. Krahn
Aruna Goke wrote: Chris E. Rempola wrote: How would you match Parenthesis in Perl? - STRING - Received: from 10.143.205.68.abc.def.gh.com (10.205.143.238) - /STRING - I want to be able to grab the IP address in (10.205.143.238). Thanks in advance. #/usr/bin/perl use warnings; use strict; #