Re: Passing a variable to a package function vs. a local function

2003-09-29 Thread Steve Grazzini
On Sun, Sep 28, 2003 at 11:48:19PM -0700, Dan Fish wrote: > sub myfunc{ my ($query) = @_; > $foo=$query->param("foo"); > ...more...blah...blah... > } > > Everything works fine as is, but I'm trying to take the function "myfunc" > out and put it in a separate .pm file because I need to call it fro

Re: Passing a variable to a package function vs. a local function

2003-09-29 Thread Ramprasad A Padmanabhan
Dan Fish wrote: I'm a bit new to this so please bear with me... I've written a script that uses CGI.pm something like this: use CGI::Carp qw(fatalsToBrowser); use CGI qw(:all); $query = new CGI; blah...blah... &myfunc($query); blah...blah... sub myfunc{ my ($query) = @_; $foo=$query->par

Passing a variable to a package function vs. a local function

2003-09-28 Thread Dan Fish
I'm a bit new to this so please bear with me... I've written a script that uses CGI.pm something like this: use CGI::Carp qw(fatalsToBrowser); use CGI qw(:all); $query = new CGI; blah...blah... &myfunc($query); blah...blah... sub myfunc{ my ($query) = @_; $foo=$query->param("foo"); ..

Re: passing a variable to a module

2002-10-15 Thread Jason Tiller
Hi, Jeff, :) On 15 Oct 2002, jeff wrote: > Quick question. I want to pass a variable to a non-oo module that I > created. But I how do I get the module to contain the value of the > variable that was created in the 'main' namespace. In general, this is not good style. A module should be a self

Passing a variable to a sub (WAS: passing a variable to a module)

2002-10-15 Thread Timothy Johnson
This is really more of a question of how to pass a variable to a sub. First off, check out perldoc perlsub. To avoid problems like this, 'use strict' whenever possible at the top of your scripts. Anyway, here's how to fix this: Passing a variable to a sub: All variables pas

Re: passing a variable to a module

2002-10-15 Thread James Edward Gray II
On Tuesday, October 15, 2002, at 06:29 PM, jeff wrote: > > Quick question. I want to pass a variable to a non-oo module that I > created. But I how do I get the module to contain the value of the > variable that was created in the 'main' namespace. I think there is > something easy that I am not

passing a variable to a module

2002-10-15 Thread jeff
Quick question. I want to pass a variable to a non-oo module that I created. But I how do I get the module to contain the value of the variable that was created in the 'main' namespace. I think there is something easy that I am not understanding. Example code below. PROGRAM BEGIN #!/usr/bin/perl

RE: Problem reading a file and passing a variable

2002-05-31 Thread Chas Owens
a > WHERE sr_num = ?"); > > $get_case_text->execute($sr_num) || $dbh->errstr; > ($sr_num,$sr_title,$sr_stat_id) = $get_case_text->fetchrow_array(); > $get_case_text->finish; > } > ETC... > -Original Message--

RE: Problem reading a file and passing a variable

2002-05-30 Thread Lance Prais
sr_stst_id FROM s_srv_req a WHERE sr_num = ?"); $get_case_text->execute($sr_num) || $dbh->errstr; ($sr_num,$sr_title,$sr_stat_id) = $get_case_text->fetchrow_array(); $get_case_text->finish; } ETC..

RE: Problem reading a file and passing a variable

2002-05-30 Thread Chas Owens
On Thu, 2002-05-30 at 14:29, Lance Prais wrote: > Janek, > I tried that originally with the same results. I am perplexed to why this > is happening, anyone have any ideas? > > > Thanks > Lance > Try this. I have no idea why it would work and the other wouldn't, but it is worth a try.

RE: Problem reading a file and passing a variable

2002-05-30 Thread Lance Prais
reading a file and passing a variable Lance Prais wrote at Thu, 30 May 2002 01:47:34 +0200: Perhaps you missed to chomp th $ln. So $ln = "1-294613112\n" what is perhaps not what you wanted. > This is the most bizarre thing I have ever seen. I am using the following code: There is &g

RE: Problem reading a file and passing a variable

2002-05-30 Thread Janek Schleicher
Lance Prais wrote at Thu, 30 May 2002 01:47:34 +0200: Perhaps you missed to chomp th $ln. So $ln = "1-294613112\n" what is perhaps not what you wanted. > This is the most bizarre thing I have ever seen. I am using the following code: >There is > absolutely no reason why this should not return

RE: Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
inish; print "--> SR(bulk): $case->{sr_num}\n"; print "--> User Id(name): $case->{sr_title}\n"; $line++; } close(BULK); $dbh->disconnect; -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED]] Sent: We

RE: Problem reading a file and passing a variable

2002-05-29 Thread Chas Owens
t; Thanks > Lance > > -Original Message- > From: Chas Owens [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 29, 2002 4:11 PM > To: Lance Prais > Cc: Perl > Subject: RE: Problem reading a file and passing a variable > > On Wed, 2002-05-29 at 17:05, Lance Pra

RE: Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
Wednesday, May 29, 2002 4:11 PM To: Lance Prais Cc: Perl Subject: RE: Problem reading a file and passing a variable On Wed, 2002-05-29 at 17:05, Lance Prais wrote: > [Chas], > Thank you, you made me realize the value of indention like never before. > In the past I used the "=?&quo

RE: Problem reading a file and passing a variable

2002-05-29 Thread Chas Owens
On Wed, 2002-05-29 at 17:05, Lance Prais wrote: > [Chas], > Thank you, you made me realize the value of indention like never before. > In the past I used the "=?" to return results form the query but in this > case when I used in and run this script it does not error out but instead > the query

Re: Problem reading a file and passing a variable

2002-05-29 Thread Chas Owens
On Wed, 2002-05-29 at 16:13, Lance Prais wrote: > I am m using the following code to read from a .txt file. I am running into > a problem that I am not sure why it is happening. > The problem is when I run this script the SQL is not reading the variable. > I am testing to make sure the .txt file

Re: Problem reading a file and passing a variable

2002-05-29 Thread Felix Geerinckx
on Wed, 29 May 2002 20:13:13 GMT, Lance Prais wrote: There is no need to post your message three times in less than 10 minutes. > while( my $ln = ) > { > chomp($ln); > #use the items of the > my $get_case_text = $dbh->prepare("SELECT a.sr_num ,b.name ,b.loc > ,a.sr_title,f.mid_name ,

Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
I am m using the following code to read from a .txt file. I am running into a problem that I am not sure why it is happening. The problem is when I run this script the SQL is not reading the variable. I am testing to make sure the .txt file contains data and it does. I get the following error: D

Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
I am m using the following code to read from a .txt file. I am running into a problem that I am not sure why it is happening. The problem is when I run this script the SQL is not reading the variable. I am testing to make sure the .txt file contains data and it does. I get the following error: D

Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
I am m using the following code to read from a .txt file. I am running into a problem that I am not sure why it is happening. The problem is when I run this script the SQL is not reading the variable. I am testing to make sure the .txt file contains data and it does. I get the following error: D

Re: Passing a variable.

2002-05-23 Thread John W. Krahn
Melissa Cama wrote: > > Hi, Hello, > I need to pass the value of a variable to another sub. Is this possible? sub times4 { my ($number) = @_; return $number * 4; } print times4( 5 ), "\n"; For all the details see: perldoc perlsub John -- use Perl; program fulfillment -- To

Passing a variable.

2002-05-23 Thread Melissa.Cama
Hi, I need to pass the value of a variable to another sub. Is this possible? Thanks Melissa -- This message and any attachment is confidential and may be privileged or otherwise protected from disclosure. If you have

RE: Passing a variable to a DOS batch file

2002-04-22 Thread José Nyimi
Hm ... Do you have some link(s) to cmd.exe shell documentations ? (even advanced !) José. [EMAIL PROTECTED] a écrit : On 21 April 2002 01:07, Paul Lombardo [mailto:[EMAIL PROTECTED]] wrote: > > I am new to this group and coming back to perl after a year > long hiatus. > > I am using perl o

RE: Passing a variable to a DOS batch file

2002-04-22 Thread Richard_Cox
On 21 April 2002 01:07, Paul Lombardo [mailto:[EMAIL PROTECTED]] wrote: > > I am new to this group and coming back to perl after a year > long hiatus. > > I am using perl on an NT4 server and > > I have a batch file that calls a perl script. (this works flawlessly) > > The perl script does s

Re: Passing a variable to a DOS batch file

2002-04-21 Thread Elias Assmann
On Sun, 21 Apr 2002, Michael Lamertz wrote: > On Sun, Apr 21, 2002 at 01:45:27PM +0200, Elias Assmann wrote: > > > If the Perl script is the last thing the batch file executes, I don't > > really see a problem, since you could just let the Perl script emit > > the error/success message. That migh

Re: Passing a variable to a DOS batch file

2002-04-21 Thread Michael Lamertz
On Sun, Apr 21, 2002 at 01:45:27PM +0200, Elias Assmann wrote: > If the Perl script is the last thing the batch file executes, I don't > really see a problem, since you could just let the Perl script emit > the error/success message. That might leave you with the problem of > exiting the batch sc

Re: Passing a variable to a DOS batch file

2002-04-21 Thread Elias Assmann
On Sun, 21 Apr 2002, Michael Lamertz wrote: > On Sat, Apr 20, 2002 at 08:07:09PM -0400, Paul Lombardo wrote: > > I need to do the following: > > > > if the perl script fails I need to pass a variable to the batch file so it > > can exit with a proper failure message > > when the perl script succe

Re: Passing a variable to a DOS batch file

2002-04-21 Thread Michael Lamertz
On Sat, Apr 20, 2002 at 08:07:09PM -0400, Paul Lombardo wrote: > > I need to do the following: > > if the perl script fails I need to pass a variable to the batch file so it > can exit with a proper failure message > when the perl script succeeds I need to pass a variable to the batch file >

Passing a variable to a DOS batch file

2002-04-20 Thread Paul Lombardo
Hi All - I am new to this group and coming back to perl after a year long hiatus. I am using perl on an NT4 server and I have a batch file that calls a perl script. (this works flawlessly) The perl script does some tasks (this also works as planned) The batch script exits (works well) I nee