Re: case statement in perl

2012-08-01 Thread Paul.G
I have removed the switch funtion from the script. From: Uri Guttman To: beginners@perl.org Sent: Thursday, 2 August 2012 2:02 AM Subject: Re: case statement in perl On 08/01/2012 03:08 AM, Paul.G wrote: > The example below is just a test, I need to be able t

Re: updating variable in Parent using Parallel::ForkManager

2012-08-01 Thread Dr.Ruud
On 2012-07-30 15:47, punit jain wrote: my $pm = new Parallel::ForkManager(10); my $count=0; foreach my $user (@users) { $pm->start($user) and next; my $result; --- do some processing --- $pm->finish(0, \$result); } $pm->wa

Re: case statement in perl

2012-08-01 Thread Chris Nehren
On Wed, Aug 01, 2012 at 14:38:42 -0500 , Hal Wigoda wrote: > so why don't they get rid of it? I'm not sure which "it" you're referring to: Switch.pm or given/when. For better or worse, Perl has a strong culture of backwards compatibility. Perl is one of the few languages where you can use code wr

Re: case statement in perl

2012-08-01 Thread Hal Wigoda
so why don't they get rid of it? On Wed, Aug 1, 2012 at 2:33 PM, Chris Nehren wrote: > On Wed, Aug 01, 2012 at 12:02:04 -0400 , Uri Guttman wrote: >> On 08/01/2012 03:08 AM, Paul.G wrote: >> >The example below is just a test, I need to be able to insert >> >multiple values a command, those value

Re: case statement in perl

2012-08-01 Thread Chris Nehren
On Wed, Aug 01, 2012 at 12:02:04 -0400 , Uri Guttman wrote: > On 08/01/2012 03:08 AM, Paul.G wrote: > >The example below is just a test, I need to be able to insert > >multiple values into a command, those values can be either 1, 2 or > >upto 5. > > > > > you aren't getting the issue. the switch mo

RE: Cannot connect to Oracle db; script will not run

2012-08-01 Thread John Scoles
have a look at http://search.cpan.org/~pythian/DBD-Oracle-1.46/lib/DBD/Oracle/Troubleshooting.pm it should answer most of your questions > From: james.war...@acxiom.com > To: beginners@perl.org; dbi-us...@perl.org > CC: newbie01.p...@gmail.com; rob.di..

Re: Unexpected token error when providing a regular expression as input

2012-08-01 Thread Robert Wohlfarth
On Tue, Jul 31, 2012 at 12:54 AM, moijes12 wrote: > When I execute this program from the command line by running "./ > grep.pl (.es.){3} /usr/share/dict/words" , I get the error > bash: syntax error near unexpected token `.es.' > > But, if execute it as "./grep.pl \(.es.\){3} /usr/share/dict/

Re: case statement in perl

2012-08-01 Thread Uri Guttman
On 08/01/2012 03:08 AM, Paul.G wrote: The example below is just a test, I need to be able to insert multiple values into a command, those values can be either 1, 2 or upto 5. you aren't getting the issue. the switch module was a major mistake and no one should be using it. you have to underst

Re: Script to test connecting to Oracle DBs

2012-08-01 Thread Leo Susanto
use strict; use DBI; use DBD::Oracle qw(:ora_types); my $user = ''; my $passwd = ''; my $tnsName = ''; $ENV{'ORACLE_HOME'} = 'C:\oracle\product\10.2.0\client_1'; my $dbh = DBI->connect("dbi:Oracle:$tnsName", $user, $passwd); my $SQL = qq{ SELECT XXX}; my $sth0 = $dbh->prepare($SQL); print "SQL

Unexpected token error when providing a regular expression as input

2012-08-01 Thread moijes12
Hi My program takes is supposed to take regular expression and a file containing a list of words/lines as input and print all those lines that match the regular expression. Below is the program #!/usr/bin/perl use strict; use warnings; sub grep_file { my $pattern = shift; my @file_name

RE: Script to test connecting to Oracle DBs

2012-08-01 Thread Martin Gainty
#!/bin/sh C:/grep/grep.exe -S "(SERVICE_NAME =" tnsnames.ora > service.ora rm -r new.ora echo "#!/bin/sh" > tns_ping.sh C:/cygwin/bin/sed.exe 's/(SERVICE_NAME \=/tnsping.exe /' service.ora>>tns_ping.sh vi tns_ping.sh If you find There is a way to pipe the 2 commands let me know but for now this

Re: Catalyst model problem- "WARNING: No tables found, did you forget to specify db_schema?"

2012-08-01 Thread Guruprasad Kulkarni
Hi Guys, I found out the issue here:) Apparently, there is a note towards the end of the doc: *NOTE:* Be sure you run the script/myapp_server.pl command from the 'base' directory of your application, not inside the script directory itself or it will not be able to locate the myapp.db database f

Catalyst model problem- "WARNING: No tables found, did you forget to specify db_schema?"

2012-08-01 Thread Guruprasad Kulkarni
Hi All, I am trying to learn Catalyst framework, by following the introduction modules available on CPAN. I am doing this on strawberry perl, on my PC. Also, I am using SQLite and have created myapp.db. While trying to create a model, I get the below error: \strawberry\perl\bin\MyApp\script>myap

Re: case statement in perl

2012-08-01 Thread John W. Krahn
Paul.G wrote: The example below is just a test, I need to be able to insert multiple values into a command, those values can be either 1, 2 or upto 5. Below is closer to the working example, but I will read that document and to help make a final decision. # Check Free PV's operation_CHECKFREE

Re: case statement in perl

2012-08-01 Thread Rob Coops
On Wed, Aug 1, 2012 at 9:08 AM, Paul.G wrote: > The example below is just a test, I need to be able to insert multiple > values into a command, those values can be either 1, 2 or upto 5. > > Below is closer to the working example, but I will read that document and > to help make a final decision.

Re: case statement in perl

2012-08-01 Thread Paul.G
The example below is just a test, I need to be able to insert multiple values into a command, those values can be either 1, 2 or upto 5. Below is closer to the working example, but I will read that document and to help make a final decision. # Check Free PV's operation_CHECKFREEPVS(); $NEWMIRR