Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Creating 2D array / Matrix

by kash650 (Novice)
on Mar 18, 2013 at 21:31 UTC ( #1024157=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^2: Creating 2D array / Matrix
Re^3: Creating 2D array / Matrix
by Cristoforo (Deacon) 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 :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024157]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-07-12 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls