Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: Help with IO::Scalar and piping

by ikegami (Pope)
on Sep 27, 2009 at 17:34 UTC ( #797780=note: print w/replies, xml ) Need Help??

in reply to Re^2: Help with IO::Scalar and piping
in thread Help with IO::Scalar and piping

  • Standard input is already opened for your as STDIN, so
    # slurp the email from STDIN my( $raw ); { local $/ = undef; local *FILE; open FILE, "-"; $raw = <FILE>; close +FILE }
    is an overly complex way of doing
    # slurp the email from STDIN my $raw; { local $/; $raw = <STDIN>; }
  • Why are you forcing a list assignment?

    my( $raw_iohandle ) = new IO::Scalar( \$raw );
    should be
    my $raw_iohandle = new IO::Scalar( \$raw );

    But then again, IO::Scalar is not nearly as robust as the native support for scalar handles added to 5.8

    open(my $raw_iohandle, '<', \$raw );
  • Finally, if the module expects a system file handle (e.g. if it attempts a child process to read from it), it'll be disappointed by your attempts since none of the Perl file handles you are producing have a system file handle associated with it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://797780]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2020-09-20 12:22 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (121 votes). Check out past polls.