Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by ikegami (Patriarch)
on Sep 27, 2009 at 17:34 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-19 18:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found