Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Per Rtf to text conversion.

  • 29-06-2018 09:47AM
    #1
    Registered Users, Registered Users 2 Posts: 46


    Hello all,

    I am trying to allow a file specified via the command line be converted from rtf to text but I keep getting the same error message.

    The cpan documentation is quite limited for this module but according to whatever I could find the code below should do what i need without an issue.

    #!/usr/bin/perl

    use strict;
    use warnings;
    use RTF::TEXT::Converter;


    my $object = RTF::TEXT::Converter -> new( Output => \*STDOUT );
    $object -> parse_stream(*STDIN);

    However, when running it I get the error.

    Couldn't open '*main::STDIN' for reading at /usr/local/share/perl5/RTF/Parser.pm line 233.


Comments

  • Registered Users, Registered Users 2 Posts: 6,605 ✭✭✭daymobrew


    A filename on the command line won't make an input stream.
    Maybe something like
    cat filename | perl rtf-to-text.pl
    
    might.


Advertisement