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
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
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");
..
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
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
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
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
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--
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..
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.
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
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
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
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
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
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
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
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 ,
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
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
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
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
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
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
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
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
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
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
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
>
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
30 matches
Mail list logo