Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: unwanted ARGV in subroutine

by perl_walker (Novice)
on Oct 30, 2012 at 07:06 UTC ( #1001465=note: print w/replies, xml ) Need Help??


in reply to Re^2: unwanted ARGV in subroutine
in thread unwanted ARGV in subroutine

Hi rizzler

Try this

sub addheader{ my($infile,$header)=@_; open(FILE, "$infile"); my $text=do {local $/; <FILE>}; close FILE; open(FILE,">$infile"); print FILE $header; print FILE $text; close FILE; }

Replies are listed 'Best First'.
Re^4: unwanted ARGV in subroutine
by Anonymous Monk on Oct 30, 2012 at 07:10 UTC
    Please don't try that :) it doesn't use error checking ... If you want to copy a file use File::Copy, for moving File::Move

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001465]
help
Chatterbox?
[holli]: i don't know. meat and tomatoes don't belong anywhere near each other in my book
[holli]: unless the meat is in sausage form and the tomatoes being ketchup, that is
[Discipulus]: no ragł? i'm sorry..;=)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2017-11-22 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (316 votes). Check out past polls.

    Notices?