Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: What did you have to Unlearn

by tedv (Pilgrim)
on Jun 08, 2001 at 22:39 UTC ( #87006=note: print w/replies, xml ) Need Help??

in reply to Re: What did you have to Unlearn
in thread What did you have to Unlearn

Shouldn't that be something like...
$ftp->cd($dir) or ($ftp->mkdir($dir) and $ftp->cd($dir));
Technically, the most english way of writing the code (that actually works) is:
$ftp->mkdir($dir) and $ftp->cd($dir)
If you don't mind making the standard case having one extra file system access and the non-standard case having one less access.


Replies are listed 'Best First'.
Re: Re: What did you have to Unlearn
by Anonymous Monk on Jun 09, 2001 at 00:12 UTC
    Try it! The first time you end up in the dir. The second time not. Because mkdir fails. Because the dir is already there. Ok, there are Server around, which go "Make a Dir? Is the dir there or not? So don't bother me with particulars!". There your tactic succeeds.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://87006]
[stevieb]: can anyone recommend a good IDE for C programming that has *proper* vim plugin support? I've tried Eclipse, Netbeans etc and just can't get anything to work properly on Linux. I'm open to paying, but not on some monthly/yearly plan (just a one-off cost)
[stevieb]: I'd go with CLion as it's very similar to what I use already (intelliJ for Perl, Pycharm for Python), but it's a recurring fee every year

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-01-18 19:09 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (163 votes). Check out past polls.