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

Re^2: Scope of $/

by BillKSmith (Monsignor)
on May 26, 2016 at 13:29 UTC ( [id://1164191]=note: print w/replies, xml ) Need Help??


in reply to Re: Scope of $/
in thread Scope of $/

A truly minimal scope solves the problem.
use strict; use reader; #$/= "\n\n\n"; while(do{local $/="\n\n\n"; $_=<>}){ my ($filename)=/^(\S+)/; my $text=reader::firstline($filename); }

Update: Commented out original definition of $/.

Bill

Replies are listed 'Best First'.
Re^3: Scope of $/
by NetWallah (Canon) on May 26, 2016 at 13:48 UTC
    Applause, for a truly elegant solution !

    I wish I had thought of that.

            This is not an optical illusion, it just looks like one.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found