List:General Discussion« Previous MessageNext Message »
From:Van Date:May 18 1999 4:16am
Subject:Now, How to sed on Perl Vars?
View as plain text  
Okay, this is starting to stray way off topic, but, I'm to close to
resist.
I've got a perl script that strips the header off a MIME mail message. 
I can live with glomming the header into one record, and the body into
another.  But, in the header there are \n's and \t's.  How do I get rid
of them?
i.e.
for (my $i = 0; $i < @emails; ++$i) {
    my $headers = $emails[$i]{'headers'};

    print "Headers:";
    foreach (sort keys %$headers) {
        print "$_:|";
        foreach (@{$headers->{$_}}) {
	    /* I would think print "$_:" | sed '/\//s//-/g' ->
mynewvarwithoutlinefeeds */
            print "$_:";
        }
    }
    print "\t";
    print "Body:  ";
    print $emails[$i]{'body'};
}
Van

-- 
=========================================================================
Linux rocks!!!   www.dedserius.com
=========================================================================
Thread
Per User Password AdministrationVan13 May
  • Per User Password AdministrationMichael Widenius13 May
  • Re: Per User Password AdministrationChristian Mack14 May
  • PHP Tracking of Variables (was) Per User Password AdministrationVan16 May
  • Re: PHP Tracking of Variables (was) Per User Password Administration (Never Mind)Van16 May
  • Re: PHP Tracking of Variables (was) Per User Password AdministrationSasha Pachev17 May
    • Re: PHP Tracking of Variables (was) Per User PasswordAdministrationShafir17 May
  • Re: PHP Tracking of Variables (was) Per User Password AdministrationVan17 May
  • Re: PHP Tracking of Variables (was) Per User PasswordAdministrationVan17 May
  • Re: PHP Tracking of Variables (was) Per User Password AdministrationSasha Pachev17 May
  • Parsing of Mail files into a DatabaseVan18 May
    • Parsing of Mail files into a DatabaseMichael Widenius22 May
    • Parsing of Mail files into a DatabaseMichael Widenius22 May
  • Now, How to sed on Perl Vars?Van18 May
    • Re: Now, How to sed on Perl Vars?Thimble Smith18 May
  • Re: Now, How to sed on Perl Vars?Van19 May
Re: Parsing of Mail files into a DatabaseVan18 May
  • Re: Parsing of Mail files into a DatabaseDaniel E. White18 May
Re: Parsing of Mail files into a DatabaseVan18 May
  • Re: Parsing of Mail files into a DatabaseDaniel E. White18 May
Re: Parsing of Mail files into a DatabaseVan18 May