Tutorials Point


  Perl Home

  PERL Functions

© 2011 TutorialsPoint.COM


  Home     References     About TP     Advertising  

PERL readpipe Function



Syntax

readpipe EXPR


Definition and Usage

Executes EXPR as a command. The output is then returned as a multiline string in scalar text, or with the line returned as individual elements in a list context.

Return Value

  • Returns in Scalar Context: String

  • Returns in List Context: List

Example

Try out following example:

#!/usr/bin/perl -w

@result = readpipe( "ls -l /tmp" );

print "@result";

It will produce following results: This will give whole content in /tmp directory.

 drwxr-xr-x  2 root   root    4096 Mar 19 11:55 testdir


Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names