Dan wrote:
Hi everybody
I've been using DBI for a while now, having made some large programs
utilising a mysql db, and all have been successful. But I've come across one
project now that may be a little more taxing on my knowledge of DBI.
All the while I've been using DBI, I've been getting da
Hi everybody
I've been using DBI for a while now, having made some large programs
utilising a mysql db, and all have been successful. But I've come across one
project now that may be a little more taxing on my knowledge of DBI.
All the while I've been using DBI, I've been getting data by column
On 10/15/06, perl pra <[EMAIL PROTECTED]> wrote:
I have to call some perl scripts with command line arguements from another
perl script.
(some thing like this)
perl -s -a $ENV{X} -b $ENV{Y} -c $ENV{Z} ; ( -a , -b, -c are also the
arguments to call the script)
my @args = ('-a', $ENV{X},
Raphael Brunner wrote:
>
> On Mon, Oct 16, 2006 at 07:36:13PM +0800, Jeff Pang wrote:
>>
>> Raphael Brunner wrote:
>>>
>>> eg:
>>>
>>> use strict;
>>> my $var = 20;
>>>
>>> print "$var\n";
>>> &routine;
>>> exit;
>>>
>>>
>>> sub routine {
>>>print "$var\n";
>>> }
>>>
>>
>> Hi,you can do it by
>eg:
>
>use strict;
>my $var = 20;
>
>print "before: $var\n";
>&routine;
>print "after: $var\n";
>exit;
>
>
>sub routine {
> $var += 1;
>> >}
>
Hi,you don't need the global vars at all.The same way,you can write it like:
use strict;
my $var = 20;
print "before: $var\n";
$var = routine($va
* Raphael Brunner <[EMAIL PROTECTED]> [2006-10-16T08:38:00]
> But, my problem is, i must see this variable after the call of the sub.
> I'm sorry for the first example, it was inaccurate. But this is ok (I
> think) :) (because I have a lot of variables, which I must change in the
> sub, I want to d
Thanks for your answer!
But, my problem is, i must see this variable after the call of the sub.
I'm sorry for the first example, it was inaccurate. But this is ok (I
think) :) (because I have a lot of variables, which I must change in the
sub, I want to define they as "global" inside my parent-rou
--- Jeff Pang <[EMAIL PROTECTED]> wrote:
> Hi,you can do it by passing the vars to the subroutine like:
>
> my $var = 20;
> &routine($var);
>
> sub routine {
> my $var = shift;
> print $var;
> }
>
I'll second this recommendation because it makes the subroutines more
flexible (what if th
>
>eg:
>
>use strict;
>my $var = 20;
>
>print "$var\n";
>&routine;
>exit;
>
>
>sub routine {
> print "$var\n";
>}
>
Hi,you can do it by passing the vars to the subroutine like:
my $var = 20;
&routine($var);
sub routine {
my $var = shift;
print $var;
}
--
Books below translated by
Dear Users
is there a possibility to use "use strict" and to define variables in
the programm, which are also seen in the subroutines called from this
block? I want the same value in the var in the subroutine like before,
but without it to define as global. What could I do?
Thanks for all ideas a
perl pra wrote:
hi All,
I have to call some perl scripts with command line arguements from another
perl script.
(some thing like this)
perl -s -a $ENV{X} -b $ENV{Y} -c $ENV{Z} ; ( -a , -b, -c are also the
arguments to call the script)
( the $ENV{x}=C:\xyz\abc,$ENV{Y}=abc,$ENV{Z}=5).
hi All,
I have to call some perl scripts with command line arguements from another
perl script.
(some thing like this)
perl -s -a $ENV{X} -b $ENV{Y} -c $ENV{Z} ; ( -a , -b, -c are also the
arguments to call the script)
( the $ENV{x}=C:\xyz\abc,$ENV{Y}=abc,$ENV{Z}=5).
I understand we
12 matches
Mail list logo