Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Using Temporary Files in Perl

by jjosserand (Initiate)
on Mar 30, 2015 at 15:29 UTC ( #1121852=note: print w/replies, xml ) Need Help??


in reply to Re: Using Temporary Files in Perl
in thread Using Temporary Files in Perl

IMHO - use of tmp files; in an owner directory or the global /tmp directory should be an acceptable process IF... "$$" is used in the filename to isolate it from use by multiple processes doing the same thing. ...and... IF... no username nor password information is stored there. A question I have; however, is related to use of tmp files vs. variables. I was recently slapped around in email at work by a cohort reviewing some code I'd written that uses tmp files to parge svn merge output saved there to determine success or failure since 'die' wasn't sending data to stdout nor stderr apparently so could not be easily trapped and parsed. Can anyone give a brief tutorial of better use of vars as opposed to tmp files for such things? I'd really appreciate that.

Replies are listed 'Best First'.
Re^3: Using Temporary Files in Perl
by choroba (Bishop) on Mar 30, 2015 at 16:20 UTC
    IF... "$$" is used in the filename to isolate it from use by multiple processes doing the same thing
    On shared filesystems, also include the machine name or IP/MAC address. I've encountered the $$ collision running a job on a 400+ nodes cluster.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1121852]
help
Chatterbox?
[Corion]: erix: The main thing holding me back from that is setting up a (throwaway) Linuxish environment to run the script. Usually I use the Google Cloud Shell for that, but something didn't work out right the last time I tried to use it for this
[Corion]: Andd using the Linux-For-Windows thing isn't great for throwaway environments either, and I'm too lazy to set up VMware or whatever ;)

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-07-23 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (465 votes). Check out past polls.

    Notices?