Skip to content

Instantly share code, notes, and snippets.

#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main( void ) {
int pipefds[2];
if ( pipe( pipefds ) == -1 )
err( 1, "pipe" );
$ cat a.pl
use v5.14;
use warnings;
use File::Tail qw( );
say File::Tail->VERSION;
my $ft = File::Tail->new(
name => $ARGV[0],
$ cat a.pl
use v5.14;
use warnings;
use File::Tail qw( );
say File::Tail->VERSION;
my $ft = File::Tail->new(
name => $ARGV[0],
$ ./a.sh
#1 Working...
#2 Working...
#3 Working...
#4 Working...
#5 Working...
^CSIGINT
$ ./a.sh & sleep 5; kill -INT %1
[1] 5963
$ perl -Mv5.14 -e'say "337,000" =~ s:(?<!\d)\d{1,2}(?!\d):$1$2:gr;'
337,000
$ perl -Mv5.14 -e'say "337,000" =~ s:(?<!\d)\d{1,2}(?!\d)::gr;'
337,000
$ perl -Mv5.14 -e'say "337,000" =~ s:(?<!\d)\d{1,2}(?!(\d|-|[,;])):$1$2:gr;'
337,000

Your code doesn't compile.

Let's talk about the following code instead:

typedef struct {
   void *p1;
   void *p2;
} s_t;
#!/bin/bash
seq 5 | (
while read i; do
sleep 1 && echo $i &
done
wait
) &
echo "waiting"
wait
echo "complete"

Before:

<config logdir="/var/log/foo/" debugfile="/tmp/foo.debug">
  <server name="sahara" osname="solaris" osversion="2.6">
    <address>10.0.0.101</address>
    <address>10.0.1.101</address>
  </server>
  <server name="gobi" osname="irix" osversion="6.5">
 10.0.0.102
use strict;
use warnings;
use feature qw( say );
use experimental qw( refaliasing declared_refs );
sub rotate_str_left_once {
my \$s = \shift;
my $b = shift;
my $l = shift;
>chcp
Active code page: 65001
>a.pl äö.txt
"C:\progs\sp5038000001\perl\bin\perl.exe" "C:\Users\ikega\a\a.pl" äö.txt
<C:\progs\sp5038000001\perl\bin\perl.exe>
<C:\Users\ikega\a\a.pl>
<äö.txt>
>pp -o a.exe a.pl