Leser: 23
1 2 3 4 5
use Data::Dumper open( DATEI, '< text') or die $!; my @array = <DATEI>; print Dumper \@array; close DATEI;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/usr/bin/perl use Mail::Sender; use strict; my @text; my $message = "test"; open (DATEI, '< text'); @text = <DATEI>; close (DATEI); my $sender = new Mail::Sender { smtp => 'asd', from => 'asd', auth => 'LOGIN', authid => 'asd', authpwd => 'asd', on_errors => undef, } or die "Can't create the Mail::Sender object: $Mail::Sender::Error\n"; $sender->MailMsg({to => 'asd', subject => 'Testmail', msg => @text}) or print "FUBAR";
1 2 3 4
$sender->MailMsg({to => 'asd', subject => 'Testmail', msg => join '::', @text, }) or print "FUBAR";
1 2 3 4 5 6 7
use Data::Dumper; my @text = qw(das ist ein Test); my $hashref = {to => 'asd', subject => 'Testmail', msg => @text}; print Dumper $hashref;
1
2
3
4
5
6
7
$VAR1 = {
'msg' => 'das',
'to' => 'asd',
'ist' => 'ein',
'subject' => 'Testmail',
'Test' => undef
};
2010-08-07T04:45:09 reneeDu musst es so machen:Code (perl): (dl )1 2 3 4$sender->MailMsg({to => 'asd', subject => 'Testmail', msg => join '::', @text, }) or print "FUBAR";
1 2 3 4 5 6 7 8 9 10 11 12 13
use Data::Dumper; my @text = qw/ a b c /; my %hash = ( foo => 1, bar => join ",", @text, baz => 2, ); print Dumper \%hash; __END__ $VAR1 = { 'bar' => 'a,b,c,baz,2', 'foo' => 1 };
1 2 3 4 5 6 7 8 9 10 11 12 13 14
perl -wle'use Data::Dumper; my @text = qw/ a b c /; my %hash = ( foo => 1, bar => join(",", @text), baz => 2, ); print Dumper \%hash; __END__ $VAR1 = { 'bar' => 'a,b,c', 'baz' => 2, 'foo' => 1 };