in reply to Re: Creating 2D array / Matrix
in thread Creating 2D array / Matrix

Can you explain the $usage and "shift or die" part?

Replies are listed 'Best First'.
Re^3: Creating 2D array / Matrix
by Cristoforo (Curate) on Mar 18, 2013 at 22:32 UTC
    shift here shifts from the @ARGV array. If it fails, (if not enough file names, 3, were supplied on the command line), then the program dies, (quits), and prints the string contained in $usage, ("merge_bed.pl <input1> <input2> <output>". (This message tells the user that his perl program, merge_bed.pl or whatever name you choose as your program name requires 2 input filenames and 1 output name).
Re^3: Creating 2D array / Matrix
by Anonymous Monk on Mar 19, 2013 at 07:11 UTC

    Can you explain the $usage and "shift or die" part?

    If you employ Basic debugging checklist (deparse,print) you can figure it out pretty quick :)