PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: passing $dbh around
Date: Jun 10 1999 11:07PM

David Hajoglou writes:
 > This gave interesting results:
 > 
 > the output:
 > 
 > dbh is -1-
 > Can't call method "nsql" without a package or object reference at



 > 
 > sub test {
 >         my $dbh = @_;

You are taking an array in scalar context (which returns the number of 
elements.)

You want

	my ($dbh) = @_;     # array assignment
or
	my $dbh = shift;
or
	my $dbh = $_[0];

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com