Hi All,

You'll have to bare with me on this one as I can post code to repeat the
problem.  I hope I can give enough details so that the cause of the
"problem" is clear.

Background: I get automated emails that contain information about project
tasks (this is a sourceforge project). As I am the project admin, I get all
emails.

My Goal: Automatically send a reformatted version to our developer list with
a little help from procmail and perl.

My Problem: The values I parse from the email (coming from STDIN) are not
acting like a "normal" string scalar.

Here is a shortened version of the program.  I'm a terrible perl programmer,
so any tips are welcome.

    my $status;
    my $assignedto;

    while (<STDIN>) {
        chomp;                  # Drop the newline
        if (/^Status:/) { s/.*: ([^ ]*)$/$1/; $status = $_; next;}
        if (/^Assigned to/) { s/.*: ([^ ]*)/$1/; $assignedto = $_; next;}
    }

    #The value of $status should be 'Open'
    #The value of $assignedto should be 'dblevins'
    print $status,"x\n";
    print $assignedto,"x\n";
    #I am expecting this output:
    #Open
    #dblevins
    #But for some reason, these two print statements print this:
    #xpen
    #xblevins

    #To give it another try
    print "<$status>";
    print "<$assignedto>";
    #Again, I expect this:
    #<Open><dblevins>
    #But even stranger than before, I get this:
    #><dblevins

Could anyone give me clue, I am clearly missing something basic!

Many thanks!
David


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to