Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: Is it possible to modify __DATA__ via the DATA file handle or otherwise?

by LanX (Saint)
on Feb 10, 2018 at 13:13 UTC ( [id://1208895]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Is it possible to modify __DATA__ via the DATA file handle or otherwise?
in thread Is it possible to modify __DATA__ via the DATA file handle or otherwise?

Still using the tell of the DATA filehandle is the far better approach.

There is no guaranty to correctly match __DATA__ without having a full Perl parser.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery

  • Comment on Re^4: Is it possible to modify __DATA__ via the DATA file handle or otherwise?
  • Download Code

Replies are listed 'Best First'.
Re^5: Is it possible to modify __DATA__ via the DATA file handle or otherwise?
by haukex (Archbishop) on Feb 10, 2018 at 19:16 UTC
    Still using the tell of the DATA filehandle is the far better approach.

    You are correct, and thank you for the inspiration :-) I just released v0.08 of File::Replace with a new copy method:

    use warnings; use strict; use File::Replace 0.08 'replace3'; my ($infh,$outfh,$repl) = replace3(__FILE__,':raw'); $repl->copy(tell(DATA)); print $outfh "New stuff! ".gmtime." UTC\n"; $repl->finish; __DATA__

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-20 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found