Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

On Backwards Compatibility and Bareword Filehandles

by jcb (Parson)
on Jul 17, 2020 at 04:33 UTC ( [id://11119439]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open FILE, '<', $file or die "...";
    while (<FILE>) {
    ...
      handle(FILE, 'that') if m/that/;
    }
    close FILE;
    
  2. or download this
    open my {I/O}FILE, '<', $file or die "...";
    while (<{I/O}FILE>) {
    ...
      handle({I/O}FILE, 'that') if m/that/;
    }
    close {I/O}FILE;
    
  3. or download this
    open my {I/O}FILE, '<', $file or die "...";
    while (defined($_ = {I/O}FILE->readline)) {
    ...
      handle({I/O}FILE, 'that') if $_ =~ m/that/;
    }
    {I/O}FILE->close;
    
  4. or download this
    sub handle {
      my $fh = shift;
    ...
    
      ...
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2024-04-18 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found