Dea Monks,

I have an incorrect syntax when using mkpath but I cannot correct my error. I want to create the directories but it does not seem to work. Could you help me ? Thanks

Here is my code :

#! usr/bin/perl -w use strict; use File::Copy; use File::Path; my $date = $ARGV[0]; my $comptage = $ARGV[1]; my $C = $comptage; # index : input ou output my $index = $ARGV[2]; my $I = $index; my $week = $ARGV[3]; my $W = $week; print STDOUT "the week is ${W}\n"; my $cmda=qq{mkpath('M1_fa_${W}/M1_${W}_comptage_${C}_${I}_first_action +')}; my $cmdb=qq{mkpath('M2_fa_${W}/M2_${W}_comptage_${C}_${I}_first_action +')}; my $cmdc=qq{mkpath('M3_fa_${W}/M3_${W}_comptage_${C}_${I}_first_action +')}; system($cmda); system($cmdb); system($cmdc);

I get the error message

sh -c: line 0: syntax error near unexpected token ' 'M3_fa_W42/M3_W42_ +comptage_60_output_first_action' ' <code>
update: added some elements to take into account Corion's remark

In reply to incorrect syntax when using mkpath by steph_bow

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.