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: mpeppler at itf1 dot itf dot ch (Michael Peppler)
Subject: Re: Beginners Question
Date: Mar 15 1996 1:19PM

> From: Steve Chowles 
>
> 1. I have seen the statement 'my $self = shift',  what does the 'my' do?

'my' creates a localized variable in the current block:

sub foo {
   my $var = 1;
   
   {
      my $var = 2;   # This is not the same as above...
      ...
   }
   print "$var\n";   # prints '1'
}
     
> 2. What is the difference between the following and which one should I use? -
>    $d->dbcmd(....... and $d=&dbcmd(.......

The $d->dbcmd() form uses the 'object' handle $d to access the subroutines.  The
&dbcmd($d, ...)  form uses the 'old' sybperl 1.x / perl 4.x form.  The
$d->dbcmd() form is prefered, because it allows you to build object classes and
create new modules that inherit and extend the Sybase::DBlib functionality.

> 3. What does 'use sybase::DBlib' mean?

This loads the actual Sybase API library into memory.

> 
> Could you explain these or point me to a document that has this information.

The perl man pages, and the sybperl man page has more info on the subject (see
in particular the perlmod manual page.

Michael