Up Prev Next
From: John_McCarthy at WellspringRes dot com
Subject: RE: Transactions
Date: Aug 27 1999 2:23PM
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,
> > > ($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
> > 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
> > 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).
> Doug Bateman