Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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?

Replies are listed 'Best First'.
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, (" <input1> <input2> <output>". (This message tells the user that his perl program, 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024157]
[Corion]: choroba: Well, at least the above is user-defined, not implicitly by Perl ;)
LanX globalization is evil! Lets Perlxit!
[stevieb]: "Yeah, let's ban dot in INC, but add glob to it!" LOL!!!

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2017-01-19 15:44 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (170 votes). Check out past polls.