Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: File modification

by jdporter (Paladin)
on Jul 07, 2006 at 13:01 UTC ( [id://559780]=note: print w/replies, xml ) Need Help??


in reply to File modification

#!perl -i.bak my $newnum = shift; @ARGV = qw( one.txt ); undef $/; # sluurp $_ = <>; s/(Authentication number) \d+/$1 $newnum/; print

The critical piece in all that is the -i.bak option passed to perl. If you can't do it on the shebang line, do it the exec (cmd) line of perl.

We're building the house of the future together.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://559780]
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: (3)
As of 2024-04-25 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found