First thing to do, read
perlform and
perlvar :-)
Just select the format you like assigning to $~. Example:
#!/usr/bin/perl
our(@l,$c);
while(@l = getpwent) {
$~ = $c++ % 2 ? 'foo' : 'bar';
write;
}
format foo =
left @<<<<<<<<<<<< @<<<<<<<<<<<<
$l[0],$l[7]
.
format bar =
right @>>>>>>>>>>> @>>>>>>>>>>>>
$l[0],$l[7]
.
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}