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: Simon Haven <Simon dot Haven at wdr dot com>
Subject: Re: Transactions
Date: Aug 27 1999 2:41PM

Maybe so the author could quickly grep out the SQL from the script for some reason?
Just a guess.

Begin forwarded message:

To: SybPerl Discussion List 
Subject: RE: Transactions
Date: Fri, 27 Aug 1999 10:23:26 -0400
X-Mailer: Internet Mail Service (5.5.2448.0)
X-Listprocessor-Version: 8.2.07 -- ListProc(tm) by CREN

	Please excuse me for interrupting, but why would one want to type in
all those extra spaces and @'s only to have the perl substitute operator
immediately remove them?  What am I missing?

> Subject:	Re: Transactions
> In a message dated 8/27/99 9:22:25 AM Eastern Daylight Time,
> writes:
> > >  ($sql = <<"SQL") =~ s/^\s+@@@ ?//gm;
> >  >     @@@ -- begin transaction
> >  >     @@@ select * from master..syslogins
> >  >     @@@ if \@\@error != 0
> >  >     @@@ begin
> >  >     @@@     raiserror 30000, 'OUCH'
> >  >     @@@ end
> >  >     @@@ -- commit
> >  >SQL
> >  
> >  MOTHER, MARY and JOSEPH.  *w*h*a*a*a*a*a*a*t* is this, and why do you
> do 
> >  it?  W-OW.
> >  
> >  What is with the number of '@'s threatening to exceed the rest of the 
> >  letters by a simple majority?  ... I hope I don't seem too naive to
> bother 
> >  with, but I'm mostly not sure of the difference between "@@@" and "@@@
> --" 
> .
> >  
> The clue to understanding this is in the line that
> begins the "here" document. In addition to identifying
> the bounds of the document (from the next line down to
> the line beginning with SQL), it is automagically removing
> the "   @@@ " characters at the beginning of each line.
> This is a rather esoteric Perl idiom that enables a coder
> to format lines in a here document much to their heart's
> content--but doesn't add much to the self-documenting nature
> of Perl code (IMHO).
> Cheers,
> Doug Bateman

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.