Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: print the whole line

by Theo (Priest)
on Jan 21, 2004 at 15:55 UTC ( [id://322911]=note: print w/replies, xml ) Need Help??


in reply to print the whole line

I was just reading last night in Learning Perl about the special variables, $', $& and $`. The $& hold the contents of the m// string while the $` and $' contain the text before the m// and after it. I'm not sure which one does which, but is sounds like with these three variables, you would have the whole line.

-Theo-
(so many nodes and so little time ... )

Replies are listed 'Best First'.
Re: Re: print the whole line
by flyingmoose (Priest) on Jan 21, 2004 at 17:20 UTC
    I believe these are notoriously inefficient and should be avoided. Allegedly using some of these causes them to be calculated for the whole program, slowing down every regex whether you need the variables or not. Sorry, I forgot the source where that info came from.

    The code posted above is functional for the task (it can be refactored a small bit), he just needs to load up @data differently.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-25 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found