Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: logfile rotate w/ pass by reference

by Joost (Canon)
on Mar 14, 2005 at 16:26 UTC ( [id://439336]=note: print w/replies, xml ) Need Help??


in reply to logfile rotate w/ pass by reference

sub logroll { my $logs = new Logfile::Rotate (File => $_, <---- your problem is here

You're not using the argument given to &logroll(), instead, you're using $_, which is set to the currently read line from one of your filehandles.

Also, proper indenting of your code will make it a lot clearer. perltidy might help.

Replies are listed 'Best First'.
Re^2: logfile rotate w/ pass by reference
by drock (Beadle) on Mar 14, 2005 at 16:51 UTC
    Thank ytou and I realize my problem where you stated. But I am unsure of the correct syntax??? I tried this:
    logroll($filename) sub logroll { my $logs = new Logfile::Rotate (File => $_, <- - - - What needs to go here?
        ok so in your sample code how does the subroutine know what variable it is receiving based off of your filename? Im ny code I have two distinct filenames I want to pass to logfile::rotate so how do I do this?
        if ( ( my $dif = $dif[1] - $dif[2] ) > 199 ) { &mailme; logroll($out); if ( ( my $diff = $diff[1] - $diff[2] ) > 199 ) { &mailme; logroll($out1); sub logroll { my $logs = new Logfile::Rotate (File => ???? # <---- what is here based? Count => 10, # off of 2 diff filenames Gzip => 'lib', Dir => '/usr/local/log/old', Flock => 'yes', Persist => 'yes' ); $logs->rotate(); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-25 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found