Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

koschei (147)


Um. Me. Iain Truskett. Can be found as either Spoon or Koschei around the place, and as Braxiatel in rare circumstances. Um. Cool. Ta.

My perl svn repository [] if you want bits of code by me. Also see [] for most of them in action.

My friends [], foes [], fans [], and freaks []. And you can see what my friends are journalling [].

And everybody's journals [] (in order of updating).

Journal of koschei (147)

Tuesday September 17, 2002
08:27 PM

Journal poster number 9

[ #7791 ]

#!/usr/bin/perl -w
use strict;
use WWW::UsePerl::Journal;

my $subject = <>;
chomp $subject;
my $entry = join( '', <> );

my $j = WWW::UsePerl::Journal->new('fred');
    title => $subject,
    text => $entry,

[updated with petdance's changed]

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Why open the file manually? Let the magic of <> do it for you. Change:

    my $file = shift;

    die unless defined $file and length $file;
    my $subject;
    my $entry;
        open my $fh, $file or die "Cannot open $file: $!\n";
        $subject = <$fh>;
        $entry = join('', <$fh>);
    chomp $subject;


    my $subject = <>;
    chomp $subject;

    my $entry = join( '', <> );

    Magical @ARGV processing is your friend!



    • Erm. It's an artefact that I should've removed. The program used to do much more. Then I realised the other features were irritating me.
        ---ict / Spoon