in reply to How to pass directory variable using IPC::System::Simple

Why do you import IPC::System::Simple? Maybe that module can export a subroutine foldername?

I recommend that you construct and print the filename before trying to launch the external program. For example:

my $date = '2016-07-25'; my $filename = "$savedir/TEST-$date.jpg"; system(...);

To get at the current date, the easiest approach is to use the strftime function from the POSIX module:

my $date = strftime '%Y-%m-%d', localtime; ...

Replies are listed 'Best First'.
Re^2: How to pass directory variable using IPC::System::Simple
by bill5262 (Acolyte) on Jul 25, 2016 at 07:39 UTC

    I honestly just used the Simple module just cuz someone told me to do so... literally.
    That's all I'm trying to do and I have no idea how to call the said command line without the module (*screams help*)
    Thanks for the POSIX module! I'll look that up for sure

      Hi bill5262,

      I made a mistake in my node, which I've now fixed, apologies!

      The line "use IPC::System::Simple;" should be "use IPC::System::Simple 'system';", because otherwise it has no effect, meaning that the default system function is called instead of IPC::System::Simple's version of system which has better error handling.

      Regards,
      -- Hauke D