Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: insert into beginning of file

by zentara (Archbishop)
on Jul 22, 2002 at 17:21 UTC ( [id://184138]=note: print w/replies, xml ) Need Help??


in reply to insert into beginning of file

Here's a method similar to using Tie::File, but dosn't require
a module. It dosn't delete....it overwrites :-)
#!/usr/bin/perl $file= $ARGV[0]; @file =(<>); unshift @file, "My newline headline\n"; open (FH,">$file")or die "Cant open: $!"; print FH @file; close FH;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-24 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found