homepage Welcome to WebmasterWorld Guest from 54.161.202.234
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
referring to standard input in a unix pipeline
passing output from perl script between unix scripts
Warboss Alex




msg:438830
 10:28 pm on Mar 29, 2006 (gmt 0)

hey everyone,

I have the following question.

I have a unix script script1 which invokes a perl script and gets some output from it. The perl script has one print statement at the end which sends the data to stdout

Code:

print STDOUT $log;

my unix pipeline looks like this:

Code:

script 1 ¦ script 2

how can script 2 refer to the output from script 1 (which is output from a perl script) .. is it with $1? or is that just command line variables?

any help appreciated,
Alex ...

 

SeanW




msg:438831
 1:45 pm on Mar 30, 2006 (gmt 0)

[perl]
while (my $line = <STDIN>) {
$line =~ s/a/b/;
print $line;
}
[/perl]

or, for the uber-efficient, $_ is implied pretty much everywhere -

[perl]
while (<STDIN>) {
s/a/b/;
print;
}
[/perl]

Warboss Alex




msg:438832
 12:01 am on Mar 31, 2006 (gmt 0)

worked fine, thanks!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved