Trying to make a subject line change for a number of scripts, but having no 
luck.  The original code will have something like:
    $MySubject = sprintf "%-s%-s%-s [descriptive Subject] for %-s\n", 
                                $GlblInfo{subjectprefix}, 
                                $GlblInfo{subjectseparator},
                                $GlblInfo{runtype},
                                $GlblInfo{asofdate};

    What I am trying to do is:

    $MySubject = sprintf "%-s%-s[descriptive Subject] for %-s  %-s \n",                
                 $GlblInfo{subjectprefix}, 
                                $GlblInfo{subjectseparator},
                                $GlblInfo{asofdate},
                                          $GlblInfo{runtype};
        

        Seems minor, but there may be 1, 2 or x fields between runtype and last print 
field. It may or may not be asofdate, just something before the ;

        I have tried a number of iterations and been looking at the documentation, but 
continue to spin my weeks.

        Any insights would be greatly appreciated.

Wags ;)

========================================================================================================================

#!perl

use strict;
use warnings;

my $MyDataOrg;

{
    local $/;
    $MyDataOrg = <DATA>;
 }

printf "%s", $MyDataOrg;

if ( $MyDataOrg =~ /(\s+\$MySubject\s+=\s+sprintf\s+"\%-s\%-s)\%-s 
(.+\%-s)\s*\\n",(.+)(\s+)(\$GlblInfo\{runtype\}),(.+?);/igm ) {
    printf "hit on search!\n";
    print "$1$2  \%s\\n\",$3$5$4;\n";
 } 

__DATA__
    my $MyPrtDate = [EMAIL PROTECTED];
    my @MyWorka = ();
    my $MyLineCnt = 0;
    my $MyLineCntTot = 0;
    
    $MySubject = sprintf "%-s%-s%-s [descriptive Subject] for %-s\n", 
                                $GlblInfo{subjectprefix}, 
                                $GlblInfo{subjectseparator},
                                $GlblInfo{runtype},
                                $GlblInfo{asofdate};


    my @MyWorka = ();
    my $MyLineCnt = 0;




*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to