note
strat
<p>My most important one liner: if I set up some coffee and continue working, I often forget to fetch it, and it gets cold... so:</p>
<code>perl -le 'sleep(300); print qq~\a~ x 10'</code>
</p>reminds me that I must not forget to fetch the fresh coffee; this is the oneliner I use most often</p>
<p>other cases, for filtering or replacing data in files, e.g. printing objects in LDIF files which have the auxiliary object class dxmADsUser:</p>
<code>perl -e 'BEGIN { $/="\n\n" }' -ne 'print if /^objectClass: dxmADsUser/si' file1 > file2
</code>
<p>or replacing domain components on-the-fly:</p>
<code>perl -i.bak -pe 's/dc=domain1,dc=tld$/dc=domain2,dc=tld/' file
</code>
<p>or counting something, e.g. how often each attribute is existing in an ldif file:</p>
<code>perl -MData::Dumper -ane '$count_of{$F[0]}++' -e 'END { print Dumper(\%count_of) }' file</code>
<!-- Node text goes above. Div tags should contain sig only
-->
<div class="pmsig"><div class="pmsig-123953">
<P>
Best regards,<BR>
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"
</div></div>
515336
515336