[lug] sed replacment issue?

corn man cornman8 at hotmail.com
Sun Jul 10 18:27:13 MDT 2005


I have a large set of perl files with old pre dbi fetchhash calls I'd like 
to convert them as per the below fields.
I've been repeatedly unable to get sed to do the nessicary inversion of the 
first two fields.
There is no perticular reason I'm stuck with sed.

        %lpage = $PHAN->fetchhash;    # get page info in hash

into
        $lpage_hashref = $PHAN->fetchrow_hashref;
        %lpage = %$lpage_hashref;    # get page info in hash

Below is what after hours on the manpages/faqs I've been working with. It 
doesn't even come close to working though.
Thanks for taking the time to examine this issue.

s/[[:cntrl:]]//g
/\%[[:alpha:]]*[[:blank:]]=[[:blank:]]\$[[:alpha:]]*->fetchhash;/{
#s/[[:blank:]]*//
#s/%//
#s/ = \$/ /
#s/->fetchhash;//
#/[[:blank:]][[:alpha:]]*/{
#H
#}
#/[[:alpha:]]*/{
#G
#p
#}
p
}

-Jason

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/




More information about the LUG mailing list