[Pdx-pm] any one know of an editor that allows for embeded perl?

benh ben.hengst at gmail.com
Mon Nov 14 15:40:42 PST 2005


Ok I've been beating my head on this one. Any one know if there is an
editor that embeds perl in to the editor? Kinda like a super fancy
copy/paste/search/replace .... I currently use jEdit and love it...
well for the most part. Heres an example of something that I just got
done doing,  build a nav with every image in a dir nav_cat* files are
categorys and nav_*_* are links

ls -lh *.gif > list

[open list in jEdit]
using regex find s/^.*14:(49|50)//

[copy trim list to new buffer]
my @imglist = ( ** list here ** );

my $cat=q{};
foreach (@imglist) {
    if(m/^nav_cat/) {
        ($cat)= $_ =~  m/nav_cat_(.*?).gif/;
        print "<tr><th><img src='$_' alt='$cat'></th></tr>\n";
    }
    else{
        my ($alt)= $_ =~ m/nav_.*?_(.*?).gif/;
            print "<img src='$_' alt='A link to $alt $cat'></a>\n";
    }
}


[save that off and run script in term... copy output]
[open new buffer in jEdit ... paste]

take a seperate list of the actual links that have the category id's
and link them up by hand...

and tada... final table of links.... total time about 15 minutes, much
faster then doing it all long hand like most of the production folks
but ... it got me thinking... why am I bouncing back and forth and
side steping STD(IN|OUT) ... what I would love to see is an editor
that could fork a background process as a perlscript and plug in
STDOUT in to the buffer... almost like bluring the lines between
terminal and editor? Is that possible... well I'm sure that any emacs
guru would yell at me because emacs is the answer to everything... any
takers on this one?


More information about the Pdx-pm-list mailing list