in reply to Re^5: Converting Oracle report language code into perl
in thread Converting Oracle report language code into perl

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^7: Converting Oracle report language code into perl
by BrowserUk (Patriarch) on Jun 27, 2007 at 08:40 UTC

    Download and run this:

    #! perl use warnings; use strict; my $def = <<'EOD'; .define get_user_info select user_location,user_name, user_company, &fax_header || +';style='|| letterhead, fax_printer, nvl(fax_yn,'N') into user_location, user_name, user_company, fax_header, fa +x_printer, fax_yn from security_header where user_id = lower(substr(user,5,10)) .. EOD $def =~ s/ ( \A \. \w+ \s ) ## $1 := A '.', followed a word and a space (\w+) ## $2 := Another word (\s+) ## $3 := Some whitespace (.+?) ## $4 := Some anything ( ## $5 \s+ ## Some whitespace select ## The word 'select' [^.]+ ## Lots of anything except a '.' ) \. \. \Z ## Two '.'s and the end of line /$2$5/smx ## . matches \n; ^ & $ match lines with the string or die 'Failed to match'; print $def;

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
    A reply falls below the community's threshold of quality. You may see it by logging in.