<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Nesting the back tick operator in Perl in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517595#M639926</link>
    <description>There has got to be a way of doing this.&lt;BR /&gt;&lt;BR /&gt;Basically I want to do something like:&lt;BR /&gt;&lt;BR /&gt;`mailx -s "Subject" $dest &amp;lt; \`tail -20 $file\` ';&lt;BR /&gt;&lt;BR /&gt;The escaping of the back ticks did not work as I expected and I get an error like:&lt;BR /&gt;_____________&lt;BR /&gt;&lt;BR /&gt;Bareword found where operator expected at ./SigCounter.pl line 53, near "`mailx -s "$msg" $dest &amp;lt; /`tail"&lt;BR /&gt;        (Missing operator before tail?)&lt;BR /&gt;syntax error at ./SigCounter.pl line 53, near "`mailx -s "$msg" $dest &amp;lt; /`tail "&lt;BR /&gt;Scalar found where operator expected at ./SigCounter.pl line 53, at end of line&lt;BR /&gt;        (Missing operator before ?)&lt;BR /&gt;_________&lt;BR /&gt;&lt;BR /&gt;I got around it by redirecting the output of the tail to a file, using that file and deleting it but I figure there has to be around this.&lt;BR /&gt;</description>
    <pubDate>Mon, 04 Apr 2005 19:15:58 GMT</pubDate>
    <dc:creator>Daavid Turnbull</dc:creator>
    <dc:date>2005-04-04T19:15:58Z</dc:date>
    <item>
      <title>Nesting the back tick operator in Perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517595#M639926</link>
      <description>There has got to be a way of doing this.&lt;BR /&gt;&lt;BR /&gt;Basically I want to do something like:&lt;BR /&gt;&lt;BR /&gt;`mailx -s "Subject" $dest &amp;lt; \`tail -20 $file\` ';&lt;BR /&gt;&lt;BR /&gt;The escaping of the back ticks did not work as I expected and I get an error like:&lt;BR /&gt;_____________&lt;BR /&gt;&lt;BR /&gt;Bareword found where operator expected at ./SigCounter.pl line 53, near "`mailx -s "$msg" $dest &amp;lt; /`tail"&lt;BR /&gt;        (Missing operator before tail?)&lt;BR /&gt;syntax error at ./SigCounter.pl line 53, near "`mailx -s "$msg" $dest &amp;lt; /`tail "&lt;BR /&gt;Scalar found where operator expected at ./SigCounter.pl line 53, at end of line&lt;BR /&gt;        (Missing operator before ?)&lt;BR /&gt;_________&lt;BR /&gt;&lt;BR /&gt;I got around it by redirecting the output of the tail to a file, using that file and deleting it but I figure there has to be around this.&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Apr 2005 19:15:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517595#M639926</guid>
      <dc:creator>Daavid Turnbull</dc:creator>
      <dc:date>2005-04-04T19:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting the back tick operator in Perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517596#M639927</link>
      <description>Have you tried using pipe?&lt;BR /&gt;&lt;BR /&gt;`tail -20 $file | mailx -s "Subject" $dest`</description>
      <pubDate>Mon, 04 Apr 2005 20:48:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517596#M639927</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-04-04T20:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting the back tick operator in Perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517597#M639928</link>
      <description>Backticks also don't nest in shells&lt;BR /&gt;&lt;BR /&gt;some perl ways. first the answer of Ermin is very good:&lt;BR /&gt;&lt;BR /&gt;qx{tail -20 $file | mailx -s "Subject" $dest};&lt;BR /&gt;&lt;BR /&gt;if you want to do it completely in perl&lt;BR /&gt;&lt;BR /&gt;open my $f, "&amp;lt; $file" or die "Cannot open input: $!";&lt;BR /&gt;my @in;&lt;BR /&gt;while (&amp;lt;$f&amp;gt;) { $in[$. % 20] = $_ }&lt;BR /&gt;close $f;&lt;BR /&gt;my $in = ++$. % 20;&lt;BR /&gt;open my $m, "| mailx -s Subject $dest";&lt;BR /&gt;print $m @in[$in..$#in],@in[0..($in-1)];&lt;BR /&gt;close $m;&lt;BR /&gt;&lt;BR /&gt;Or even better, use a mail module:&lt;BR /&gt;&lt;BR /&gt;use Mail::Sendmail;&lt;BR /&gt;open my $f, "&amp;lt; $file" or die "Cannot open input: $!";&lt;BR /&gt;my @in;&lt;BR /&gt;while (&amp;lt;$f&amp;gt;) { $in[$. % 20] = $_ }&lt;BR /&gt;close $f;&lt;BR /&gt;my $in = ++$. % 20;&lt;BR /&gt;sendmail ({To =&amp;gt; $dest, From =&amp;gt; 'me@here.com', Message =&amp;gt; join "", @in[$in..$#in],@in[0..($in-1)]}) or die $Mail::Sendmail::error;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Tue, 05 Apr 2005 02:03:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517597#M639928</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-04-05T02:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting the back tick operator in Perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517598#M639929</link>
      <description>The pipe solution works and is simple which I like.&lt;BR /&gt;&lt;BR /&gt;I am a little surprised that it appears that you cannot pass a back tick pair to a shell.&lt;BR /&gt;&lt;BR /&gt;It comes as no surprise that they cannot be nested in shells.&lt;BR /&gt;&lt;BR /&gt;I always enjoy coding in Perl.  I think it is the JAPH thing.</description>
      <pubDate>Tue, 05 Apr 2005 20:35:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/3517598#M639929</guid>
      <dc:creator>Daavid Turnbull</dc:creator>
      <dc:date>2005-04-05T20:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting the back tick operator in Perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/5428639#M639930</link>
      <description>&lt;P&gt;&amp;gt;I am a little surprised that it appears that you cannot pass a back tick pair to a shell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why you don't use these archaic back quotes.&amp;nbsp; In a real shell you use $(), which nests.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2011 05:01:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nesting-the-back-tick-operator-in-perl/m-p/5428639#M639930</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-12-27T05:01:06Z</dc:date>
    </item>
  </channel>
</rss>

