Open perl

From Teknologisk videncenter
Revision as of 10:53, 1 October 2009 by Heth (talk | contribs) (New page: == Piping from Perl to system commands == === Getting STDOUT from commands === <source lang=perl> #!/usr/bin/env perl print "Jeg er et perl program\n"; open FH,"ls -l|"; foreach my $i (...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Piping from Perl to system commands

Getting STDOUT from commands

#!/usr/bin/env perl

print "Jeg er et perl program\n";

open FH,"ls -l|";

foreach my $i (<FH>) {
 print "Har modtaget linien: $i";
}