Bass-Fighter has asked for the wisdom of the Perl Monks concerning the following question:
I got a program here, and I want to change something in it, but I don't know how... here is a sub of the code:
if I have an E-mail with several attachments and a cc... now I want to have those into $info... at the moment I get a globref, but I want to have there just plain text. but I don't know how, who knows?sub open_log_mail { open my $info, ">c_a.txt"; if ($cc ne 0){ print $info "$cc"; } my $a=@filename; my $n=0; for (my $l=0; $l<$a; $l++){ if ($filename[$n] ne 0){ print $info "$filename[$n]\n"; $filename[$n]=0; } $n++; } close $info; open $info, "<c_a.txt"; print $info; $dbh->do("INSERT INTO items_mma(item, businesstype, direction, destina +tion, nature, role, relcode, project, title, subject, keywords, comme +nts, created, creator, changed, changer, signature, size, status) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", unde +f, ($openvalue, '1', $openvalue, 'MES', $openvalue, '1', $openvalue, +'1', $openvalue, $subject, $openvalue, $info, "$Month-$Day-$Year", 'M +MA', "$Month-$Day-$Year", '1', '1', '1', '1')) or die ("kan niet toev +oegen!"); close $info; }
ohw and there are 2 places where I look variable ne to 0... I've made the scarlar 0 if it was undifined. that is the reason that I've that in my code
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: globref to plain text
by Corion (Patriarch) on Jan 09, 2009 at 09:40 UTC | |
by Bass-Fighter (Beadle) on Jan 09, 2009 at 09:46 UTC | |
by Corion (Patriarch) on Jan 09, 2009 at 09:49 UTC | |
by Bass-Fighter (Beadle) on Jan 09, 2009 at 09:57 UTC | |
by Corion (Patriarch) on Jan 09, 2009 at 10:00 UTC | |
|