hi monks i want to pass a file name generated by a shell script to another one ... the shell script program i want to pipe my filename into ..looks like this

And why do you want to use Perl to do so? In shell (well, at least in bash - which I'm familiar with) you just use stuff like script2 $(script1). (You can also use backticks, but I just don't like them, and $() has the advantage of allowing nesting.)

while (my $var = <STDIN>) awk -f work_5messages.awk $var

This is neither Perl nor shell, although it slightly resembles both. In Perl this could be

while (my $var = <STDIN>) { chomp $var; system 'awk', -f => 'work_5messages.awk', $var and die "D'Oh! (Do better error checking!!)"; }

and in (ba)sh,

while read var; do awk -f work_5messages.awk "$var"; done

OTOH...

syntax error near unexpected token `)' `while (my $var = <STDIN>) '

This looks like a shell error. You should clarify what you're really after, to help us to help you.


In reply to Re: shell prob by blazar
in thread shell prob by vineet2004

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.