Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

RE: (Ovid) Re: is this correct?

by damian (Beadle)
on Aug 10, 2000 at 10:24 UTC ( [id://27247]=note: print w/replies, xml ) Need Help??


in reply to (Ovid) Re: is this correct?
in thread is this correct?

hi ovid, guys, basically my problem with this is that if $afile only is defined, it proccess the following subroutines, but if i have $afile, $bfile defined it does not proccess $bfile. i am not sure if it is the code. thanks again.

Replies are listed 'Best First'.
(crazyinsomniac) RE: RE: (Ovid) Re: is this correct?
by crazyinsomniac (Prior) on Aug 10, 2000 at 11:23 UTC
    It sounds to me like you want this, but i'm not really sure?
    if( (defined $afile) && !(defined $bfile) ) { &parse_recent; &parse_monthly; &parse_new; &create_temp_a; &copy_new_to_recent; &copy_recent_to_monthly; &remove_excess; &done; } elsif( (defined $bfile) && !(defined $afile) ) { &parse_recent; &parse_monthly; &parse_new; &create_temp_a; &copy_new_to_recent; &copy_recent_to_monthly; &remove_excess; &done; }
     ______________________________________________
    |_____¸.·ooO--(> cRaZy is co01. <)--Ooo·.¸_____|
     ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
(Ovid) RE(3): is this correct?
by Ovid (Cardinal) on Aug 10, 2000 at 20:17 UTC
    if i have $afile, $bfile defined it does not proccess $bfile

    damian: we don't have enough information here to tell you what's going on. On the surface, your code should work. Are you getting any error messages or is your code silently going along and doing stuff without complaining? If you're not getting error messages, I suggest four courses of action:

    1. Go over your subs and see if your setting any global vars that you use as conditionals. If so, the next time you encounter them, your subs may see them and not execute desired code.
    2. Read Using the Perl Debugger and try it out on your code. It's a bit more work up front, but I guarantee that the debugger will become one your best friends in the future.
    3. Verify the you are checking the return codes whenever you open or close a file. For example: open FILE, $file or die "Can't open $file: $!\n". That $! will hold your error code. If you don't check the return codes, you will have no idea whether or not your file manipulations worked.
    4. And for last, here's my guess as to your problem: I suspect for your code that if $bfile is defined that your sub such as &parse_recent and &parse_monthly are supposed to act on $bfile. However, it's not clear from your code how you are passing the appropriate file to the subs. Are they just acting on $afile all the time?
    Hope this helps.

    Cheers,
    Ovid

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found