the best way to include file in perl

------_=_NextPart_001_01C312FB.614A0CC0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi All,
I wrote a perl program to query number of employee with salary greater
than specified value. I save it as query_emp.pl
Now I am writing another perl program that need value from query_emp.pl,
so I put this code:
=20
$q=3D`query_emp.pl iman iman 3500`; #query number of employee with =
salary
> 3500, login in db with user=3Diman, passwd=3Diman
=20
Is it the best way to do it? or do we have a way to include file in
perl?=20
=20
btw, I put query_emp.pl code below. Can anybody take a look and advise
whether this code is efficient enough?
=20
Thanks a lot,
--------------
#!/usr/local/bin/perl
=20
use DBI;
$PROJECT=3D'ACC';
$uwi=3D$ARGV[0];
$dbuser=3D$ARGV[1];
$dbpasswd=3D$ARGV[2];
$salary=3D$ARGV[3];
$dbname =3D 'dbi:Oracle:'.$ENV{TWO_TASK};
$dbh =3D DBI->connect($dbname, $dbuser, $dbpasswd);=20
$sql_count_number_of_emp_with_salary_greater_than_specified_value=3D"SELE=
C
T COUNT(emp_name) FROM $PROJECT.EMP_DATA where salary >'$salary'";
=20
@sth=3D$dbh->selectrow_array($sql_count_number_of_emp_with_salary_greater=
_
than_specified_value);
print "$sth[0]\n";=20
=20
$dbh -> disconnect;
--------------
=20
Iman F Firdaus
=20
=20

------_=_NextPart_001_01C312FB.614A0CC0--
0
iffirdaus
5/5/2003 11:42:17 AM
perl.beginners 29368 articles. 3 followers. Follow

0 Replies
302 Views

Similar Articles

[PageSpeed] 3

Reply: