Jemand zu Hause?Leser: 20
Wie frage ich & perlintro
brian's Leitfaden für jedes Perl-Problem
AllgemeinesWieFrageIchbeiPerlCommunity, die auch vor jedem Schreiben verlinkt ist, steht ein bisschen Info drin, was man bei einer Frage beachten sollte. "Funktioniert (irgendwie) nicht (so gut)" ist keine Fehlerbeschreibung, mit der hier irgendwer was anfangen kann.
perlsub
Wie frage ich & perlintro
brian's Leitfaden für jedes Perl-Problem1 2 3 4 5 6 7 8
my $y; sub x{ open( IN, "<$file" ) or die "Konnte Input nicht oeffnen!\n"; while (<IN>) { if ($y=......)...... close(IN); } &x;
1 2 3 4 5 6 7
print '<html>'; print '<head>'; print '</head>'; print '<body>'; print '$y'; print '</body>'; print '</html>';
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 26 27 28
use strict; use warnings; #... sub x{ my $file=shift; my $y=''; open( my $in, '<', $file ) or die "Konnte $file nicht oeffnen! ($!)\n"; while (<$in>) { if (......){ $y=.... } close($in); return $y; } #... my $y=x($file); print '<html>'; print '<head>'; print '</head>'; print '<body>'; print $y; #< nicht '$y' print '</body>'; print '</html>';
2010-03-03T11:10:01 cirruswolke
QuoteCode (perl): (dl )&x;
QuoteCode (perl): (dl )print '$y';
IPC::System::Simple,
Path::Class2010-03-03T11:32:29 betterworldDu könntest Dir mal überlegen, ob Du nicht ein Template-System benutzen möchtest.
Wie frage ich & perlintro
brian's Leitfaden für jedes Perl-Problem