[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Commenting blocks of code



On 3/8/00 at 12:31 AM, pns@virginia.edu (Paul N. Schatz) wrote:

>   Someone must have written an AppleScript or MacPerl script or some
> such that permits one to select a block of lines of MacPerl code in a
> window and automatically comment them out or vice versa.  Can someone 
> point me in the right direction? 
> 

Since I edit my scripts with BBEdit, I use the following two scripts in the
Perl Filter palette to comment and uncomment Perl source.  I just select
the lines I want to comment/uncomment, then double-click the script name in
the palette, works great.

#!perl -w
# This script comments Perl source.

while(<>)
{
  print "# $_";
}


#!perl -w
# This script uncomments Perl source.

while(<>)
{
  s/^# *//;
  print $_;
}


Don



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org