Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Use of IO::All

by geoffleach (Scribe)
on Feb 08, 2024 at 21:24 UTC ( [id://11157615] : perlquestion . print w/replies, xml ) Need Help??

geoffleach has asked for the wisdom of the Perl Monks concerning the following question:

In the context of a module:
package whatever; use IO::All; ... inside sub ... $text = 'something unremarkable'; $text >> io('existing file');
Execution results in:
Odd number of elements in anonymous hash at line <of the call>
Removing the call to io() results in correct execution.

I'm at a loss. Some direction would be appreciated.

Replies are listed 'Best First'.
Re: Use of IO::All
by hippo (Bishop) on Feb 08, 2024 at 23:04 UTC

    I am unable to reproduce your reported problem. Here is my SSCCE:

    #!/usr/bin/env perl use strict; use warnings; package Foo; use IO::All; sub foo { my $text = 'bar'; $text >> io ('/tmp/quux.txt'); } package main; Foo::foo ();

    It runs to completion without error or warning. With nothing further to go on I can only assume that the problem lies in the code you have not shown.


    🦛

      Turns out that the problem stems from my inability to distinguish between {} and () in my code. Thanks for the help; sorry for the trouble.
Re: Use of IO::All
by ikegami (Patriarch) on Feb 09, 2024 at 01:47 UTC

    Please provide a (minimal, runnable) demonstration of the problem.