Hi all, i have a quick on that i can't seem to figure out. I installed a script to send out the contents of a folder by globing contents then sending an email via gmail. all works well expect for one part, i can't get a "\n" after each file name like i normally would.
#!/usr/bin/env perl use strict; use warnings; use File::Find; use File::Copy; use Email::Send; use Mail::Sender; use Email::Send::SMTP::Gmail; use POSIX qw(strftime); my $date = strftime("%m-%d-%y",localtime); my $time = strftime("%I:%M:%S",localtime); my $directory ="/Users/flieckb/Desktop/files/"; my $to ='brianflieck\@gmail.com'; my $from='bflieck\@industrialcolor.com'; my $subject = "test"; chdir( $directory ) or warn "Cant chdir to $directory $!"; my(@push_list) = glob "*"; my $filecount = @push_list; my ($mail,$error)=Email::Send::SMTP::Gmail->new( -smtp=>'smtp-relay.gm +ail.com', -login=>'youremailadd +resss, -pass=>'yourpassword' +, # -layer=> 'ssl', -port=> '25', -debug=> 1,); $mail->send(-to=>"$to", -from=>"$from", -subject=>"$subject", -body=>" +@push_list\n total files pushed: $filecount"); $mail->bye;
all works well, but when i get the email it looks like this.

1a.txt 1b.txt 1c.txt 1d.txt 1e.txt 1f.txt 1g.txt 1h.txt 1i.txt 1j.txt 1k.txt 1l.txt 1m.txt 1n.txt 1o.txt total files pushed: 15

what isn't the \n working in this case?

In reply to adding carriage return to gmail script by flieckster

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.