Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Regular expressions

by ikegami (Patriarch)
on Jul 20, 2005 at 10:56 UTC ( [id://476515]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Regular expressions
in thread Regular expressions

That's an aweful way of reading a file. It means every line must be pushed onto the stack. The OP's method was better, and the following is even better because it avoids a call to stat and works will all kinds of IO handles:

my $text; { local $/; $text = <DATA>; }

Visually, I prefer
my $text = do { local $/; <DATA> };
but I think I determined the above is equivalent to
my $text; { local $/; my $temp = <DATA>; $text = $temp; }

Replies are listed 'Best First'.
Re^3: Regular expressions
by GrandFather (Saint) on Jul 20, 2005 at 16:35 UTC

    The reason I am a monk is to learn from the masters. I keep forgetting about $/! I hope I have learned :). Thank you.


    Perl is Huffman encoded by design.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://476515]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.