Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Syntax error when trying to use a hash value as a file stream specifier

by kcott (Archbishop)
on Sep 02, 2022 at 21:08 UTC ( [id://11146645]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ alias perle
    alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E
    +'
    
  2. or download this
    $ perle 'open my $fh, ">", "not_a_file"; say "$fh"; unlink "not_a_file
    +";'
    GLOB(0x8000c42e0)
    
    $ perle 'my $hashref = {}; say "$hashref";'
    HASH(0x800003bc8)
    
  3. or download this
    Bareword "STDERR" not allowed while "strict subs" in use ...
    
  4. or download this
    use strict;
    use warnings;
    
  5. or download this
    $ perle 'my $x = \*STDERR; say "$x";'
    GLOB(0x80008fcd0)
    
    $ perle 'my $x = *STDERR; say "$x";'
    *main::STDERR
    
  6. or download this
    $ perle 'my %fh = (err => \*STDERR); print {$fh{err}} "errmsg\n";'
    errmsg
    
    $ perle 'my %fh = (err => *STDERR); print {$fh{err}} "errmsg\n";'
    errmsg
    
  7. or download this
    $ perle 'my %fh = (err => \*STDERR); $fh{err}->print("errmsg\n");'
    errmsg
    
    $ perle 'my %fh = (err => *STDERR); $fh{err}->print("errmsg\n");'
    errmsg
    

Log In?
Username:
Password:

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

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

    No recent polls found