Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: boss <boss at i-sphere dot com>
Subject: Re: Sybperl Vs Shell Scripts
Date: May 7 2002 8:00PM

Strange.  i don't recall seeing the beginning of this thread back in March.
But i'll put in my 2 cents.

I use a combo of sybperl and shell scripts for
administrative/operations type activities.  The decision comes down to
the complexity of the script: if i'm doing any kind of array processing,
(say, cycling through every table in a database or every index on a table)
then sybperl is your choice.

If the point of the script is to front end bcp jobs, or to get simple output
of sql commands (i.e., get output of sysusers for disaster recover) then
i've always preferred to use shell scripts redirected toa  file.  Also,
it used to be the case that Sybase's DBCC commands wouldn't print to 
Standard Out (only standard Error) and thus COULD NOT be run through
perl programs if you wanted to see output.  Now, i think there are dbcc
handling modules that account for this.

I've got code examples (albeit aged) for both at my website, (look at Ad-hoc scripting, Nightly
and Weekly jobs for examples).


> -----Original Message-----
> From: Michael Peppler []
> Sent: Thursday, March 28, 2002 10:03 AM
> To: SybPerl Discussion List
> Subject: Re: Sybperl Vs Shell Scripts
> Sabherwal, Balvinder (MBS) writes:
>  > I am looking for some inputs from you in order to present some facts
> about
>  > the capabilities of sybperl which are lacking in shell scripts and also I
>  > need to make a compelling argument to use perl instead of shell scripts.
>  > 
>  > Can anyone help me get this info or point me to some place where I cam
> find
>  > some info so I can get some information. The questions I am looking to
> get
>  > answered are :
>  > 
>  > Why should we use perl instead of shell scripts??
>  > What features perl/sybperl offers that are not in shell scripts?
>  > How is perl beneficial as compared to shell scripts??
> >>> perl scripts are much faster than shell scripts.
> How ??
> >>>perl scripts allow much better error control and recovery.
> >>>sybperl (vs. isql in shell script) is *much* faster, *much* better
> >>>error control, greatly expanded usage flexibility.
> In what terms is sybperl faster than the isql in shell scripts??
> >>>perl scripts can use eval {} to catch fatal errors in deeply nested
> >>>code and cleanly restart/retry/abort in case of errors.
> How is this different than trap in shell scripts??