Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Delete a line from files

by karlgoethebier (Abbot)
on Oct 12, 2015 at 11:38 UTC ( [id://1144515]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Delete a line from files
in thread Delete a line from files

"...the purpose of the BEGIN blocks?"

Begin to read?

Update: Slight losses are usual in every combat.

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^4: Delete a line from files
by Anonymous Monk on Oct 12, 2015 at 21:48 UTC
    I meant why set $^I and $^/ at compile time with Begin?
      These are documented in perlvar
      • for $^I search perlvar for "inplace". This has to be prepared before opening the file
      • $/ (without caret), if you use English, you can call it $INPUT_RECORD_SEPARATOR - should be set before the first read operation
      Update: the BEGIN block is necessary so that these assignments are executed before the implicit loop by the -p flag, see perlrun
        what is wrong with first opening the file with open and then setting those variables?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-24 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found