Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Help with stdout.... in perl..

by vitoco (Friar)
on Nov 13, 2009 at 15:23 UTC ( #806972=note: print w/ replies, xml ) Need Help??


in reply to Help with stdout.... in perl..

Hola Michael. ˇBienvenido!

As it was said, you must move the $fecha assignment just before the find(), but I guess a chomp should be needed:

my $fecha = `date +%F--%k:%M`; chomp($fecha);

A sub may appear anywhere in your code, but it will be used when it is called, so your $fecha assignment is logically misplaced. If you wanted to get a new date for each processed file, put the previous lines inside a subroutine.

Why are you using STDOUT to create new files? Just recycle FILE or use another fd, and close() it before chown().

Also, use strict and use warnings when writing and testing new code. I've learned too much from them.


Comment on Re: Help with stdout.... in perl..
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-12-27 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls