Help for this page

Select Code to Download


  1. or download this
    while (<>) {
    }
    
  2. or download this
    if (data is available then) {
        while (<>) {
    ...
    else {
        # do something else
    }
    
  3. or download this
        my $stdin = IO::Select->new(\*STDIN);
        open my $fh, '|-', $cmd or die $!;
    ...
            print {$fh} "\n" or die $!;
        }
        close $fh or die $!;
    
  4. or download this
    $ echo "text" | myprog
    
  5. or download this
    $ myprog <<EOT
    some text
    EOT
    
  6. or download this
    $ myprog afile