<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Times New Roman","serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;color:#1F497D'>yes – you use –n
with print or –p without print<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;color:#1F497D'>perl –pe ‘$_ = “$ARGV
$_”’ <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> MiltonKeynes-pm
[mailto:miltonkeynes-pm-bounces+tony.edwardson=lchclearnet.com@pm.org] <b>On
Behalf Of </b>Hugh Gallagher<br>
<b>Sent:</b> 05 November 2012 16:11<br>
<b>Cc:</b> miltonkeynes-pm@pm.org<br>
<b>Subject:</b> Re: adding a filename into a data file<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#500050'>> perl -npe 'print "$ARGV "' *</span><o:p></o:p></p>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#500050'>That's very neat. Am I wrong to say that the -n is </span><span
style='font-family:"Arial","sans-serif";color:#500050'>superfluous because of
the -p?</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:#500050'>Just
need to add stripping of the file extension and job done.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p>

<div>

<p class=MsoNormal>On 5 November 2012 16:00, Tom Hukins <<a
href="mailto:tom@eborcom.com" target="_blank">tom@eborcom.com</a>> wrote:<o:p></o:p></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>On Mon, Nov 05, 2012 at
03:32:11PM +0000, Ant Mitchell wrote:<br>
> perl -npe 'print "$ARGV "' *<o:p></o:p></p>

</div>

<p class=MsoNormal>Indeed.  In the spirit of "teach a man to fish",
it's worth mentioning<br>
that Perl mentions the "-npe" switches in its "perlrun"
documentation<br>
and the "$ARGV" variable in "perlvar".<br>
<br>
You should find this documentation installed alongside perl, although<br>
some Linux distributions like to cripple their installations and omit<br>
it.  You can also find it on the Web at <a href="http://perldoc.perl.org/"
target="_blank">http://perldoc.perl.org/</a>.<br>
<span style='color:#888888'><br>
<span class=hoenzb>Tom</span></span><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal>_______________________________________________<br>
MiltonKeynes-pm mailing list<br>
<a href="mailto:MiltonKeynes-pm@pm.org">MiltonKeynes-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/miltonkeynes-pm" target="_blank">http://mail.pm.org/mailman/listinfo/miltonkeynes-pm</a><o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</div>


<p><span style="font-family:'Verdana';font-size:8pt;"> </span></p>
<p><span style="font-family:'Verdana';font-size:8pt;">A copy of the LCH.Clearnet e-mail disclaimer can be found at: </span><span style="font-family:'Verdana';font-size:8pt;"><u>www.lchclearnet.com/disclaimer/email</u></span><span style="font-family:'Verdana';font-size:8pt;">  </span></p>
<p><span style="font-family:'Verdana';font-size:8pt;"></span></p>
<p><span style="font-family:'Verdana';font-size:8pt;"> </span></p>
<p><span style="font-family:'Verdana';font-size:8pt;">LCH.Clearnet Limited, Registered Office: Aldgate House, 33 Aldgate High Street, London EC3N 1EA. </span></p>
<p><span style="font-family:'Verdana';font-size:8pt;">Recognised as a Clearing House under the Financial Services & Markets Act 2000. Reg in England No.25932.</span></p>
<p><span style="font-family:'Verdana';font-size:8pt;">LCH.Clearnet SA, Siège Social, 18 rue du Quatre Septembre, 75002 Paris, Chambre de Compensation conformément au Code Monétaire et Financier.</span></p></body>

</html>