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: John_Erjavec at cargill dot com
Subject: RE: Transactions
Date: Aug 27 1999 2:37PM

     Personally, I see it as a way to still block out your SQL, while at 
     the same time you are marking it as a special block.  This is more 
     useful for things that require strict formatting, so that you can 
     still format them the way you want, but I think it is still nice used 
     like it is below.
     
     -JEV
     -- 
     John Erjavec V
     Cargill, Inc.
     john_erjavec@cargill.com


______________________________ Reply Separator _________________________________
Subject: RE: Transactions
Author:  John.McCarthy (John_McCarthy@WellspringRes.com) at mtka-unix-mime
Date:    8/27/99 9:23 AM


        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?
        Jack
     
> Subject:      Re: Transactions
> In a message dated 8/27/99 9:22:25 AM Eastern Daylight Time, 
> brad@neosoft.com 
> 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